CMD:setwanted(playerid,params[])
{
new ID;
new Wantedl;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(sscanf(params, "ui", ID,Wantedl)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}Usage: /setwanted <playerid> <wantedlevel>");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"{FF0000}__**ERROR**__ {FFFFFF}That player is not connected to the server!");
SetPlayerWantedLevel(ID,Wantedl);
return 1;
}
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pWantedLevel,
pScore,
pBankCash,
pBankAccount,
pRobSkill
}
new PlayerInfo[MAX_PLAYERS][pInfo];
CMD:setwanted(playerid,params[])
{
new ID;
new Wantedl;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(sscanf(params, "ui", ID,Wantedl)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}Usage: /setwanted <playerid> <wantedlevel>");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"{FF0000}__**ERROR**__ {FFFFFF}That player is not connected to the server!");
SetPlayerWantedLevel(ID,Wantedl);
return 1;
}
CMD:setwanted(playerid,params[])
{
new ID, Wantedl;
if(PlayerInfo[playerid][pAdmin] >= 3 || IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
{
if(sscanf(params, "ui", ID, Wantedl)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}Usage: /setwanted <playerid> <wantedlevel>");
if(!IsPlayerConnected(ID) || ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1,"{FF0000}__**ERROR**__ {FFFFFF}That player is not connected to the server!");
SetPlayerWantedLevel(ID, Wantedl);
}
else
{
SendClientMessage(playerid, -1, "{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
}
return 1;
}
CMD:setwanted(playerid,params[])
{
new ID;
new Wantedl;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");// Admins below level 3 will not allow to use this command but level 3 and higher are able to use this command
if(sscanf(params, "ui", ID, Wantedl)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}Usage: /setwanted <playerid> <wantedlevel>");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"{FF0000}__**ERROR**__ {FFFFFF}That player is not connected to the server!");
SetPlayerWantedLevel(ID, Wantedl);
return 1;
}
pawn Code:
|
if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");
It is easier to create an external stock to check if a player is at a specific admin level, if yes then,
the stock will return 1, otherwise it will return 0, it is much easier then using the admin checking method, in each and each command. "IsPlayerAdmin" - Is used to check if the player is logged in into RCON or not! |