12.01.2016, 11:26
Код:
CMD:setvip(playerid,params[]) { if(PlayerInfo[playerid][LoggedIn] == 1) { if(PlayerInfo[playerid][VIPLevel] >= 3 || IsPlayerAdmin(playerid)) { new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setvip [playerid] [Rank]"); new player1, level, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128]; player1 = strval(tmp); if(isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /setvip [playerid] [Rank]"); level = strval(tmp2); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { if(PlayerInfo[player1][LoggedIn] == 1) { if(level > ServerInfo[maxviplevel] ) return SendClientMessage(playerid,red,"ERROR: Incorrect Rank"); if(level == PlayerInfo[player1][VIPLevel]) return SendClientMessage(playerid,red,"ERROR: Player is already this Rank"); CMDMessageToAdmins(playerid,"SETVIP"); GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname)); new year,month,day; getdate(year, month, day); new hour,minute,second; gettime(hour,minute,second); if(level > 0) format(string,sizeof(string),"|- V.I.P leader %s has set you to V.I.P Member Rank Status | V.I.P Rank: %d - %s -|",adminname, level); else format(string,sizeof(string),"|- V.I.P leader %s has set you to V.I.P Member Rank Status | Rank: %d -|",adminname, level); SendClientMessage(player1,blue,string); if(level > PlayerInfo[player1][VIPLevel]) GameTextForPlayer(player1,"V.I.P Level Promoted", 2000, 3); else GameTextForPlayer(player1,"V.I.P Level Demoted", 2000, 3); format(string,sizeof(string),"You have made %s V.I.P Rank %d on %d/%d/%d at %d:%d:%d", playername, level, day, month, year, hour, minute, second); SendClientMessage(playerid,blue,string); format(string,sizeof(string),"V.I.P Leader leader %s has made %s Rank %d on %d/%d/%d at %d:%d:%d",adminname, playername, level, day, month, year, hour, minute, second); SaveToFile("AdminLog",string); dUserSetINT(PlayerName2(player1)).("V.I.Plevel",(level)); PlayerInfo[player1][VIPLevel] = level; return PlayerPlaySound(player1,1057,0.0,0.0,0.0); } else return SendClientMessage(playerid,red,"ERROR: Player must be registered and logged in to be VIP Member"); } else return SendClientMessage(playerid, red, "Player is not connected"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands"); }
But I Scripted Full Of Database Of V.I.P