26.03.2011, 21:30
Hy there ! How can I make commands that just admins can use it ?
CMD:unmute(playerid, params[])
{
new id;
new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME];
if(GetPVarInt(playerid, "Level") >= 1)
{
if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "USAGE: /unmute [id]");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "This player is not connected");
if(GetPVarInt(playerid, "Level") >= 2) return SendClientMessage(playerid, COLOR_RED, SERVER_BOT "Cannot unmute this person!");
IsMuted[id] = 0;
new stri[128];
GetPlayerName(id, victimname, sizeof(victimname));
GetPlayerName(playerid, adminname, sizeof(adminname));
format(stri,128,SERVER_BOT "%s(%d) has unmuted %s(%d)",adminname, playerid, victimname, id);
SendClientMessageToAll(COLOR_GREEN,stri);
return 1;
}else return SendClientMessage(playerid,COLOR_RED,SERVER_BOT "You arent Authorised!");}
yay a nice person!, Well bud, You need a admn system, or a Account system. If you have a account system ad a variable called level or adminlevel or whatever, and Do somthing like thsis.
heres a admin command of mine you can kinda get an idea from PHP код:
|