25.08.2015, 01:14
the cmd is /makevip [id] [level] . level are 1 and 2 , i've made that if the commander set the level to a level less than 0 or more than 2 it sends a msg (Please write an acceptable level) however , in-game it sends me this message if the level is = 1,2,3 etc....... , but when i make the level = 0 it works
Код:
CMD:makevip(playerid,params[]) { if(!IsPlayerAnAdmin(playerid,5))return SendClientMessage(playerid,COL_RED,"<!>You are not authorized to use this command!"); new viplvl,string[128],pID,pmsg[128],adminmsg[128],string2[128]; if(sscanf(params,"uu",pID,viplvl))return SendClientMessage(playerid,COL_GREEN,"/makevip [id] [level]"); if(viplvl<0||viplvl>2)return SendClientMessage(playerid,COL_GREEN,"Please write an acceptable level"); format(adminmsg,sizeof(adminmsg),"You've promoted %s to VIP level %i",PlayerName(pID),viplvl); format(pmsg,sizeof(pmsg),"You've been promoted to VIP level %i by Adminstrator %s",viplvl,PlayerName(playerid)); SetPVarInt(pID,"VIP",viplvl); PlayerInfo[pID][pVIP] = viplvl; if(viplvl != 0) { SetPVarInt(pID,"Admin",1); PlayerInfo[pID][pAdmin] = 1; } for(new i=0;i<GetMaxPlayers();i++) { if(IsPlayerConnected(i)) { if(IsPlayerAnAdmin(i,1)) { format(string,sizeof(string),"A: %s [LEVEL %i] used the MAKEVIP command.",PlayerName(playerid),GetPVarInt(playerid,"Admin")); format(string2,sizeof(string2),"A: %s has been promoted to VIP level %i by Adminstrator %s",PlayerName(pID),viplvl,PlayerName(playerid)); SendClientMessage(i,COL_LIGHTBLUE,string); SendClientMessage(i,COL_LIGHTBLUE,string2); } } } SendClientMessage(playerid,COL_LIGHTBLUE,adminmsg); SendClientMessage(playerid,COL_LIGHTBLUE,pmsg); return 1; }