03.05.2012, 07:56
Heey all,
I made a speedo with a timer(lol every speedo needs a timer)
But i changed the settimer to settimerex because the timer was detecting it for all players.
But know my textdraw dont show up.
Problem 2:
I made a key for hiding a textdraw but when i press the key its hiding my speedo to and i didnt placed the hidetextdraw code for the speedo.
How can i fix those problems?
Thanks Admigo
I made a speedo with a timer(lol every speedo needs a timer)
But i changed the settimer to settimerex because the timer was detecting it for all players.
But know my textdraw dont show up.
Код:
//onplayerconnect:
SetTimerEx("SpeedoUpdate",100,1,"i",playerid);
public SpeedoUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(GetPVarInt(playerid,"Speedo")==0)
{
TextDrawHideForPlayer(playerid,TextDraw90[playerid]);
}
else if(GetPVarInt(playerid,"Speedo")==1)
{
new Float:x,Float:y,Float:z,Float:hp,string[24],vehicleid = GetPlayerVehicleID(playerid);
//TextDrawShowForPlayer(i,box[i]);
TextDrawShowForPlayer(playerid,TextDraw90[playerid]);
//TextDrawShowForPlayer(i,health[i]);
GetVehicleVelocity(vehicleid,x,y,z);
GetVehicleHealth(vehicleid,hp);
format(string,sizeof(string),"MPH : %d",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*156.666667));
TextDrawSetString(TextDraw90[playerid],string);
}
else if(GetPVarInt(playerid,"Speedo")==2)
{
new Float:x,Float:y,Float:z,Float:hp,string[24],vehicleid = GetPlayerVehicleID(playerid);
//TextDrawShowForPlayer(i,box[i]);
TextDrawShowForPlayer(playerid,TextDraw90[playerid]);
//TextDrawShowForPlayer(i,health[i]);
GetVehicleVelocity(vehicleid,x,y,z);
GetVehicleHealth(vehicleid,hp);
format(string,sizeof(string),"KPH : %d",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*250.666667));
TextDrawSetString(TextDraw90[playerid],string);
}
}
if(!IsPlayerInAnyVehicle(playerid))
{
TextDrawHideForPlayer(playerid,TextDraw90[playerid]);
}
}
I made a key for hiding a textdraw but when i press the key its hiding my speedo to and i didnt placed the hidetextdraw code for the speedo.
How can i fix those problems?
Thanks Admigo

