Score Check error - 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: Score Check error (
/showthread.php?tid=277992)
Score Check error -
knackworst - 20.08.2011
Hi, I was trying to make a little system, that when a player connects, the server checks its score so I can add name tags based on their score, Ex: I join the server and my score is 125, that means u r level 2 in my server, so in front of their name; there must stand not just their name. ex: Teletubbie but there should stand: [L2]Teletubbie.
However I have some errors, scripting the score check system, please help me out!
Code:
public score_check(playerid)
{
if(GetPlayerScore(playerid) == <120)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%[L1]s",name);
SetPlayerName(playerid, string);
}
if(GetPlayerScore(playerid) == <180)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%[L2]s",name);
SetPlayerName(playerid, string);
}
if(GetPlayerScore(playerid) == >180)
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%[L3]s",name);
SetPlayerName(playerid, string);
}
}
NOTE: I didn't show all the timer function and its forwards, because i have no errors about the timer.
Re: Score Check error -
iMonk3y - 20.08.2011
Code:
if(GetPlayerScore(playerid) > 120 && GetPlayerScore(playerid) < 180) //Above 120 & below 180
{
new name[MAX_PLAYER_NAME], string[44];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[L1]%s",name);
SetPlayerName(playerid, string);
}
Quick and simple! The rest should be piece of cake..
Re: Score Check error -
knackworst - 20.08.2011
THanks alot!
: D