SA-MP Forums Archive
level show in the screen - 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: level show in the screen (/showthread.php?tid=290725)



level show in the screen - marik1322 - 16.10.2011

how can i script a level show in the screen ?
i want that it will work on the score of the player




Re: level show in the screen - Dolby - 16.10.2011

TextDrawCreate + TextDrawSetString.


Re: level show in the screen - Kingunit - 16.10.2011

Click here! put that in a textdraw.


Re: level show in the screen - marik1322 - 16.10.2011

how to put it?


Re: level show in the screen - marik1322 - 16.10.2011

i did like that
PHP код:
new Text:himessage;
public 
OnGameModeInit()
{
himessage TextDrawCreate(1.05.6"Level");
}
public 
OnPlayerConnect(playerid)
{
       new 
newtext[41];
    
format(newtextsizeof(newtext), "Level: %i",PlayerLevel[playerid]);
    
TextDrawSetString(himessagenewtext);
       
TextDrawShowForPlayer(playeridhimessage); 
but its not working because it shows me level 0
and my level is 1337


Re: level show in the screen - Kingunit - 16.10.2011

Because you didn't used GetPlayerScore.


Re: level show in the screen - marik1322 - 16.10.2011

i dont need playerscore i need the player level that i script

I have command that working and shows the level
PHP код:
command(scoreplayeridparams[])
{
 new 
string[128];
 
format(stringsizeof(string), "Score: %i",PlayerLevel[playerid]);
 
SendClientMessage(playeridRedstring);
 return 
1;




Re: level show in the screen - Kingunit - 16.10.2011

pawn Код:
CMD:score(playerid, params[])
{
    new string[128];
   
    format(string, sizeof(string), "Score: %i",PlayerLevel[playerid]); // Correct var?
    SendClientMessage(playerid, Red, string);
    return 1;
}



Re: level show in the screen - marik1322 - 16.10.2011

the command is working
this not working

PHP код:
new Text:himessage;
public 
OnGameModeInit()
{
himessage TextDrawCreate(1.05.6"Level");
}
public 
OnPlayerConnect(playerid)
{
       new 
newtext[41];
    
format(newtextsizeof(newtext), "Level: %i",PlayerLevel[playerid]);
    
TextDrawSetString(himessagenewtext);
       
TextDrawShowForPlayer(playeridhimessage); 



Re: level show in the screen - Kingunit - 16.10.2011

Are you getting errors? And the PlayerLevel is a known var?