//////////////////////////////////// //````````````````````````````````// //DevilAdmin System Filterscript // //by Devilxz97 // //````````````````````````````````// //////////////////////////////////// /*********************************< INCLUDES >*********************************/ #include <a_samp> #include <zcmd> #include <sscanf2> #include <foreach> #include <YSI\y_ini> /******************************************************************************/ /**********************************< PRAGMA >**********************************/ #pragma tabsize 0 /******************************************************************************/ /***********************************< PATH >***********************************/ #define PATH "/DevilAdminSystem/Account/%s.ini" /******************************************************************************/ /**********************************< DEFINE >**********************************/ #define DIALOG_REGISTER 1 #define DIALOG_LOGIN 2 #define DIALOG_SUCCESS_2 3 #define ANNOUNCES_TIME 6000 /******************************************************************************/ /********************************< HEX COLORS >********************************/ #define COL_GREY "{B4B5B7}" #define COL_CYAN "{00FFFF}" #define COL_LGREEN "{9ACD32}" #define COL_LRED "{FF6347}" #define COL_LBLUE "{0033FF}" /******************************************************************************/ /********************************< COL DEFINE >********************************/ #define grey 0xB4B5B7FF #define cyan 0x00FFFFFF #define lightgreen 0x9ACD32AA #define lightred 0xFF6347AA #define lightblue 0x0033FFAA /******************************************************************************/ /*********************************< FORWARDS >*********************************/ forward LoadUser_data(playerid,name[],value[]); forward AdminPrivateChat(color,const string[]); forward VIPPrivateChat(color,const string[]); forward SaveLogs(filename[],text[]); forward Acmdlvl1(playerid); forward Acmdlvl2(playerid); forward Acmdlvl3(playerid); forward Acmdlvl4(playerid); forward Acmdlvl5(playerid); /******************************************************************************/ /********************************< PLAYERINFO >********************************/ enum pInfo { pPass, pAdmin, pVIP, pWanted, pKills, pDeaths, pJailed, pMuted, pCash, pScore, pBanned } new PlayerInfo[MAX_PLAYERS][pInfo]; /******************************************************************************/ /*********************************< VARIABLE >*********************************/ new Float:SpecX[MAX_PLAYERS]; new Float:SpecY[MAX_PLAYERS]; new Float:SpecZ[MAX_PLAYERS]; new vWorld[MAX_PLAYERS]; new Inter[MAX_PLAYERS]; new IsSpecing[MAX_PLAYERS]; new IsBeingSpeced[MAX_PLAYERS]; new spectatorid[MAX_PLAYERS]; new IsOnDuty[MAX_PLAYERS]; new IsGodMode[MAX_PLAYERS]; /******************************************************************************/ /**********************************< OTHERS >**********************************/ new Count; /******************************************************************************/ /***************************< DEFINE FILTERSCRIPTS >***************************/ #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Devil-Admin System by Devilxz97"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { print("\n--------------------------------------"); print(" Devil-Admin System by Devilxz97 Unloaded"); print("--------------------------------------\n"); for(new i = 0; i < MAX_PLAYERS; i++) { TextDrawHideForPlayer(i, Announcements); } return 1; } #endif /******************************************************************************/ /*********************************< COMMANDS >*********************************/ CMD:commands(playerid, params[]) { SendClientMessage(playerid, lightgreen, "----------------------------------"); SendClientMessage(playerid, lightgreen, "* {B4B5B7}/admins /vips /report /stats"); SendClientMessage(playerid, lightgreen, "----------------------------------"); return 1; } CMD:vcmd(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { SendClientMessage(playerid, grey, "/vsay /vskin /varmour /vheal /vgod"); } return 1; } CMD:acmd(playerid, params[]) { new level; if(PlayerInfo[playerid][pAdmin] >= 1) { if(sscanf(params, "i", level)) return SendClientMessage(playerid, grey, "Usage:/acmd (1-5)"); if(level < 1 || level > 5) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}1 till 5!"); { if(level == 1) { if(PlayerInfo[playerid][pAdmin] >= 1) { Acmdlvl1(playerid); } } else if(level == 2) { if(PlayerInfo[playerid][pAdmin] >= 2) { Acmdlvl2(playerid); } } else if(level == 3) { if(PlayerInfo[playerid][pAdmin] >= 3) { Acmdlvl3(playerid); } } else if(level == 4) { if(PlayerInfo[playerid][pAdmin] >= 4) { Acmdlvl4(playerid); } } else if(level == 5) { if(PlayerInfo[playerid][pAdmin] >= 5) { Acmdlvl5(playerid); } } } } return 1; } /*****************************< PLAYERS COMMANDS >*****************************/ CMD:admins(playerid, params[]) { new string[128]; new count; foreach(Player, i) { if(PlayerInfo[i][pAdmin] > 0) { SendClientMessage(playerid, lightgreen, "--------------[ {B4B5B7}0NLINE ADMINS{9ACD32} ]--------------"); new adminname[MAX_PLAYER_NAME]; GetPlayerName(i, adminname, MAX_PLAYER_NAME); format(string, sizeof(string), "[Admin]'%s - level %d", adminname, PlayerInfo[i][pAdmin]); SendClientMessage(playerid, grey, string); count++; } } if(!count) { return SendClientMessage(playerid, lightred, "[System]: No Admin Online!"); } else { return SendClientMessage(playerid, lightgreen, "--------------------------------------------"); } } CMD:vips(playerid, params[]) { new string[128]; new count; foreach(Player, i) { if(PlayerInfo[i][pVIP] > 0) { SendClientMessage(playerid, lightgreen, "--------------[ {B4B5B7}0NLINE VIP{9ACD32} ]--------------"); new VIP[MAX_PLAYER_NAME]; GetPlayerName(i, VIP, MAX_PLAYER_NAME); format(string, sizeof(string), "[VIP]'%s - level %d", VIP, PlayerInfo[i][pVIP]); SendClientMessage(playerid, grey, string); count++; } } if(!count) { return SendClientMessage(playerid, lightred, "[System]: No VIP Online!"); } else { return SendClientMessage(playerid, lightgreen, "------------------------------------------"); } } CMD:report(playerid, params[]) { new id, reason[60]; new string[256], Reporter[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "us[60]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/report (playerid/partofname) (reason)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); GetPlayerName(playerid, Reporter, sizeof(Reporter)); GetPlayerName(id, Target, sizeof(Target)); format(string, sizeof(string),"Player'%s reported Player'%s. Reason:%s.",Reporter,Target,reason); ReportMessage(string); SendClientMessage(playerid, grey, "You have sent your report's to an Online Admin!"); return 1; } CMD:stats(playerid, params[]) { new str[1000]; #define DIALOG_STATS 1997 format(str, sizeof(str), "Admin: %d\nVIP: %d\nWantedLevel: %d\nKills: %d\nDeaths: %d\nJailed: %d\nMuted: %d\nCash: %d\nScore: %d\nBanned: %d", PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pVIP],PlayerInfo[playerid][pWanted],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pMuted],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pBanned]); ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX , "STATS", str, "CLOSE", ""); return 1; } /******************************************************************************/ /********************************< LEVEL 1 >***********************************/ CMD:asay(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new str[256]; new AdminName[MAX_PLAYERS]; if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, grey, "Usage:/asay (text)"); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "{B4B5B7}* [{FF6347}ADMIN{B4B5B7}]'%s: %s *", AdminName, params); SendClientMessageToAll(grey, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:announce(playerid,params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new text[60]; if(sscanf(params,"s[60]",text)) return SendClientMessage(playerid, grey, "Usage:/announce [text]"); GameTextForAll(text,3000,3); } return 1; } CMD:warn(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new id; new str[256]; new AdminName[MAX_PLAYER_NAME]; new Warned[MAX_PLAYER_NAME]; new reason[128]; if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/warn (playerid/partofname) (reason)"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Warned, sizeof(Warned)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'( %s ) has warned {FF6347}[{B4B5B7}{FF6347}]{B4B5B7}' ( %s ). {FF6347}Reason; {B4B5B7}%s :.", AdminName, Warned, reason); SendClientMessageToAll(lightred, str); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:mute(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new id; new reason[128]; new str[256]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/mute (playerid/partofname) (reason)"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has muted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s. {FF6347}Reason; {B4B5B7}%s .", AdminName, Target, reason); SendClientMessageToAll(lightred, str); PlayerInfo[id][pMuted] = 1; } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:unmute(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new id; new str[128]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/unmute (playerid/partofname)"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has unmuted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s .", AdminName, Target); SendClientMessageToAll(lightred, str); PlayerInfo[id][pMuted] = 0; } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:duty(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { if(IsOnDuty[playerid] == 0) { new str[256]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}( %s ) is now On duty!", AdminName); SendClientMessageToAll(lightred, str); IsOnDuty[playerid] = 1; } else if(IsOnDuty[playerid] == 1) { new str[256]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}( %s ) is now Off duty!", AdminName); SendClientMessageToAll(lightred, str); IsOnDuty[playerid] = 0; } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:goto(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new id; new str[128]; new Float:X; new Float:Y; new Float:Z; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage: /goto (playerid/partofname)"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); GetPlayerPos(id, X, Y, Z); SetPlayerPos(playerid, X, Y, Z); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'( %s ) has been teleported to {FF6347}[{B4B5B7}{FF6347}]{B4B5B7}'( %s ) :.", AdminName, Target); SendClientMessageToAll(lightred, str); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:cleardeathwindow(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { for (new i; i != 5; ++i) { SendDeathMessage(6000, 5005, 255); } SendClientMessageToAll(lightred, "[{B4B5B7}Admin{FF6347}]{B4B5B7} has cleared the Killfeed!"); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You have to have the [Admin] status to use this command."); return 1; } CMD:spec(playerid, params[]) { new id; new Target[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] >= 1) { if(sscanf(params,"u", id)) return SendClientMessage(playerid, grey, "Usage:/spec (playerid/partofname)"); if(id == playerid) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You cant spec yourself!"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); if(IsSpecing[playerid] == 1) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You are already specing someone!"); GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]); Inter[playerid] = GetPlayerInterior(playerid); vWorld[playerid] = GetPlayerVirtualWorld(playerid); TogglePlayerSpectating(playerid, 1); if(IsPlayerInAnyVehicle(id)) { if(GetPlayerInterior(id) > 0) { SetPlayerInterior(playerid,GetPlayerInterior(id)); } if(GetPlayerVirtualWorld(id) > 0) { SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); } PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id)); } else { if(GetPlayerInterior(id) > 0) { SetPlayerInterior(playerid,GetPlayerInterior(id)); } if(GetPlayerVirtualWorld(id) > 0) { SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id)); } PlayerSpectatePlayer(playerid,id); } new str[128]; GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str),"You are now spectating Player'%s.",Target); SendClientMessage(playerid,grey ,str); IsSpecing[playerid] = 1; IsBeingSpeced[id] = 1; spectatorid[playerid] = id; } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:specoff(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { if(IsSpecing[playerid] == 0) return SendClientMessage(playerid,lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You are not spectating anyone!"); TogglePlayerSpectating(playerid, 0); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } /********************************< LEVEL 2 >***********************************/ CMD:kick(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new str[256]; new reason[24]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "us[24]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/kick (playerid/partofname) (reason)"); else { GetPlayerName(id, Target, sizeof(Target)); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'( %s ) has kicked {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ). {FF6347}Reason; {B4B5B7}%s :.", AdminName, Target, reason); SendClientMessageToAll(lightred, str); Kick(id); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:getplayer(playerid, params[]) { new id; new str[1000]; new Float:x; new Float:y; new Float:z; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] >= 2) { if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/getplayer (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); GetPlayerPos(playerid, x, y, z); SetPlayerPos(id, x + 2, y, z); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'( %s ) has teleported {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) :.", AdminName, Target); SendClientMessageToAll(lightred, str); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:freeze(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/freeze (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(id, Target, sizeof(Target)); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}[Admin]{FF6347}]{B4B5B7}'( %s ) has freezed {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) :.", AdminName, Target); SendClientMessageToAll(lightred, str); TogglePlayerControllable(id,1); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:unfreeze(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/unfreeze (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(id, Target, sizeof(Target)); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'( %s ) has unfreezed {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) :.", AdminName, Target); SendClientMessageToAll(lightred, str); TogglePlayerControllable(id,0); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:settime(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new time; new str[256]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "ui", id, time)) return SendClientMessage(playerid, grey, "Usage:/settime (playerid/partofname) (time)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); if(time < 0 || time > 23) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}0 till 23 !"); { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7} admin{FF6347}]{B4B5B7}'( %s ) has set {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) time to %02d:00 :.", AdminName, Target, time); SendClientMessageToAll(lightred, str); SetPlayerTime(id, time, 0); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:setweather(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new weather; new str[256]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "ud", id, weather)) return SendClientMessage(playerid, grey, "Usage:/setweather (playerid/partofname) (weather)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has set {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s weather to %s .", AdminName, Target, weather); SendClientMessageToAll(lightred, str); SetPlayerWeather(id, weather); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:sethealth(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new str[128]; new Float:health; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "uf", id, health)) return SendClientMessage(playerid, grey, "Usage:/sethealth (playerid/partofname) (float:health)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has restored {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) health :.", AdminName, Target); SendClientMessageToAll(lightred, str); SetPlayerHealth(id, health); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:setarmour(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new Float:armour; if(sscanf(params, "uf", id, armour)) return SendClientMessage(playerid, grey, "Usage:/setarmour (playerid/partofname) (float:armour)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[128]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has restore {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s armour .", AdminName, Target); SendClientMessageToAll(lightred, str); SetPlayerArmour(id, armour); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:slap(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new id; new Float:pHealth; new Float:x; new Float:y; new Float:z; new str[128]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/slap (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has slapped {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) :.", AdminName, Target); SendClientMessageToAll(lightred, str); GetPlayerHealth(id,pHealth); SetPlayerHealth(id,pHealth-25); GetPlayerPos(id,x,y,z); SetPlayerPos(id,x,y,z+10); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:clearchat(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new str[256]; new AdminName[MAX_PLAYER_NAME]; for(new i = 0; i < 100; i++) SendClientMessageToAll(0xB4B5B7FF," "); GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has cleared the chat :.", AdminName); SendClientMessageToAll(lightred, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:god(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { if(IsGodMode[playerid] == 0) { IsGodMode[playerid] = 1; SetPlayerHealth(playerid,999999999); } else if(IsGodMode[playerid] == 1) { IsGodMode[playerid] = 0; SetPlayerHealth(playerid,100); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } /********************************< LEVEL 3 >***********************************/ CMD:explode(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/explode (playerid/partofname)"); if(PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant cheack an Administrator weapon!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant checkweapon yourself!"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has explode {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s .", AdminName, Target); SendClientMessageToAll(lightred, str); new Float:burnx, Float:burny, Float:burnz; GetPlayerPos(id,burnx, burny, burnz); CreateExplosion(burnx, burny , burnz, 7,10.0); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:noweaps(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/noweaps (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has taken {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) weapons :.", AdminName, Target); SendClientMessageToAll(lightred, str); ResetPlayerWeapons(id); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:healall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerHealth(i,100.0); } new str[128]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has healed everyone :.", AdminName); SendClientMessageToAll(lightred, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:armourall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { for(new i = 0; i < MAX_PLAYERS; i++) { SetPlayerArmour(i,100.0); } new str[128]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}' ( %s ) has armoured everyone :.", AdminName); SendClientMessageToAll(lightred, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:ban(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; new reason[128]; if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, grey, "Usage:/ban (playerid/partofname) (reason)"); if(PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant ban an Administrator!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant ban yourself!"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new year; new month; new day; new hour; new minuite; new second; new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; getdate(year, month, day); gettime(hour,minuite,second); GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) HAS BANNED {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s )! {FF6347}Reason; {B4B5B7}%s :.", AdminName, Target, reason); SendClientMessageToAll(lightred, str); #define DIALOG_BAN 9706 format(str, sizeof(str), "{FF6347}Admin Name: {B4B5B7}%s .\n{FF6347}Date: {B4B5B7}%d{FF6347}/{B4B5B7}%d{FF6347}/{B4B5B7}%d .\n{FF6347}Time: {B4B5B7}%d{FF6347}:{B4B5B7}%d .\n{FF6347}Reason: {B4B5B7}%s .", AdminName, day, month, year, hour, minuite, reason); ShowPlayerDialog(id, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "Ban Notice", str, "OK", ""); Ban(id); PlayerInfo[id][pBanned] = 1; } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:givejetpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/givejetpack (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has give {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s jetpacks .", AdminName, Target); SendClientMessageToAll(lightred, str); SetPlayerSpecialAction(id, SPECIAL_ACTION_USEJETPACK); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:vslap(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new targetid; new Float:x; new Float:y; new height; new Float:z; new str[256]; if(sscanf(params, "ui",targetid, height)) return SendClientMessage(playerid, grey, "Usage:/vslap (playerid/partofname) (height)"); if(targetid == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}Player is not in any vehicle!"); new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(targetid, Target, sizeof(Target)); new vehicleid=GetPlayerVehicleID(targetid); GetVehiclePos(vehicleid, x, y, z); SetVehiclePos(vehicleid, x, y, z+ height); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has slap {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s Vehicle .", AdminName, Target); SendClientMessageToAll(lightred, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:checkweaps(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/checkweaps (playerid/partofname)"); if(PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant cheack an Administrator weapon!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant checkweapon yourself!"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new x; new string[128]; new WeapName[24], slot, weap, ammo; for(slot = 0; slot < 14; slot++) { GetPlayerWeaponData(id, slot, weap, ammo); if( ammo != 0 && weap != 0) Count++; } if(Count < 1) return SendClientMessage(playerid,lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}No Weapons found!"); if(Count >= 1) { for (slot = 0; slot < 14; slot++) { GetPlayerWeaponData(id, slot, weap, ammo); if( ammo != 0 && weap != 0) { GetWeaponName(weap, WeapName, sizeof(WeapName)); if(ammo == 65535 || ammo == 1) format(string,sizeof(string),"%s%s (1)",string, WeapName); else format(string,sizeof(string),"%s%s (%d)",string, WeapName, ammo); x++; if(x >= 5) { SendClientMessage(playerid, grey, string); x = 0; format(string, sizeof(string), ""); } else format(string, sizeof(string), "%s, ", string); } } if(x <= 4 && x > 0) { string[strlen(string)-3] = '.'; SendClientMessage(playerid, grey, string); } } } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } /********************************< LEVEL 4 >***********************************/ CMD:rban(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 4) { new id; new Reason[100]; if(sscanf(params, "us[100]", id,Reason)) return SendClientMessage(playerid, grey, "Usage:/rban (playerid/partofname) (reason)"); { if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant ban yourself!"); new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid,AdminName,sizeof(AdminName)); GetPlayerName(id,Target,sizeof(Target)); new str[1000]; new rbandate[3]; getdate(rbandate[0], rbandate[1], rbandate[2]); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has range banned {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ). {FF6347}Reason; {B4B5B7}%s :.", AdminName, Target, Reason); SendClientMessageToAll(lightred, str); new year; new month; new day; getdate(year, month, day); #define DIALOG_RBAN 8347 format(str, sizeof(str), "{FF6347}Admin Name: {B4B5B7}%s .\n{FF6347}Date: {B4B5B7}%d{FF6347}/{B4B5B7}%d{FF6347}/{B4B5B7}%d .\n{FF6347}Reason: {B4B5B7}%s .", AdminName, day, month, year, Reason); ShowPlayerDialog(id, DIALOG_RBAN, DIALOG_STYLE_MSGBOX, "Range Ban Notice", str, "OK", ""); PlayerInfo[id][pBanned] = 1; new ip[128]; GetPlayerIp(id,ip,sizeof(ip)); format(ip,128,"banip %s",ip); strdel(ip,strlen(ip)-2,strlen(ip)); SendRconCommand(ip); return BanEx(id, str); } } return 1; } CMD:getip(playerid, params[]) { new id; if(PlayerInfo[playerid][pAdmin] >= 3) { if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/getip (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[256]; new TargetIP[50]; new Target[MAX_PLAYER_NAME]; GetPlayerName(id, Target, sizeof(Target)); GetPlayerIp(id,TargetIP,50); format(str,sizeof(str),"Name: {B4B5B7}%s .\n{FF6347}Ip: {B4B5B7}%s .", Target, TargetIP); return SendClientMessage(playerid, lightred, str); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:respawn(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 3) { new id; if(sscanf(params, "u", id)) return SendClientMessage(playerid, grey, "Usage:/respawn (playerid/partofname)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}[Admin]{FF6347}]{B4B5B7}'( %s ) have respawned {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) .", AdminName, Target); SendClientMessageToAll(lightred, str); SetPlayerPos(id, 0.0, 0.0, 0.0); SpawnPlayer(id); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:setwanted(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 4) { new id; new wanted; if(sscanf(params, "ud", id, wanted)) return SendClientMessage(playerid, grey, "Usage:/setwanted (playerid/partofname) (wanted level)"); if(PlayerInfo[playerid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant setwanted an Administrator!"); if(id == playerid) return SendClientMessage(playerid, lightred,"[{B4B5B7}System{FF6347}]: {B4B5B7}You cant setwanted yourself!"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); if(wanted > 6) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Wanted level (0-6)"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has set {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s wanted level to '%d' .", AdminName, Target, wanted); SendClientMessageToAll(lightred, str); SetPlayerWantedLevel(id, wanted); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:setworld(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 4) { new id; new world; if(sscanf(params, "ud", id, world)) return SendClientMessage(playerid, grey, "Usage:/setwanted (playerid/partofname) (virtual world)"); if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has set {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'%s virtual world to '%d' .", AdminName, Target, world); SendClientMessageToAll(lightred, str); SetPlayerVirtualWorld(id, world); } } return 1; } /********************************< LEVEL 5 >***********************************/ CMD:setadmin(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { new level, id, str[1000]; if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, grey, "Usage:/setadmin (playerid/partofname) (1-4)"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); else { PlayerInfo[id][pAdmin] = level; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has promoted {FF6347}[{B4B5B7}player{FF6347}]{B4B5B7}'( %s ) to [Admin] status with level [%d] :.", AdminName, Target, level); SendClientMessageToAll(lightred, str); } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:setvip(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { new id; if(sscanf(params, "ud", id)) return SendClientMessage(playerid, grey, "Usage:/setvip (playerid/partofname)"); if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}Player not found!"); PlayerInfo[id][pVIP] = 1; new str[1000]; new AdminName[MAX_PLAYER_NAME]; new Target[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); GetPlayerName(id, Target, sizeof(Target)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}( %s ) has promoted {FF6347}[{B4B5B7}Player{FF6347}]{B4B5B7}'( %s ) to V.I.P .", AdminName, Target); SendClientMessageToAll(lightred, str); } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:giveallcash(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { new amount; if(sscanf(params, "d", amount)) return SendClientMessage(playerid, grey, "Usage:/giveallcash (Amount)"); { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new str[128]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}Admin{FF6347}]{B4B5B7}'%s has given $%d to all players .", AdminName, amount); SendClientMessageToAll(lightred, str); GivePlayerMoney(i,amount); } } } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:kickall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new str[128]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has kicked all players in the server! REASON: RESTART! :.", AdminName); SendClientMessageToAll(lightred, str); Kick(i); } } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } CMD:banall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 5) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new str[1000]; new AdminName[MAX_PLAYER_NAME]; GetPlayerName(playerid, AdminName, sizeof(AdminName)); format(str, sizeof(str), "[{B4B5B7}admin{FF6347}]{B4B5B7}'( %s ) has banned all players in the server :.", AdminName); SendClientMessageToAll(lightred, str); new year; new month; new day; new hour; new minuite; new second; getdate(year, month, day); gettime(hour,minuite,second); #define DIALOG_BAN 9706 format(str, sizeof(str), "{FF6347}Admin Name: {B4B5B7}%s .\n{FF6347}Date: {B4B5B7}%d{FF6347}/{B4B5B7}%d{FF6347}/{B4B5B7}%d .\n{FF6347}Time: {B4B5B7}%d{FF6347}:{B4B5B7}%d .\n{FF6347}Reason: {B4B5B7}%s .", AdminName, day, month, year, hour, minuite); ShowPlayerDialog(i, DIALOG_BAN, DIALOG_STYLE_MSGBOX, "Ban Notice", str, "OK", ""); PlayerInfo[i][pBanned] = 1; Ban(i); } } } else return SendClientMessage(playerid, lightred, "[{B4B5B7}System{FF6347}]: {B4B5B7}You aren't authorized to use this command."); return 1; } /******************************************************************************/ /**********************************< VIP >*************************************/ CMD:vsay(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { new str[256]; new VIP[MAX_PLAYER_NAME]; if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, grey, "Usage: /vsay (text)"); GetPlayerName(playerid, VIP, sizeof(VIP)); format(str, sizeof(str), "{B4B5B7}* [{0033FF}VIP{B4B5B7}]'%s: %s *", VIP, params); SendClientMessageToAll(grey, str); } else return SendClientMessage(playerid, lightred, "You are not a VIP!"); return 1; } CMD:vskin(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { new skin; if(sscanf(params,"i",skin)) return SendClientMessage(playerid,grey,"Usage: /myskins (skinid)"); if(!IsValidSkin(skin)) return SendClientMessage(playerid,lightred,"[System]: Invalid skinID"); SetPlayerSkin(playerid,skin); } else return SendClientMessage(playerid, lightred, "You are not a VIP!"); return 1; } CMD:varmour(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { SetPlayerArmour(playerid, 100); SendClientMessage(playerid,grey,"Your armour has been set to 100%! ."); } else return SendClientMessage(playerid, lightred, "You are not a VIP!"); return 1; } CMD:vheal(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { SetPlayerHealth(playerid, 100); SendClientMessage(playerid,grey,"Your armour has been set to 100%! ."); } else return SendClientMessage(playerid, lightred, "You are not a VIP!"); return 1; } CMD:vgod(playerid, params[]) { if(PlayerInfo[playerid][pVIP] >= 1) { if(IsGodMode[playerid] == 0) { new str[256]; new VIP[MAX_PLAYER_NAME]; GetPlayerName(playerid, VIP, sizeof(VIP)); format(str, sizeof(str), "[{B4B5B7}Vip{FF6347}]{B4B5B7}'%s uses godmode! .", VIP); SendClientMessageToAll(lightred, str); IsGodMode[playerid] = 1; SetPlayerHealth(playerid,100000); } else if(IsGodMode[playerid] == 1) { new str[256]; new VIP[MAX_PLAYER_NAME]; GetPlayerName(playerid, VIP, sizeof(VIP)); format(str, sizeof(str), "[{B4B5B7}Vip{FF6347}]{B4B5B7}'%s has disabled the godmode! .", VIP); SendClientMessageToAll(lightred, str); IsGodMode[playerid] = 0; SetPlayerHealth(playerid,100); } } else return SendClientMessage(playerid, lightred, "You are not a VIP!"); return 1; } /******************************************************************************/ /********************************< CALLBACK >**********************************/ public AdminPrivateChat(color,const string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(PlayerInfo[i][pAdmin] >= 1) { SendClientMessage(i, color, string); } } } return 1; } public VIPPrivateChat(color,const string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(PlayerInfo[i][pVIP] >= 1) { SendClientMessage(i, color, string); } } } return 1; } public SaveLogs(filename[],text[]) { new File:Lfile; new filepath[256]; new string[256]; new year,month,day; new hour,minute,second; getdate(year,month,day); gettime(hour,minute,second); format(filepath,sizeof(filepath),"DevilAdminSystem/Logs/%s.txt",filename); Lfile = fopen(filepath,io_append); format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text); fwrite(Lfile,string); fclose(Lfile); return 1; } public LoadUser_data(playerid,name[],value[]) { INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("VIP",PlayerInfo[playerid][pVIP]); INI_Int("Wanted",PlayerInfo[playerid][pWanted]); INI_Int("Kills",PlayerInfo[playerid][pKills]); INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); INI_Int("Jailed",PlayerInfo[playerid][pJailed]); INI_Int("Muted",PlayerInfo[playerid][pMuted]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Score",PlayerInfo[playerid][pScore]); INI_Int("Banned",PlayerInfo[playerid][pBanned]); return 1; } public Acmdlvl1(playerid) { SendClientMessage(playerid, lightred,"#Administrator Level 1 Commands"); SendClientMessage(playerid, grey, "/asay /announce /warn /mute /unmute"); SendClientMessage(playerid, grey, "/duty /goto /jetpack /cleardeathwindow"); SendClientMessage(playerid, grey, "/spec /specoff"); return 1; } public Acmdlvl2(playerid) { SendClientMessage(playerid, lightred,"#Administrator Level 2 Commands"); SendClientMessage(playerid, grey, "/kick /getplayer /freeze /unfreeze"); SendClientMessage(playerid, grey, "/settime /setweather /sethealth /setarmour"); SendClientMessage(playerid, grey, "/slap /clearchat /god"); return 1; } public Acmdlvl3(playerid) { SendClientMessage(playerid, lightred,"#Administrator Level 3 Commands"); SendClientMessage(playerid, grey, "/explode /noweaps /healall /armourall"); SendClientMessage(playerid, grey, "/ban /givejetpack /vslap /checkweaps"); return 1; } public Acmdlvl4(playerid) { SendClientMessage(playerid, lightred,"#Administrator Level 4 Commands"); SendClientMessage(playerid, grey, "/rban /getip /respawn /setwanted /setworld"); return 1; } public Acmdlvl5(playerid) { SendClientMessage(playerid, lightred,"#Administrator Level 5 Commands"); SendClientMessage(playerid, grey, "/setadmin /setvip /giveallcash /kickall /banall"); return 1; } public OnPlayerConnect(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_LBLUE"Login",""COL_GREY"Type your password below to login.","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_LRED"Registering...",""COL_GREY"Type your password below to register this account","Register","Quit"); } IsOnDuty[playerid] = 0; IsGodMode[playerid] = 0; return 1; } public OnPlayerDisconnect(playerid, reason) { if(IsBeingSpeced[playerid] == 1) { foreach(Player,i) { if(spectatorid[i] == playerid) { TogglePlayerSpectating(i, 0); } } } new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]); INI_WriteInt(File,"VIP",PlayerInfo[playerid][pVIP]); INI_WriteInt(File,"Wanted",GetPlayerWantedLevel(playerid)); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"Jailed",PlayerInfo[playerid][pJailed]); INI_WriteInt(File,"Muted",PlayerInfo[playerid][pMuted]); INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)); INI_WriteInt(File,"Score",GetPlayerScore(playerid)); INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]); INI_Close(File); IsOnDuty[playerid] = 0; IsGodMode[playerid] = 0; //from here PlayerInfo[playerid][pAdmin] = 0; PlayerInfo[playerid][pVIP] = 0; //etc. return 1; } public OnPlayerSpawn(playerid) { if(IsSpecing[playerid] == 1) { SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]); SetPlayerInterior(playerid,Inter[playerid]); SetPlayerVirtualWorld(playerid,vWorld[playerid]); IsSpecing[playerid] = 0; IsBeingSpeced[spectatorid[playerid]] = 0; } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if(IsBeingSpeced[playerid] == 1) { foreach(Player,i) { if(spectatorid[i] == playerid) { TogglePlayerSpectating(i, 0); } } } IsOnDuty[playerid] = 0; PlayerInfo[killerid][pKills]++; PlayerInfo[playerid][pDeaths]++; PlayerInfo[killerid][pWanted]++; SetPlayerWantedLevel(killerid,PlayerInfo[playerid][pWanted]); SendDeathMessage(killerid, reason, playerid); return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { if(text[0] == '!' && PlayerInfo[playerid][pAdmin] >= 1) { new str[256]; GetPlayerName(playerid,str,sizeof(str)); format(str,sizeof(str),"Admin Chat: {B4B5B7}%s: %s",str,text[1]); AdminPrivateChat(lightred,str); SaveLogs("AdminChat",str); return 0; } if(text[0] == '@' && PlayerInfo[playerid][pVIP] >= 1) { new str[256]; GetPlayerName(playerid,str,sizeof(str)); format(str,sizeof(str),"VIP Chat: {B4B5B7}%s: %s",str,text[1]); VIPPrivateChat(lightred,str); SaveLogs("VIPChat",str); return 0; } if(PlayerInfo[playerid][pMuted] >= 1) { SendClientMessage(playerid, lightred, "[System]: {B4B5B7}You were muted by an Admin!"); return 0; } return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { if(IsBeingSpeced[playerid] == 1) { foreach(Player,i) { if(spectatorid[i] == playerid) { PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid)); } } } } if(newstate == PLAYER_STATE_ONFOOT) { if(IsBeingSpeced[playerid] == 1) { foreach(Player,i) { if(spectatorid[i] == playerid) { PlayerSpectatePlayer(i, playerid); } } } } return 1; } public OnPlayerEnterCheckpoint(playerid) { return 1; } public OnPlayerLeaveCheckpoint(playerid) { return 1; } public OnPlayerEnterRaceCheckpoint(playerid) { return 1; } public OnPlayerLeaveRaceCheckpoint(playerid) { return 1; } public OnRconCommand(cmd[]) { return 1; } public OnPlayerRequestSpawn(playerid) { return 1; } public OnObjectMoved(objectid) { return 1; } public OnPlayerObjectMoved(playerid, objectid) { return 1; } public OnPlayerPickUpPickup(playerid, pickupid) { return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { return 1; } public OnPlayerSelectedMenuRow(playerid, row) { return 1; } public OnPlayerExitedMenu(playerid) { return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { if(IsBeingSpeced[playerid] == 1) { foreach(Player,i) { if(spectatorid[i] == playerid) { SetPlayerInterior(i,GetPlayerInterior(playerid)); SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid)); } } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { return 1; } public OnRconLoginAttempt(ip[], password[], success) { return 1; } public OnPlayerUpdate(playerid) { return 1; } public OnPlayerStreamIn(playerid, forplayerid) { return 1; } public OnPlayerStreamOut(playerid, forplayerid) { return 1; } public OnVehicleStreamIn(vehicleid, forplayerid) { return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTER: { if (!response) return Kick(playerid); if(response) { if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"Registering...",""COL_GREY"You have entered an invalid {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to register a new account.","Register","Quit"); new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_WriteInt(File,"Password",udb_hash(inputtext)); INI_WriteInt(File,"Admin",0); INI_WriteInt(File,"VIP",0); INI_WriteInt(File,"Wanted",0); INI_WriteInt(File,"Kills",0); INI_WriteInt(File,"Deaths",0); INI_WriteInt(File,"Jailed",0); INI_WriteInt(File,"Muted",0); INI_WriteInt(File,"Cash",0); INI_WriteInt(File,"Score",0); INI_WriteInt(File,"Banned",0); INI_Close(File); SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}Success!"); } } case DIALOG_LOGIN: { if ( !response ) return Kick ( playerid ); if( response ) { if(udb_hash(inputtext) == PlayerInfo[playerid][pPass]) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_LGREEN"Success",""COL_LGREEN"You have successfully logged in!","Ok",""); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"Login",""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.","Login","Quit"); } SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}Success!"); return 1; } } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } /******************************************************************************/ /**********************************< STOCKS >**********************************/ stock UserPath(playerid) { new string[1000],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(string,sizeof(string),PATH,playername); return string; } stock udb_hash(buf[]) { new length=strlen(buf); new s1 = 1; new s2 = 0; new n; for (n=0; n<length; n++) { s1 = (s1 + buf[n]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) + s1; } stock IsValidSkin(SkinID) { if((SkinID >= 0 && SkinID <= 2)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true; else return false; } stock ReportMessage(const string[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(PlayerInfo[i][pAdmin] > 0) { SendClientMessage(i, grey, string); } } } return 0; } /******************************************************************************/
Kind of worked , but now I have to log in all the time, it says, correct pass, but I have to log in again lol.
but thats no problem, i switched admin system, and thanks for the help |