why this command won't show? - 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)
+--- Thread: why this command won't show? (
/showthread.php?tid=296707)
why this command won't show? -
Mr_Scripter - 12.11.2011
i have /Myrank command and ingame when i type /Myrank it says Server unkown command
here is my Script
pawn Код:
COMMAND:Myrank(playerid, params[])
{
#pragma unused params
if(GetPlayerScore(playerid) == 0) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Newbie");
else if(GetPlayerScore(playerid) == 100) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Killa");
else if(GetPlayerScore(playerid) == 200) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Young Gangsta");
else if(GetPlayerScore(playerid) == 300) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Mobsta");
else if(GetPlayerScore(playerid) == 500) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Gangsta");
else if(GetPlayerScore(playerid) == 900) return SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Boss");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Total Ranks", "Newbie -\n Killa \nYoung Gangsta \nMobsta \nGangsta \n Boss*", "Ok", "");
return 1;
}
Re: why this command won't show? -
Cypress - 12.11.2011
pawn Код:
COMMAND:Myrank(playerid, params[]) // any command should be written with small letters
//change it to
COMMAND:myrank(playerid, params[])
Respuesta: why this command won't show? -
admantis - 12.11.2011
1) It wouldn't work because you are checking the player's EXACT score, what if it's 511, instead of 500? nothing.
2) If you use return before the dialog it will never be called (the dialog) because it stops the code at that line.
pawn Код:
COMMAND:myrank(playerid, params[])
{
#pragma unused params
if(GetPlayerScore(playerid) > 0 && GetPlayerScore(playerid) < 100 ) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Newbie");
else if(GetPlayerScore(playerid) > 100 && GetPlayerScore(playerid) < 200 ) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Killa");
else if(GetPlayerScore(playerid) > 200 && GetPlayerScore(playerid) < 300 ) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Young Gangsta");
else if(GetPlayerScore(playerid) > 300 && GetPlayerScore(playerid) < 500 ) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Mobsta");
else if(GetPlayerScore(playerid) > 500 && GetPlayerScore(playerid) < 900 ) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Gangsta");
else if(GetPlayerScore(playerid) > 900) SendClientMessage(playerid, COLOR_BRIGHTRED, "Your Rank is Boss");
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Total Ranks", "Newbie -\n Killa \nYoung Gangsta \nMobsta \nGangsta \n Boss*", "Ok", "");
return 1;
}
Re: why this command won't show? -
fordawinzz - 12.11.2011
it works fine for me.. no problem, maybe it's from your gamemode, try it on grandlarc