SA-MP Forums Archive
OnPlayerUpdate error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerUpdate error (/showthread.php?tid=388584)



OnPlayerUpdate error - verlaj - 29.10.2012

This code isnt working

Код:
public OnPlayerUpdate(playerid)
{
    if (GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) <= 100)
    {
    TextDrawHideForPlayer(playerid,Rank);
    Rank = TextDrawCreate(10.000000, 500.000000, "~g~Level : ~b~1");
	TextDrawBackgroundColor(Rank, 255);
	TextDrawFont(Rank, 0);
	TextDrawLetterSize(Rank, 0.450000, 1.900000);
	TextDrawColor(Rank, -1);
	TextDrawSetOutline(Rank, 1);
	TextDrawSetProportional(Rank, 1);
	TextDrawUseBox(Rank, 0);
	TextDrawBoxColor(Rank, 150);
	TextDrawTextSize(Rank, 150.000000, 20.000000);
	}
	if GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) <=200*then
    {
    TextDrawHideForPlayer(playerid,Rank);
    Rank = TextDrawCreate(10.000000, 500.000000, "~g~Level : ~b~2");
	TextDrawBackgroundColor(Rank, 255);
	TextDrawFont(Rank, 0);
	TextDrawLetterSize(Rank, 0.450000, 1.900000);
	TextDrawColor(Rank, -1);
	TextDrawSetOutline(Rank, 1);
	TextDrawSetProportional(Rank, 1);
	TextDrawUseBox(Rank, 0);
	TextDrawBoxColor(Rank, 150);
	TextDrawTextSize(Rank, 150.000000, 20.000000);
	}
       return 1;
}



Re: OnPlayerUpdate error - verlaj - 29.10.2012

any suggestion ?
problem is it aren't displaying the player score, maybe problem with TextDrawCreate(10.000000, 500.000000, "~g~Level : ~b~1"); ?


Re: OnPlayerUpdate error - RedFusion - 29.10.2012

You are supposed to create textdraws once. Inside OnGameModeInit for example
Then set the textdraw to a string inside OnPlayerUpdate
Dont forget to show the textdraw in OnPlayerSpawn for example


Re: OnPlayerUpdate error - verlaj - 29.10.2012

ohh ok thanks.