10.11.2009, 01:58
I have a question about which is faster and such. Suppose you were using an enumeration for example or just an array for that matter and you needed a certain one from the enum multiple times in one function. Like this.
That's just an example. What I was wondering is if it would be faster to just do this.
I just thought maybe it would be easier for it to look up that variable once and just use it locally in whatever function instead of looking it up multiple times. But since I don't know how the computer processes this information or in what order it does it, I was just asking.
pawn Код:
GetVehiclePos(PlayerInformation[playerid][LastVehicleID],x,y,z);
SetPlayerPos(i,x,y,z);
SetVehicleHealth(PlayerInformation[playerid][LastVehicleID],0);
DestroyVehicle(PlayerInformation[playerid][LastVehicleID]);
pawn Код:
new veh = PlayerInformation[playerid][LastVehicleID];
GetVehiclePos(veh,x,y,z);
SetPlayerPos(i,x,y,z);
SetVehicleHealth(veh,0);
DestroyVehicle(veh);

