04.06.2010, 07:13
How do I carry the vehicle ID along in a SetTimerEx? Because some vehicles are not arrayed, in other words, their vehicle ID's are numbers. Some are named in arrays, like kacc_humvee etc., and that would be a string.
So how do I carry along the vehicle's ID?
This code below crashes my compiler.
Could someone tell me how to do this properly?
EDIT: Oh wait, I think I solved it.
Just carry along the playerid and then get the vehicle ID in the timer?
So how do I carry along the vehicle's ID?
This code below crashes my compiler.
pawn Код:
updatespeedtimer = SetTimerEx("UpdateSpeed", 500, true, "ds", playerid, vehid);
forward UpdateSpeed(playerid, vehid);
public UpdateSpeed(playerid, vehid);
{
new speed = GetPlayerSpeed(playerid, false);
new string[3];
format(string, sizeof string, "%d", speed);
TextDrawSetString(SpeedoSpeed, string)
}
EDIT: Oh wait, I think I solved it.
Just carry along the playerid and then get the vehicle ID in the timer?