LSPD Cars Problem
#4

pawn Код:
if(carid == LSPD[0] && PlayerInfo[playerid][Faction] != 1)
Only first spawned LSPD car is protected.
Let's try a little diffrent approach:
pawn Код:
new LSPD[28];
//change to
#define LSPD_CARS (28)
new LSPD[LSPD_CARS];
new ptrLSPD = 0;
pawn Код:
LSPD[0] = AddStaticVehicle(596,1528.7373,-1687.9275,5.6120,89.6197,1,0);
//Change to
ptrLSPD = AddStaticVehicle(596,1528.7373,-1687.9275,5.6120,89.6197,1,0);
LSPD[0] = ptrLSPD;
Then

pawn Код:
//Change
if(carid == LSPD[0] && PlayerInfo[playerid][Faction] != 1)
//to
if(ptrLSPD <= carid <= ptrLSPD + LSPD_CARS && PlayerInfo[playerid][Faction] != 1)
#e: Of course you can simply loop through all vehicles, but it's standard memory/CPU dilemma
Reply


Messages In This Thread
LSPD Cars Problem - by XStormiest - 07.08.2013, 09:45
Re: LSPD Cars Problem - by Skribblez - 07.08.2013, 09:50
Re: LSPD Cars Problem - by XStormiest - 07.08.2013, 09:53
Re: LSPD Cars Problem - by Misiur - 07.08.2013, 10:02
Re: LSPD Cars Problem - by XStormiest - 07.08.2013, 10:09
Re: LSPD Cars Problem - by Skribblez - 07.08.2013, 10:22
Re: LSPD Cars Problem - by Misiur - 07.08.2013, 10:25
Re: LSPD Cars Problem - by XStormiest - 07.08.2013, 10:30
Re: LSPD Cars Problem - by -Prodigy- - 07.08.2013, 10:30
Re: LSPD Cars Problem - by Misiur - 07.08.2013, 10:33

Forum Jump:


Users browsing this thread: 2 Guest(s)