PHP код:
CMD:setlevel(playerid, params[])
{
new TargetPlayer, level, str[128], new name[MAX_PLAYER_NAME];
if(pInfo[playerid][Admin] >= 3)
{
if(sscanf(params, "ui", TargetPlayer, level)) return SendClientMessage(playerid, -1, "{1E90FF}(Server):{dadada} /setlevel [id] [level]");
if(!IsPlayerConnected(TargetPlayer)) return SendClientMessage(playerid, -1, "Player isn't connected.");
if(level > 3) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) The admin levels are only between 0-3.");
if(level < 0) return SendClientMessage(playerid, -1, "{C3C3C3}(INFO) The admin levels are only between 0-3.");
if(pInfo[playerid][Admin] == level) return SendClientMessage(playerid, -1, "Player is already this admin level.");
format(str, sizeof(str), "{1E90FF}(Server):{dadada} You have set %s's staff level to %d.", GetPlayerName(TargetPlayer, name, sizeof(name));, level);
SendClientMessage(playerid, -1 str);
format(str, sizeof(str), "{1E90FF}(Server):{dadada} Admin %s has set you staff level to %d.", GetPlayerName(playerid, name, sizeof(name));, level);
SendClientMessage(TargetPlayer, -1, str);
pInfo[TargetPlayer][Admin] = level;
}
return 1;
}
Untested but try that.
You were looking for this, though.
PHP код:
if(pInfo[playerid][Admin] == level) return SendClientMessage(playerid, -1, "Player is already this admin level.");