31.01.2012, 12:03
My Code:
Its gived me that I am already Higher but i am not ):
pawn Код:
dcmd_adsetvip(playerid,params[])
{
new string[128];
new ID;
new cmdreason;
if(sscanf(params,"ui",ID,cmdreason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adsetvip (Player Name/ID) (Level)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot set their V.I.P level.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(PLAYERLIST_authed[ID] != 1)
{
format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you set their V.I.P level.",PlayerName(ID),ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(VipLevel[ID] == cmdreason)
{
format(string,sizeof(string),"%s(%d) is already at the V.I.P level: %d",PlayerName(ID),ID,cmdreason);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
if(playerid == ID)
{
SendClientMessage(playerid,COLOR_ERROR,"You cannot set your own V.I.P level. You are already the highest level.");
return 1;
}
format(string,sizeof(string),"[V.I.P LEVEL CHANGE] Owner %s(%d) has given %s(%d) the V.I.P level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
SendClientMessageToAll(COLOR_ADMIN,string);
SendClientMessage(ID,COLOR_ADMIN,"Your V.I.P level has been changed by the Server Owner. To see your new commands type /vipcmds.");
VipLevel[ID] =cmdreason;
format(string,sizeof(string),"9[VIP LEVEL CHANGE] Owner %s(%d) has given %s(%d) the administrator level %d.",PlayerName(playerid),playerid,PlayerName(ID),ID,cmdreason);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}