26.11.2013, 16:47
Change the variables etc to what your databse uses (mine is SQLite)
pawn Код:
CMD:setadmin(playerid,params[])
{
if(User[playerid][USER_ADMIN] >= 7 || IsPlayerAdmin(playerid))
{
new targetid,level,string[180];
if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid,-1,"/setadmin [playerid] [level]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,"Player is not online");
if(level < 0 || level > 7) return SendClientMessage(playerid,-1,"Admin levels are only between 1-7");
User[targetid][USER_ADMIN] = level;
}
else
{
SendClientMessage(playerid,-1,""COL_RED" You do not have the right admin permissions for this command!");
}
return 1;
}