SA-MP Forums Archive
Text on 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: Text on screen (/showthread.php?tid=401503)



Text on screen - NighelN - 23.12.2012

How i put a text on screen like servername/score/rank name

something like this picture




Re: Text on screen - Ballu Miaa - 23.12.2012

These are what we call Textdraws. You need to format() a string with the Score Variable then use the string in the Textdraw.

Link to SAMP Wiki


Re: Text on screen - nilanjay - 23.12.2012

Those text are called Textdraw. I recommend that you use a FS that create textdraw in-game. Search the filterscript section.


Re: Text on screen - Nicholas. - 23.12.2012

Maybe this tutorial could help, https://sampforum.blast.hk/showthread.php?tid=241026.


Re: Text on screen - NighelN - 23.12.2012

Quote:
Originally Posted by nilanjay
Посмотреть сообщение
Those text are called Textdraw. I recommend that you use a FS that create textdraw in-game. Search the filterscript section.
So like this one?

https://sampforum.blast.hk/showthread.php?tid=290640


Re: Text on screen - Faisal_khan - 23.12.2012

Yeah that is a textdraw editor. I would prefer you to use iPleomax's Textdraw editor.
https://sampforum.blast.hk/showthread.php?tid=376758


Re: Text on screen - NighelN - 23.12.2012

I got it to work but now it wont like show the rank and i dont have a clue how im gonna do the kills etc



pawn Код:
new string[24];
        format(string, sizeof(string), "Rank: %s", GetRankName(i));
        Ranks[i] = TextDrawCreate(497.000000, 137.0000, string);
        TextDrawBackgroundColor(Ranks[i], 255);
        TextDrawFont(Ranks[i], 2);
        TextDrawLetterSize(Ranks[i], 0.5000, 1.0000);
        TextDrawColor(Ranks[i], -1);
        TextDrawSetOutline(Ranks[i], 1);
        TextDrawSetProportional(Ranks[i], 1);

stock GetRankName(playerid)
{
new str3[64];
if (GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) <= 99) str3 = ("Private");
if (GetPlayerScore(playerid) >= 100 && GetPlayerScore(playerid) <= 299) str3 = ("Lance Corporal");
if (GetPlayerScore(playerid) >= 300 && GetPlayerScore(playerid) <= 499) str3 = ("Corporal");
if (GetPlayerScore(playerid) >= 500 && GetPlayerScore(playerid) <= 999) str3 = ("Sergeant");
if (GetPlayerScore(playerid) >= 1000 && GetPlayerScore(playerid) <= 1499) str3 = ("Staff Sergeant");
if (GetPlayerScore(playerid) >= 1500 && GetPlayerScore(playerid) <= 1999) str3 = ("Warrant Officer");
if (GetPlayerScore(playerid) >= 2000 && GetPlayerScore(playerid) <= 2499) str3 = ("Lieutenant");
if (GetPlayerScore(playerid) >= 2500 && GetPlayerScore(playerid) <= 4999) str3 = ("Captain");
if (GetPlayerScore(playerid) >= 5000 && GetPlayerScore(playerid) <= 9999) str3 = ("Major");
if (GetPlayerScore(playerid) >= 7000) str3 = ("General");
if (GetPlayerScore(playerid) >= 10000 && GetPlayerScore(playerid) <= 9999) str3 = ("Field Marshal");
return str3;
}



Re: Text on screen - JaKe Elite - 23.12.2012

you've to TextDrawShowForPlayer.


Re: Text on screen - Faisal_khan - 23.12.2012

Try using 'or':
pawn Код:
if (GetPlayerScore(playerid) >= 0 || GetPlayerScore(playerid) <= 99) str3 = ("Private");



Re: Text on screen - NighelN - 23.12.2012

But wont that work? becuase it should be between 0 < 99 and 100 < 299

and i do have
pawn Код:
TextDrawShowForPlayer(playerid, Scores[playerid]);
    TextDrawShowForPlayer(playerid, Kill[playerid]);
    TextDrawShowForPlayer(playerid, Death[playerid]);
    TextDrawShowForPlayer(playerid, Ranks[playerid]);