Text on screen
#1

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

something like this picture

Reply
#2

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

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

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

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

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

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

you've to TextDrawShowForPlayer.
Reply
#9

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

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]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)