HELP ME BY GOD'S LOVE
#1

HELP ME PLEASE THIS FS,

Код:
#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;
}
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




Please do not ignore it
Reply
#2

Your problem is here
new Text:Textdraw0;
You have a global textdraw, make it for each player like this:
new Text:Textdraw0[MAX_PLAYERS];
After that replace in gm Textdraw0 with Textdraw0[playerid]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)