18.10.2009, 15:40
Hi! Im using LAdmin, and I have editted it a bit, but I couldnt edit it as I wanted:
I did this so you were able to slap yourself... However, some admins are abusing and slapping admins that are higher than them. I dont want to demote, but how can i edit this so that you can only slap admins that are the same level as you?
Basically, i want it to check weather the player that is being slapped is a higher level than the admin... If yes, then the slap doesnt work...
pawn Код:
dcmd_slap(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 2) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason/with]");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
GetPlayerName(player1, playername, sizeof(playername));
GetPlayerName(playerid, adminname, sizeof(adminname));
CMDMessageToAdmins(playerid,"SLAP");
new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-40);
GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+10); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
if(strlen(tmp2)) {
format(string,sizeof(string),"You have been slapped by Administrator %s for %s",adminname,params[2]); SendClientMessage(player1,red,string);
format(string,sizeof(string),"You have slapped %s for %s ",playername,params[2]); return SendClientMessage(playerid,blue,string);
} else {
format(string,sizeof(string),"You have been slapped by Administrator %s ",adminname); SendClientMessage(player1,red,string);
format(string,sizeof(string),"You have slapped %s",playername); return SendClientMessage(playerid,blue,string); }
} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Basically, i want it to check weather the player that is being slapped is a higher level than the admin... If yes, then the slap doesnt work...