Skripta koju koristim: Moja skripta
Detaljan opis problema: Imam neki manji problem sa spremanjem vozila..Naime, odradio sam "array sistem" i sada sve to lepo radi, ali javlja se jedan problem, primer: Policajac udje u kola i sve to lepo radi, ali problem je u tome sto kada bi policajac hteo da uhapsi nekog i ubaci ga u kola, tog igraca bi zbog array sistema izbacivalo iz kola, jer on nije clan policija
Moje pitanje glasi, kako da ja napravim da igrac ne moze da vozi ako nije ispunio if (u mom slucaju policajac) ali da moze da sedne u kole kao suvozac (tipka G)
Dio skripte:new PolVeh[14];
PolVeh[0] = CreateVehicle(596, 1536.0129,-1667.1157,13.1031,180.1390, 1, 2, 100);
PolVeh[1] = CreateVehicle(596, 1536.0745,-1678.3518,13.1049,359.4723, 1, 2, 100);
PolVeh[2] = CreateVehicle(596, 1543.4711, -1676.2714, 5.5219, 90.0000, 1, 2, 100);
PolVeh[3] = CreateVehicle(596, 1543.4834, -1671.9791, 5.5219, 90.0000, 1, 2, 100);
PolVeh[4] = CreateVehicle(596, 1543.4337, -1667.6621, 5.5219, 90.0000, 1, 2, 100);
PolVeh[5] = CreateVehicle(596, 1543.4144, -1663.1532, 5.5219, 90.0000, 1, 2, 100);
PolVeh[6] = CreateVehicle(599, 1570.3860, -1709.2091, 5.9721, 0.0000, 1, 2, 100);
PolVeh[7] = CreateVehicle(599, 1574.8467, -1709.1356, 5.9721, 0.0000, 1, 2, 100);
PolVeh[8] = CreateVehicle(599, 1578.6931, -1709.0995, 5.9721, 0.0000, 1, 2, 100);
PolVeh[9] = CreateVehicle(599, 1558.7076, -1708.7542, 5.9721, 0.0000, 1, 2, 100);
PolVeh[10] = CreateVehicle(560, 1587.7191, -1709.2938, 5.3808, 0.0000, 1, 0, 100);
PolVeh[11] = CreateVehicle(560, 1591.4175, -1709.1449, 5.3808, 0.0000, 1, 0, 100);
PolVeh[12] = CreateVehicle(560, 1595.5775, -1709.1324, 5.3808, 0.0000, 1, 0, 100);
PolVeh[13] = CreateVehicle(560, 1583.4590, -1709.1510, 5.3808, 0.0000, 1, 0, 100);
stock Policijska(carid)
{
for(new i = 0; i < sizeof(PolVeh); i++)
{
if(carid == PolVeh[i]) return 1;
}
return 0;
}
if(Policijska(vozilo))
{
if ((PlayerInfo[playerid][pLider]!=1) && (PlayerInfo[playerid][pClan] !=1))
{
new Float:x, Float:y, Float:z;
GameTextForPlayer(playerid, "~w~Zakljucano~n~~r~Niste clan Policije!!", 4000, 5);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x-2, y, z+1);
}
}
Neke slike/video za lakse dobivanje pomoci(neobavezno):[/color]
if(Policijska(vozilo))
{
if ((PlayerInfo[playerid][pLider]!=1) && (PlayerInfo[playerid][pClan] !=1))
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new Float:x, Float:y, Float:z;
GameTextForPlayer(playerid, "~w~Zakljucano~n~~r~Niste clan Policije!!", 4000, 5);
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x-2, y, z+1);
}
}
}
Ovo getplayerpos setplayerpos je bespotrebno koristi funkciju removeplayerfromvehicle
Nisam probao, ali mislim da ce raditi, nisam znao funkciju koja treba da se ubaci...Hvala puno