SA-MP Forums Archive
Rank system - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Rank system (/showthread.php?tid=275982)



Rank system - Admigo - 11.08.2011

Heey guys,

I made a rank system but when there are more players online you see the score of the other player.
I made it in a textdraw:
Код:
forward sc(playerid);
public sc(playerid)
{
	for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
			if(rank0[playerid]==1)
			{
			new xp;
			xp=GetPlayerScore(i);
			new string[50];
			format(string,sizeof(string),"XP:%d/100",xp);
			TextDrawSetString(ys,string);
			}
			if(rank1[playerid]==1)
			{
			new xp;
			xp=GetPlayerScore(i);
			new string[50];
			format(string,sizeof(string),"XP:%d/225",xp);
			TextDrawSetString(ys,string);
			}
			if(rank2[playerid]==1)
			{
			new xp;
			xp=GetPlayerScore(i);
			new string[50];
			format(string,sizeof(string),"XP:%d/400",xp);
			TextDrawSetString(ys,string);
			}
		}

	}
}
I added time so the rank stays updating.


Re: Rank system - antonio112 - 11.08.2011

Use
pawn Код:
format(string,sizeof(string),"XP:%d/100",xp[playerid]);



Re: Rank system - Admigo - 11.08.2011

Quote:
Originally Posted by antonio112
Посмотреть сообщение
Use
pawn Код:
format(string,sizeof(string),"XP:%d/100",xp[playerid]);
now everybody has same Textdraw;s


Re: Rank system - =WoR=Varth - 12.08.2011

pawn Код:
new ys[MAX_PLAYERS];//Change your variable.