Small 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)
+--- Thread: Small error? (
/showthread.php?tid=441450)
Small error? -
whando - 02.06.2013
Код:
if(strcmp(cmd, "/admincolor", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, GREY, "You are not a Admin");
if(GetPVarInt(playerid, "AdminColor") == 0)
{
SetPVarInt(playerid, "AdminColor", 1);
SendClientMessage(playerid, 0x3399FFFF, "Your name is now colored.");
SetPlayerToTeamColor(playerid);
}
else if(GetPVarInt(playerid, "AdminColor") == 1)
{
DeletePVar(playerid, "AdminColor");
SendClientMessage(playerid, GREY, " Your name is no longer colored.");
SetPlayerToTeamColor(playerid);
}
return 1;
}
Why can't I use it as a higher admin then lvl 2?
Re: Small error? -
Richie© - 02.06.2013
pawn Код:
if (PlayerInfo[playerid][pAdmin] >= 2) return SendClientMessage(playerid, GREY, "You are not a Admin");
That is if pAdmin is equal or higher then 2 it will return "you are not admin".
Use;
pawn Код:
if (PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, GREY, "You are not a Admin");
If pAdmin is lower then 2, they cant use the command.
Re: Small error? -
whando - 02.06.2013
Oh, thanks!