OnPlayerUpdate error
#1

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;
}
Reply
#2

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

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
Reply
#4

ohh ok thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)