HELP PLS
#1

Please help me with this filterscript because it only went to see the bugs now that the server is online

1. I want the name of "rank" also appear on the head of the player, for all players know the "rank" of his rival.

2. in-game to TextDraw owned a bug / error, I do not know'm not specify connoisseur, the bug is that the Score, Rank, Money is changing when some other player logs.

When you enter another player on the server, it is appearing altering my score and the score of the other player, and so with Rank and Money

Quote:

#include <a_samp>

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new rank[ MAX_PLAYERS ];

public OnFilterScriptInit()
{
Textdraw0 = TextDrawCreate(41.600021, 291.359832, "Score:~g~");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 2);
TextDrawLetterSize(Textdraw0, 0.420398, 2.831994);
TextDrawColor(Textdraw0, 16777215);
TextDrawSetOutline(Textdraw0, 1);
TextDrawSetProportional(Textdraw0, 1);

Textdraw1 = TextDrawCreate(41.600021, 311.359832, "Money:~g~");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 2);
TextDrawLetterSize(Textdraw1, 0.420398, 2.831994);
TextDrawColor(Textdraw1, 16777215);
TextDrawSetOutline(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

Textdraw2 = TextDrawCreate(41.600021, 271.359832, "Patente:~g~");
TextDrawBackgroundColor(Textdraw2, 255);
TextDrawFont(Textdraw2, 2);
TextDrawLetterSize(Textdraw2, 0.420398, 2.831994);
TextDrawColor(Textdraw2, 16777215);
TextDrawSetOutline(Textdraw2, 1);
TextDrawSetProportional(Textdraw2, 1);
return 1;
}

public OnPlayerSpawn( playerid )
{
TextDrawShowForPlayer( playerid, Textdraw0 );
TextDrawShowForPlayer( playerid, Textdraw1 );
TextDrawShowForPlayer( playerid, Textdraw2 );
return 1;
}

public OnPlayerUpdate( playerid )
{
new string[ 128 ];
new score;
score = GetPlayerScore(playerid);
format( string, sizeof string, "Score:~g~ %d", score );
TextDrawSetString(Textdraw0, string);
new cash;
cash = GetPlayerMoney( playerid );
format( string, sizeof string, "Money:~g~ %d", cash );
TextDrawSetString(Textdraw1, string );
if(GetPlayerScore(playerid) >= 800) rank[ playerid ] = 6;
else if(GetPlayerScore(playerid) >= 500) rank[ playerid ] = 5;
else if(GetPlayerScore(playerid) >= 300) rank[ playerid ] = 4;
else if(GetPlayerScore(playerid) >= 150) rank[ playerid ] = 3;
else if(GetPlayerScore(playerid) >= 100) rank[ playerid ] = 2;
else if(GetPlayerScore(playerid) >= 50) rank[ playerid ] = 1;
else if(GetPlayerScore(playerid) >= 0) rank[ playerid ] = 0;
switch(rank[playerid])
{
case 0: TextDrawSetString( Textdraw2, "Rank:~r~ Novato");
case 1: TextDrawSetString( Textdraw2, "Rank:~y~ Mediano");
case 2: TextDrawSetString( Textdraw2, "Rank:~g~ Bom");
case 3: TextDrawSetString( Textdraw2, "Rank:~g~ Reliquia");
case 4: TextDrawSetString( Textdraw2, "Rank:~g~ Avancado");
case 5: TextDrawSetString( Textdraw2, "Rank:~g~ Brabo");
case 6: TextDrawSetString( Textdraw2, "Rank:~g~ Profissional");
}
return 1;
}

I do not quite understand these codes
The name need not appear in TextDraw, can be something simple

+Rep For the help
Reply
#2

Just saying, this got answered on https://sampforum.blast.hk/showthread.php?tid=589386

Don't post multiple threads asking the same thing, re-use your old topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)