Quote:
Originally Posted by Osamakurdi
My Code:
PHP код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
speed[playerid] = TextDrawCreate(500, 373, "SPEED:");
TextDrawUseBox(speed[playerid], 0);
TextDrawFont(speed[playerid], 3);
TextDrawBoxColor(speed[playerid], 0x252826FF);
format(str, sizeof(str), "SPEED:~y~%i", GetPlayerVehicleSpeed(playerid));
TextDrawSetString(speed[playerid], str);
TextDrawShowForPlayer(playerid, speed[playerid]);
SetTimer("speedtime",1000, 0);
/////////////////////////////////////
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TextDrawDestroy(speed[playerid]);
TextDrawHideForPlayer(playerid, speed[playerid]);
return 1;
}
|
Your code is really bad, for instance, Per-Player textdraws should be used to do stuff like these.
Please look up a speedometer tutorial on the forums.