19.08.2011, 16:59
Hey all , i would like to have an Include (very short+simple to use) (i would creat VIP system+admins system + some commands with It) Please HELP
enum pData
{
AdminLevel
}
new Logged[MAX_PLAYERS];
new PlayerData[MAX_PLAYERS][pData];
CMD:setadmin(playerid, params[])
{
new str[128],ID,alevel,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid))return 0;
if(sscanf(params,"ui",ID,alevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setadmin [ID] [Level 1-5]");
if(alevel > 5) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE LEVELS 1-5!");
if(!IsPlayerConnected(ID))return SendClientMessage(playerid,red,"That user is not connected.");
if(PlayerData[ID][AdminLevel] == alevel) return SendClientMessage(playerid,0xFF0000FF, "ERROR: That person is already this admin level!");
GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);
GetPlayerName(ID,pname,MAX_PLAYER_NAME);
if(alevel == 0)
{
format(str, sizeof(str),"%s has your Admin level to %d on the server. *cry *cry",Nam,alevel);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerData[ID][AdminLevel] = alevel;
return 1;
}
format(str, sizeof(str),"%s has your Admin level to %d on the server.",Nam,alevel);
SendClientMessage(ID,0xFF9900AA,str);
format(str, sizeof(str),"You had set %s Admin level to %d!",pname,alevel);
SendClientMessage(playerid,0xFF9900AA,str);
PlayerData[ID][AdminLevel] = alevel;
return 1;
}