new superadmin; stock IsPlayerSuperAdmin(playerid) { if(superadmin==1){ return 1; } return 0; }
CMD:login(playerid, params[]){ new password; if(sscanf(params, "i",password))return SendClientMessage(playerid, 0x33AA33AA, "USAGE: /login [PASSWORD]"); if(password != blablabla) return SendClientMessage(playerid, 0x33AA33AA, "Wrong Password."); superadmin=1; SendClientMessage(playerid, 0x33AA33AA, "You have logged in."); return 1; }
CMD:kill(playerid, params[]){ new TargetID; if(!IsPlayerSuperAdmin(playerid)) return SendClientMessage(playerid,-1,"You're not connected as a super Admin."); if(sscanf(params, "u", TargetID))return SendClientMessage(playerid, 0x33AA33AA, "USAGE: /kill [Target ID]"); if(!IsPlayerConnected(TargetID)) return SendClientMessage(playerid, 0x33AA33AA, "This player isn't connected."); SetPlayerHealth(TargetID, 0.0); SendClientMessage(playerid, 0x33AA33AA, "You have killed the player."); return 1; }
stock IsPlayerSuperAdmin(playerid)
{
if(superadmin[playerid]==1){
return 1;
}
return 0;
}
CMD:login(playerid, params[]){
new password;
if(sscanf(params, "i",password))return SendClientMessage(playerid, 0x33AA33AA, "USAGE: /login [PASSWORD]");
if(password != blablabla) return SendClientMessage(playerid, 0x33AA33AA, "Wrong Password.");
superadmin=1;
SendClientMessage(playerid, 0x33AA33AA, "You have logged in.");
return 1;
}
Alright mate, I've tried it out now and I've figured my problem, thank you so much for your quick response, it's much appreciated!
Have an awesome day. |
stock IsPlayerSuperAdmin(playerid)
{
if(superadmin[playerid]==1){
return 1;
}
return 0;
}
IsPlayerSuperAdmin(playerid)
return (superadmin[playerid]);
new bool:superadmin[MAX_PLAYERS];