27.09.2018, 10:01
So, here is the problem- I've tried making an "IsPlayerSuperAdmin" stock, but I have no idea how to do it.
I've made the following commands, but when one player is doing /login with the right password, it gives the whole server "IsPlayerSuperAdmin" permissions.
Here is the code:
Other commands I've made:
I've made the following commands, but when one player is doing /login with the right password, it gives the whole server "IsPlayerSuperAdmin" permissions.
Here is the code:
Код:
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; }