Quote:
Originally Posted by [FU]Victious
Lol, the only reason I commented was thanks for the IsVehicleOccupied function, other than that, this has been done before, but in a FS. And it's released too, but I'm not going to waste my time searching for it 
|
I didn't know about that
Quote:
Originally Posted by Hiddos
I'm wondering, I only did a same stock just like the IsVehicleOccupied (Almost same coding, but even less optimized  ), wouldn't it be more efficient if you'd use it like this?
pawn Код:
new bool:VehicleOccupied[MAX_VEHICLES];
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER) { VehicleOccupied[GetPlayerVehicleID(playerid) - 1] = true; SetPVarInt(playerid, "InVehicle", GetPlayerVehicleID(playerid)); } if(oldstate == PLAYER_STATE_DRIVER) { VehicleOccupied[GetPVarInt(playerid, "InVehicle") - 1] = false; DeletePVar(playerid, "InVehicle"); } return 1; }
stock bool:IsVehicleOccupied(vehicleid) //Are bools needed here? :D { return VehicleOccupied[vehicleid - 1]; }
Just an idea of what I think might be a bit efficienter, correct me if I'm wrong. Now I'm gonna try this at home :P
|
Mhh.. it could be.. try it :P