21.08.2014, 14:17
I made this stock function to check if a player is an admin, so I don't have to keep writing the whole check out every time I make a command:
Then when I make a command I do:
But when I use a command and I'm an admin, it sends the error message but then still continues doing what it's supposed to do. For example if I do /kick, it'll do:
in the chat.
pawn Код:
stock AdminCheck(playerid, levell)
{
if(!IsPlayerAdmin(playerid) || pData[playerid][Level] < levell) return SendClientMessage(playerid, ERROR, "Error: {FFFFFF}You do not have permission to use this command!");
return 1;
}
pawn Код:
CMD:setscore(playerid, params[])
{
new score;
AdminCheck(playerid, 3);
//rest of code
Код:
Error: You do not have permission to use this command! Usage: /kick [player name/ID] [reason]