Why my textdraw dont show?
#1

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.
Код:
//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]);
		}
}
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
Reply
#2

public OnPlayerSpawn

TextDrawShowForPlayer(playerid, TextDraw90);
Reply
#3

1) use [ pawn ] tags instead of [ code ] to show code (syntax highlighting makes it easier to read)

2) how do you set the "Speedo" PVar ?

3) showing the code for problem 2 would be good
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)