Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Script Title: zAdmin
- Scripter: zDivine aka Mercenary
- Script Date: 20130516 (YYYYMMDD)
- Script Version: 1.0.1.0
- */
- /*
- SCRIPT CHANGELOG:
- ~ Version 1.0.0.0 ~ (20130516)
- - Initial Release
- ~ Version 1.0.1.0 ~ (20130517)
- - Added 10 new Admin commands
- - Added VIP system with 5 commands (Dynamic command levels)
- - Added zAdmin health system (tog-gable)
- - Added VIP alerting for Admins
- */
- #define FILTERSCRIPT
- // ----- [INCLUDES] -----
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <YSI\y_ini>
- #include <YSI\y_timers>
- #include <foreach>
- // ----------------------
- #if defined FILTERSCRIPT
- // ----- [COL DEFINES] -----
- #define COL_NICEGREEN "{6EF83C}"
- #define COL_NICERED "{FF0606}"
- #define COL_GREY "{AFAFAF}"
- #define COL_ORANGE "{FFAF00}"
- #define COL_EASY "{FFF1AF}"
- #define COL_WHITE "{FFFFFF}"
- #define COL_BLACK "{0E0101}"
- #define COL_RED "{A80000}"
- #define COL_YELLOW "{F3FF02}"
- #define COL_YELLOW2 "{DAE368}"
- #define COL_BYELLOW "{FFFF80}"
- #define COL_LIME "{B7FF00}"
- #define COL_CYAN "{00FFEE}"
- #define COL_LIGHTBLUE "{00C0FF}"
- #define COL_BLUE "{0049FF}"
- #define COL_MAGENTA "{F300FF}"
- #define COL_VIOLET "{B700FF}"
- #define COL_PINK "{FF00EA}"
- #define COL_MARONE "{A90202}"
- #define COL_CMD "{B8FF02}"
- #define COL_PARAM "{3FCD02}"
- #define COL_SERVER "{AFE7FF}"
- #define COL_VALUE "{A3E4FF}"
- #define COL_RULE "{F9E8B7}"
- #define COL_RULE2 "{FBDF89}"
- #define COL_RWHITE "{FFFFFF}"
- #define COL_LGREEN "{C9FFAB}"
- #define COL_LRED "{FFA1A1}"
- #define COL_LRED2 "{C77D87}"
- #define COL_GREEN "{00BC2E}"
- #define COL_LBLUE "{00A5FF}"
- #define COL_GRAD2 "{BFC0C2}"
- #define COL_REALRED "{FF0606}"
- #define COL_PURPLE "{C2A2DA}"
- // -------------------------
- // ----- [COLORS] -----
- #define COLOR_NICEGREEN 0x6EF83CFF
- #define COLOR_NICERED 0xFF0606FF
- #define COLOR_GREY 0xAFAFAFFF
- #define COLOR_ORANGE 0xFFAF00FF
- #define COLOR_EASY 0xFFF1AFFF
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_BLACK 0x0E0101FF
- #define COLOR_RED 0xA80000FF
- #define COLOR_YELLOW 0xF3FF02FF
- #define COLOR_YELLOW2 0xDAE368FF
- #define COLOR_BYELLOW 0xFFFF80FF
- #define COLOR_LIME 0xB7FF00FF
- #define COLOR_CYAN 0x00FFEEFF
- #define COLOR_LIGHTBLUE 0x00C0FFFF
- #define COLOR_BLUE 0x0049FFFF
- #define COLOR_MAGENTA 0xF300FFFF
- #define COLOR_VIOLET 0xB700FFFF
- #define COLOR_PINK 0xFF00EAFF
- #define COLOR_MARONE 0xA90202FF
- #define COLOR_CMD 0xB8FF02FF
- #define COLOR_PARAM 0x3FCD02FF
- #define COLOR_SERVER 0xAFE7FFFF
- #define COLOR_VALUE 0xA3E4FFFF
- #define COLOR_RULE 0xF9E8B7FF
- #define COLOR_RULE2 0xFBDF89FF
- #define COLOR_RWHITE 0xFFFFFFFF
- #define COLOR_LGREEN 0xC9FFABFF
- #define COLOR_LRED 0xFFA1A1FF
- #define COLOR_LRED2 0xC77D87FF
- #define COLOR_GREEN 0x00BC2EFF
- #define COLOR_LBLUE 0x00A5FFFF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_REALRED 0xFF0606FF
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xC2A2DAAA
- forward fcreate(filename[]);
- public fcreate(filename[])
- {
- if (fexist(filename)){return false;}
- new File:fhandle = fopen(filename,io_write);
- fclose(fhandle);
- return true;
- }
- public OnFilterScriptInit()
- {
- // ----- [LOADING SERVER SETTINGS] -----
- LoadCommands();
- LoadVIPCommands();
- // -------------------------------------
- // ----- [FILE CHECKS] -----
- if(!fexist("zAdmin/commands.cfg"))
- {
- print("WARNING: The commands.cfg file was missing, so it was automatically created.");
- fcreate("zAdmin/commands.cfg");
- SetCommandDefaults();
- }
- if(!fexist("zAdmin/bans.cfg"))
- {
- print("WARNING: The bans.cfg file was missing, so it was automatically created.");
- fcreate("zAdmin/bans.cfg");
- }
- if(!fexist("zAdmin/vipcommands.cfg"))
- {
- print("WARNING: The vipcommands.cfg file was missing, so it was automatically created.");
- fcreate("zAdmin/vipcommands.cfg");
- }
- // -------------------------
- print("\n--------------------------------------");
- print(" zDivine's Admin System Loaded.");
- print("--------------------------------------\n");
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- INI_ParseFile(UserPath(i), "LoadUser_%s", .bExtra = true, .extra = i);
- SetTimerEx("UnsetLogin", 500, 0, "i", i);
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- // ----- [SAVING SERVER SETTINGS] -----
- SaveCommands();
- SaveVIPCommands();
- // ------------------------------------
- return 1;
- }
- #endif
- // ----- [SERVER SETTINGS] -----
- #define USER_ACCOUNTS "zAdmin/Users/%s.ini"
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- // -----------------------------
- // ----- [DIALOGS] -----
- #define DIALOG_LOGIN 1
- #define DIALOG_REGISTER 2
- #define DIALOG_CMD_MAIN 3
- #define DIALOG_CMD_EDIT 4
- #define DIALOG_VCMD_MAIN 5
- // ---------------------
- // ----- [VARIABLES] -----
- new bool: pLogged[MAX_PLAYERS] = false;
- new bool: pFrozen[MAX_PLAYERS] = false;
- // INFP: 1 = TRUE / 0 = FALSE
- new bool: USE_ZADMIN_POSITION = true;
- new bool: USE_ZADMIN_SKIN = true;
- new bool: USE_ZADMIN_MONEY = true;
- new bool: USE_ZADMIN_HEALTHARMOUR = true;
- // ----- [VIP SYSTEM] -----
- new bool: ZADMIN_VIP_ALERT = true;
- // ------------------------
- // -----------------------
- // ----- [ENUMS] -----
- enum p_Info
- {
- p_Pass[64],
- p_Admin,
- p_IP[16],
- p_Level,
- p_Cash,
- p_Skin,
- Float: p_PosX,
- Float: p_PosY,
- Float: p_PosZ,
- Float: p_PosA,
- p_Banned,
- p_Isolated,
- p_IsolationTime,
- p_Muted,
- Float: p_Health,
- Float: p_Armour,
- p_VIP
- }
- new PI[MAX_PLAYERS][p_Info];
- enum cmd_Info
- {
- cmd_SetAdmin,
- cmd_Kick,
- cmd_Ban,
- cmd_Unban,
- cmd_Freeze,
- cmd_Unfreeze,
- cmd_Slap,
- cmd_Isolate,
- cmd_Unisolate,
- cmd_SetHealth,
- cmd_SetArmour,
- cmd_GiveGun,
- cmd_GiveCar,
- cmd_TakeGuns,
- cmd_Goto,
- cmd_GetHere,
- cmd_Explode,
- cmd_BanIP,
- cmd_UnbanIP,
- cmd_SetSkin,
- cmd_FreezeAll,
- cmd_UnfreezeAll,
- cmd_GetAllHere,
- cmd_KickAll,
- cmd_Ann,
- cmd_SetColor,
- cmd_MakeVIP,
- cmd_GotoLoc,
- cmd_SaveCFGs,
- cmd_VIPAlert
- };
- new CI[cmd_Info];
- enum vcmd_Info
- {
- vcmd_Car,
- vcmd_Gun,
- vcmd_Heal,
- vcmd_Fix,
- vcmd_VC
- };
- new VCI[vcmd_Info];
- // -------------------
- // ----- [TIMERS/TASKS] -----
- task MinuteCount[60000]()
- {
- foreach(Player, i)
- {
- if(PI[i][p_Isolated] == 1)
- {
- if(PI[i][p_IsolationTime] > 0)
- {
- PI[i][p_IsolationTime]--;
- }
- else
- {
- new Float: x, Float: y, Float: z;
- GetPlayerPos(i, x, y, z);
- SetPlayerPos(i, x, y, z-2000);
- TogglePlayerControllable(i, 1);
- PI[i][p_Isolated] = 0;
- GameTextForPlayer(i, "~g~UN-ISOLATED!", 3000, 5);
- }
- }
- }
- }
- forward UnsetLogin(playerid);
- public UnsetLogin(playerid)
- {
- new string[256];
- format(string, sizeof(string), ""COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICEGREEN"Registered\n\n"COL_WHITE"Please enter your password below to login.", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "zAdmin - Login", string, "Login", "Quit");
- return 1;
- }
- // --------------------------
- // ----- [STOCKS] -----
- 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 GetAdminName(playerid)
- {
- new aname[24];
- switch(PI[playerid][p_Admin])
- {
- case 1: aname = "Moderator";
- case 2: aname = "Administator";
- case 3: aname = "Head Administrator";
- case 4: aname = "Executive Administrator";
- default: aname = "Player";
- }
- return aname;
- }
- stock GetName(playerid)
- {
- new pname[MAX_PLAYER_NAME], i_pos;
- GetPlayerName(playerid, pname, sizeof(pname));
- while((i_pos = strfind(pname, "_", false, i_pos)) != -1) pname[i_pos] = ' ';
- return pname;
- }
- stock UserPath(playerid)
- {
- new pname[MAX_PLAYER_NAME], string[64];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), USER_ACCOUNTS, pname);
- return string;
- }
- stock SendPermissionError(playerid)
- {
- SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You are not permitted to use this command ::.");
- }
- stock SendConnectionError(playerid)
- {
- SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Player not connected ::.");
- return 1;
- }
- stock CheckBan(ip[])
- {
- new string[128];
- new File: file = fopen("zAdmin/bans.cfg", io_read);
- while(fread(file, string))
- {
- if(strcmp(ip, string, true, strlen(ip)) == 0)
- {
- fclose(file);
- return 1;
- }
- }
- fclose(file);
- return 0;
- }
- stock AddBan(ip[])
- {
- if(CheckBan(ip) == 0)
- {
- new File: file = fopen("zAdmin/bans.cfg", io_write);
- new string[20];
- format(string, sizeof(string), "\n%s", ip);
- fwrite(file, string);
- fclose(file);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new pIP[16];
- GetPlayerIp(i, pIP, sizeof(pIP));
- if(strcmp(pIP, ip) == 0)
- {
- SendClientMessage(i, COLOR_WHITE, "SERVER: You are banned from this server.");
- Kick(i);
- }
- }
- return 1;
- }
- return 0;
- }
- stock RemoveBan(ip[])
- {
- if(CheckBan(ip) == 1)
- {
- new string[20];
- new File: file = fopen("zAdmin/bans.cfg", io_read);
- fcreate("zAdmin/tmpban.cfg");
- new File: file2 = fopen("zAdmin/tmpban.cfg", io_append);
- while(fread(file, string))
- {
- if(strcmp(ip, string, true, strlen(ip)) != 0 && strcmp("\n", string) != 0)
- {
- fwrite(file2, string);
- }
- }
- fclose(file);
- fclose(file2);
- file = fopen("zAdmin/bans.cfg", io_write);
- file2 = fopen("zAdmin/tmpban.cfg", io_read);
- while(fread(file2, string))
- {
- fwrite(file, string);
- }
- fclose(file);
- fclose(file2);
- fremove("zAdmin/tmpban.cfg");
- return 1;
- }
- return 0;
- }
- stock SetCommandDefaults()
- {
- CI[cmd_SetAdmin] = 1;
- CI[cmd_Kick] = 1;
- CI[cmd_Ban] = 1;
- CI[cmd_Unban] = 1;
- CI[cmd_Freeze] = 1;
- CI[cmd_Unfreeze] = 1;
- CI[cmd_Slap] = 1;
- CI[cmd_Isolate] = 1;
- CI[cmd_Unisolate] = 1;
- CI[cmd_SetHealth] = 1;
- CI[cmd_SetArmour] = 1;
- CI[cmd_GiveGun] = 1;
- CI[cmd_GiveCar] = 1;
- CI[cmd_TakeGuns] = 1;
- CI[cmd_Goto] = 1;
- CI[cmd_GetHere] = 1;
- CI[cmd_Explode] = 1;
- CI[cmd_BanIP] = 1;
- CI[cmd_UnbanIP] = 1;
- CI[cmd_FreezeAll] = 1;
- CI[cmd_UnfreezeAll] = 1;
- CI[cmd_GetAllHere] = 1;
- CI[cmd_KickAll] = 1;
- CI[cmd_Ann] = 1;
- CI[cmd_SetColor] = 1;
- CI[cmd_MakeVIP] = 1;
- CI[cmd_GotoLoc] = 1;
- CI[cmd_SaveCFGs] = 1;
- SaveCommands();
- }
- stock SendAdminMessage(color, string[])
- {
- foreach(Player, i)
- {
- if(PI[i][p_Admin] >= 1)
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- // --------------------
- // ----- [SAVING/LOADING] -----
- forward SaveAccount(playerid);
- public SaveAccount(playerid)
- {
- if(pLogged[playerid] == true)
- {
- new Float: x, Float: y, Float: z, Float: a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- PI[playerid][p_PosX] = x;
- PI[playerid][p_PosY] = y;
- PI[playerid][p_PosZ] = z;
- PI[playerid][p_PosA] = a;
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Admin", PI[playerid][p_Admin]);
- INI_WriteString(File, "IP", PI[playerid][p_IP]);
- INI_WriteInt(File, "Level", PI[playerid][p_Level]);
- INI_WriteInt(File, "Cash", PI[playerid][p_Cash]);
- INI_WriteInt(File, "Skin", PI[playerid][p_Skin]);
- INI_WriteFloat(File, "PosX", PI[playerid][p_PosX]);
- INI_WriteFloat(File, "PosY", PI[playerid][p_PosY]);
- INI_WriteFloat(File, "PosZ", PI[playerid][p_PosZ]);
- INI_WriteFloat(File, "PosA", PI[playerid][p_PosA]);
- INI_WriteInt(File, "Banned", PI[playerid][p_Banned]);
- INI_WriteInt(File, "Isolated", PI[playerid][p_Isolated]);
- INI_WriteInt(File, "IsolationTime", PI[playerid][p_IsolationTime]);
- INI_WriteInt(File, "Muted", PI[playerid][p_Muted]);
- INI_WriteFloat(File, "Health", PI[playerid][p_Health]);
- INI_WriteFloat(File, "Armour", PI[playerid][p_Armour]);
- INI_WriteInt(File, "VIP", PI[playerid][p_VIP]);
- INI_Close(File);
- }
- return 1;
- }
- forward LoadUser_data(playerid, name[], value[]);
- public LoadUser_data(playerid, name[], value[])
- {
- INI_Int("Password", PI[playerid][p_Pass]);
- INI_Int("Admin", PI[playerid][p_Admin]);
- INI_String("IP", PI[playerid][p_IP], 16);
- INI_Int("Level", PI[playerid][p_Level]);
- INI_Int("Cash", PI[playerid][p_Cash]);
- INI_Int("Skin", PI[playerid][p_Skin]);
- INI_Float("PosX", PI[playerid][p_PosX]);
- INI_Float("PosY", PI[playerid][p_PosY]);
- INI_Float("PosZ", PI[playerid][p_PosZ]);
- INI_Float("PosA", PI[playerid][p_PosA]);
- INI_Int("Banned", PI[playerid][p_Banned]);
- INI_Int("Isolated", PI[playerid][p_Isolated]);
- INI_Int("IsolationTime", PI[playerid][p_IsolationTime]);
- INI_Int("Muted", PI[playerid][p_Muted]);
- INI_Float("Health", PI[playerid][p_Health]);
- INI_Float("Armour", PI[playerid][p_Armour]);
- INI_Int("VIP", PI[playerid][p_VIP]);
- return 1;
- }
- stock SaveVIPCommands()
- {
- new string[128];
- new File: file = fopen("zAdmin/vipcommands.cfg", io_write);
- format(string, sizeof(string), "%d|%d|%d|%d|%d",
- VCI[vcmd_Car],
- VCI[vcmd_Gun],
- VCI[vcmd_Heal],
- VCI[vcmd_Fix],
- VCI[vcmd_VC]);
- fwrite(file, string);
- fclose(file);
- return 1;
- }
- stock LoadVIPCommands()
- {
- new string[128];
- new File: file = fopen("zAdmin/vipcommands.cfg", io_read);
- sscanf(string, "p<|>iiiii",
- VCI[vcmd_Car],
- VCI[vcmd_Gun],
- VCI[vcmd_Heal],
- VCI[vcmd_Fix],
- VCI[vcmd_VC]);
- fclose(file);
- return 1;
- }
- stock SaveCommands()
- {
- new string[128];
- new File: file = fopen("zAdmin/commands.cfg", io_write);
- format(string, sizeof(string), "%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d",
- CI[cmd_SetAdmin],
- CI[cmd_Kick],
- CI[cmd_Ban],
- CI[cmd_Unban],
- CI[cmd_Freeze],
- CI[cmd_Unfreeze],
- CI[cmd_Slap],
- CI[cmd_Isolate],
- CI[cmd_Unisolate],
- CI[cmd_SetHealth],
- CI[cmd_SetArmour],
- CI[cmd_GiveGun],
- CI[cmd_GiveCar],
- CI[cmd_TakeGuns],
- CI[cmd_Goto],
- CI[cmd_GetHere],
- CI[cmd_Explode],
- CI[cmd_BanIP],
- CI[cmd_UnbanIP],
- CI[cmd_FreezeAll],
- CI[cmd_UnfreezeAll],
- CI[cmd_GetAllHere],
- CI[cmd_KickAll],
- CI[cmd_Ann],
- CI[cmd_SetColor],
- CI[cmd_MakeVIP],
- CI[cmd_GotoLoc],
- CI[cmd_SaveCFGs],
- CI[cmd_VIPAlert]);
- fwrite(file, string);
- fclose(file);
- return 1;
- }
- stock LoadCommands()
- {
- new string[128];
- new File: file = fopen("zAdmin/commands.cfg", io_read);
- sscanf(string, "p<|>iiiiiiiiiiiiiiiiiiiiiiiiiiiii",
- CI[cmd_SetAdmin],
- CI[cmd_Kick],
- CI[cmd_Ban],
- CI[cmd_Unban],
- CI[cmd_Freeze],
- CI[cmd_Unfreeze],
- CI[cmd_Slap],
- CI[cmd_Isolate],
- CI[cmd_Unisolate],
- CI[cmd_SetHealth],
- CI[cmd_SetArmour],
- CI[cmd_GiveGun],
- CI[cmd_GiveCar],
- CI[cmd_TakeGuns],
- CI[cmd_Goto],
- CI[cmd_GetHere],
- CI[cmd_Explode],
- CI[cmd_BanIP],
- CI[cmd_UnbanIP],
- CI[cmd_FreezeAll],
- CI[cmd_UnfreezeAll],
- CI[cmd_GetAllHere],
- CI[cmd_KickAll],
- CI[cmd_Ann],
- CI[cmd_SetColor],
- CI[cmd_MakeVIP],
- CI[cmd_GotoLoc],
- CI[cmd_SaveCFGs],
- CI[cmd_VIPAlert]);
- fclose(file);
- return 1;
- }
- // ----------------------------
- public OnPlayerConnect(playerid)
- {
- new string[256], pIP[16];
- GetPlayerIp(playerid, pIP, sizeof(pIP));
- if(CheckBan(pIP) == 1)
- {
- format(string, sizeof(string), ".:: ERROR: This IP (%s) is banned from the server ::.", pIP);
- SendClientMessage(playerid, COLOR_REALRED, string);
- return 1;
- }
- if(PI[playerid][p_Banned] == 1)
- {
- format(string, sizeof(string), ".:: ERROR: This account (%s) is banned from the server ::.", GetName(playerid));
- SendClientMessage(playerid, COLOR_REALRED, string);
- return 1;
- }
- if(PI[playerid][p_Banned] == 1 && CheckBan(pIP) == 0)
- {
- foreach(Player, i)
- {
- if(PI[i][p_Admin] >= 1)
- {
- format(string, sizeof(string), ".:: %s just attempted to login to the server on a banned account, and has been automatically IP banned ::.", GetName(playerid));
- SendClientMessage(i, COLOR_YELLOW, string);
- AddBan(pIP);
- }
- }
- }
- format(string, sizeof(string), ".:: [CONNECT] %s has joined the server ::.", GetName(playerid));
- SendClientMessageToAll(COLOR_GREY, string);
- if(!fexist(UserPath(playerid)))
- {
- format(string, sizeof(string), ""COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICERED"Unregistered\n\n"COL_WHITE"Please enter your desired password below to register.", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "zAdmin - Registration", string, "Register", "Quit");
- }
- else
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SetTimerEx("UnsetLogin", 500, 0, "i", playerid);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new string[128];
- if(pLogged[playerid] == true)
- {
- SaveAccount(playerid);
- pLogged[playerid] = false;
- }
- switch(reason)
- {
- case 0: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [TIMED-OUT] ::.", GetName(playerid));
- case 1: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [LEAVING] ::.", GetName(playerid));
- case 2: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [KICKED/BANNED] ::.", GetName(playerid));
- }
- SendClientMessageToAll(COLOR_GREY, string);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(PI[playerid][p_PosX] == 0.0 && PI[playerid][p_PosY] == 0.0 && PI[playerid][p_PosZ] == 0.0)
- {
- SetPlayerSkin(playerid, PI[playerid][p_Skin]);
- // You can set their position here.
- }
- else
- {
- if(USE_ZADMIN_POSITION == true)
- {
- SetPlayerPos(playerid, PI[playerid][p_PosX], PI[playerid][p_PosY], PI[playerid][p_PosZ]);
- SetPlayerFacingAngle(playerid, PI[playerid][p_PosA]);
- }
- if(USE_ZADMIN_SKIN == true)
- {
- SetPlayerSkin(playerid, PI[playerid][p_Skin]);
- }
- if(USE_ZADMIN_MONEY == true)
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, PI[playerid][p_Cash]);
- }
- if(USE_ZADMIN_HEALTHARMOUR == true)
- {
- SetPlayerHealth(playerid, PI[playerid][p_Health]);
- SetPlayerArmour(playerid, PI[playerid][p_Armour]);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- 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)
- {
- 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[])
- {
- new string[256];
- if(dialogid == DIALOG_REGISTER)
- {
- if(!response) Kick(playerid);
- if(response)
- {
- if(strlen(inputtext) >= 5 && strlen(inputtext) <= 16)
- {
- new pIP[16];
- GetPlayerIp(playerid, pIP, sizeof(pIP));
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Password", udb_hash(inputtext));
- INI_WriteInt(File, "Admin", 0);
- INI_WriteString(File, "IP", pIP);
- INI_WriteInt(File, "Level", 0);
- INI_WriteInt(File, "Cash", 0);
- INI_WriteInt(File, "Skin", 299);
- INI_WriteFloat(File, "PosX", 0.0);
- INI_WriteFloat(File, "PosY", 0.0);
- INI_WriteFloat(File, "PosZ", 0.0);
- INI_WriteFloat(File, "PosA", 0.0);
- INI_WriteInt(File, "Banned", 0);
- INI_WriteInt(File, "Isolated", 0);
- INI_WriteInt(File, "IsolationTime", 0);
- INI_WriteInt(File, "Muted", 0);
- INI_WriteFloat(File, "Health", 100.0);
- INI_WriteFloat(File, "Armour", 0.0);
- INI_WriteInt(File, "VIP", 0);
- INI_Close(File);
- PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0.0);
- format(string, sizeof(string), ".:: Account '%s' successfully registered with password '%s' ::.", GetName(playerid), inputtext);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- pLogged[playerid] = true;
- SetSpawnInfo(playerid, 0, 299, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- }
- else
- {
- format(string, sizeof(string), ""COL_NICERED"ERROR: "COL_WHITE"Invalid password length. (5 - 16 characters.\n\n"COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICERED"Unregistered\n\n"COL_WHITE"Please enter your desired password below to register.", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "zAdmin - Registration", string, "Register", "Quit");
- }
- }
- }
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response) Kick(playerid);
- if(response)
- {
- if(udb_hash(inputtext) == PI[playerid][p_Pass])
- {
- format(string, sizeof(string), ".:: Successfully logged into account '%s' ::.", GetName(playerid));
- PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0.0);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- SpawnPlayer(playerid);
- }
- else
- {
- format(string, sizeof(string), ""COL_NICERED"ERROR: "COL_WHITE"Invalid password.\n\n"COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICEGREEN"Registered\n\n"COL_WHITE"Please enter your password below to login.", GetName(playerid));
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "zAdmin - Login", string, "Login", "Quit");
- }
- }
- }
- if(dialogid == DIALOG_CMD_MAIN)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetAdmin\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SetAdmin", 1);
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Kick\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Kick", 1);
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Ban\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Ban", 1);
- }
- case 3:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unban\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Unban", 1);
- }
- case 4:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Freeze\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Freeze", 1);
- }
- case 5:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unfreeze\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Unfreeze", 1);
- }
- case 6:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Slap\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Slap", 1);
- }
- case 7:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Isolate\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Isolate", 1);
- }
- case 8:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unisolate\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Unisolate", 1);
- }
- case 9:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetHealth\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SetHealth", 1);
- }
- case 10:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetArmour\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SetArmour", 1);
- }
- case 11:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GiveGun\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_GiveGun", 1);
- }
- case 12:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GiveCar\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_GiveCar", 1);
- }
- case 13:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: TakeGuns\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_TakeGuns", 1);
- }
- case 14:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Goto\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Goto", 1);
- }
- case 15:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GetHere\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_GetHere", 1);
- }
- case 16:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Explode\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Explode", 1);
- }
- case 17:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: BanIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_BanIP", 1);
- }
- case 18:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: UnbanIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_UnbanIP", 1);
- }
- case 19:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetSkin\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SetSkin", 1);
- }
- case 20:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: FreezeAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_FreezeAll", 1);
- }
- case 21:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: UnfreezeAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_UnfreezeAll", 1);
- }
- case 22:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GetAllHere\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_GetAllHere", 1);
- }
- case 23:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: KickAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_KickAll", 1);
- }
- case 24:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Ann\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_Ann", 1);
- }
- case 25:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetColor\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SetColor", 1);
- }
- case 26:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: MakeVIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_MakeVIP", 1);
- }
- case 27:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GotoLoc\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_GotoLoc", 1);
- }
- case 28:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SaveCFGs\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_SaveCFGs", 1);
- }
- case 29:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: VIPAlert\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "cmd_VIPAlert", 1);
- }
- }
- }
- }
- if(dialogid == DIALOG_CMD_EDIT)
- {
- if(response)
- {
- if(strval(inputtext) > 0 && strval(inputtext) < 5)
- {
- if(GetPVarInt(playerid, "cmd_SetAdmin") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SetAdmin | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SetAdmin");
- CI[cmd_SetAdmin] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Kick") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Kick | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Kick");
- CI[cmd_Kick] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Ban") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Ban | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Ban");
- CI[cmd_Ban] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Unban") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Unban | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Unban");
- CI[cmd_Unban] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Freeze") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Freeze | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Freeze");
- CI[cmd_Freeze] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Unfreeze") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Unfreeze | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Unfreeze");
- CI[cmd_Unfreeze] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Slap") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Slap | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Slap");
- CI[cmd_Slap] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Isolate") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Isolate | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Isolate");
- CI[cmd_Isolate] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Unisolate") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Unisolate | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Unisolate");
- CI[cmd_Unisolate] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_SetHealth") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SetHealth | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SetHealth");
- CI[cmd_SetHealth] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_SetArmour") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SetArmour | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SetArmour");
- CI[cmd_SetArmour] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_GiveGun") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: GiveGun | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_GiveGun");
- CI[cmd_GiveGun] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_GiveCar") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: GiveCar | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_GiveCar");
- CI[cmd_GiveCar] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_TakeGuns") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: TakeGuns | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_TakeGuns");
- CI[cmd_TakeGuns] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Goto") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Goto | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Goto");
- CI[cmd_Goto] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_GetHere") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: GetHere | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_GetHere");
- CI[cmd_GetHere] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Explode") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Explode | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Explode");
- CI[cmd_Explode] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_BanIP") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: BanIP | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_BanIP");
- CI[cmd_BanIP] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_UnbanIP") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: UnbanIP | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_UnbanIP");
- CI[cmd_UnbanIP] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_SetSkin") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SetSkin | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SetSkin");
- CI[cmd_SetSkin] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_FreezeAll") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: FreezeAll | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_FreezeAll");
- CI[cmd_FreezeAll] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_UnfreezeAll") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: UnfreezeAll | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_UnfreezeAll");
- CI[cmd_UnfreezeAll] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_GetAllHere") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: GetAllHere | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_GetAllHere");
- CI[cmd_GetAllHere] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_KickAll") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: KickAll | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_KickAll");
- CI[cmd_KickAll] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_Ann") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: Ann | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_Ann");
- CI[cmd_Ann] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_SetColor") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SetColor | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SetColor");
- CI[cmd_SetColor] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_MakeVIP") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: MakeVIP | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_MakeVIP");
- CI[cmd_MakeVIP] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_GotoLoc") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: GotoLoc | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_GotoLoc");
- CI[cmd_GotoLoc] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_SaveCFGs") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: SaveCFGs | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_SaveCFGs");
- CI[cmd_SaveCFGs] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "cmd_VIPAlert") == 1)
- {
- format(string, sizeof(string), ".:: Command level set. [Command: VIPAlert | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "cmd_VIPAlert");
- CI[cmd_VIPAlert] = strval(inputtext);
- SaveCommands();
- }
- if(GetPVarInt(playerid, "vcmd_Car") == 1)
- {
- format(string, sizeof(string), ".:: VIP Command level set. [Command: vCar | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "vcmd_Car");
- VCI[vcmd_Car] = strval(inputtext);
- SaveVIPCommands();
- }
- if(GetPVarInt(playerid, "vcmd_Gun") == 1)
- {
- format(string, sizeof(string), ".:: VIP Command level set. [Command: vGun | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "vcmd_Gun");
- VCI[vcmd_Gun] = strval(inputtext);
- SaveVIPCommands();
- }
- if(GetPVarInt(playerid, "vcmd_Heal") == 1)
- {
- format(string, sizeof(string), ".:: VIP Command level set. [Command: vHeal | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "vcmd_Heal");
- VCI[vcmd_Heal] = strval(inputtext);
- SaveVIPCommands();
- }
- if(GetPVarInt(playerid, "vcmd_Fix") == 1)
- {
- format(string, sizeof(string), ".:: VIP Command level set. [Command: vFix | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "vcmd_Fix");
- VCI[vcmd_Fix] = strval(inputtext);
- SaveVIPCommands();
- }
- if(GetPVarInt(playerid, "vcmd_VC") == 1)
- {
- format(string, sizeof(string), ".:: VIP Command level set. [Command: VC | Level: %d] ::.", strval(inputtext));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- DeletePVar(playerid, "vcmd_VC");
- VCI[vcmd_VC] = strval(inputtext);
- SaveVIPCommands();
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Command level must be between 1 and 4 ::.");
- }
- }
- }
- if(dialogid == DIALOG_VCMD_MAIN)
- {
- if(response)
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vCar\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "vcmd_Car", 1);
- }
- case 1:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vGun\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "vcmd_Gun", 1);
- }
- case 2:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vHeal\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "vcmd_Heal", 1);
- }
- case 3:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vFix\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "vcmd_Fix", 1);
- }
- case 4:
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: VC\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
- SetPVarInt(playerid, "vcmd_VC", 1);
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- CMD:editcmds(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= 4)
- {
- ShowPlayerDialog(playerid, DIALOG_CMD_MAIN, DIALOG_STYLE_LIST, "zAdmin - Command Editor", "SetAdmin\nKick\nBan\nUnban\nFreeze\nUnfreeze\nSlap\nIsolate\nUnisolate\nSetHealth\nSetArmour\nGiveGun\nGiveCar\nTakeGuns\nGoto\nGetHere\nExplode\nBanIP\nUnbanIP\nSetSkin\nFreezeAll\nUnfreezeAll\nGetAllHere\nKickAll\nAnn\nSetColor\nMakeVIP\nGotoLoc\nSaveCFGs\nVIPAlert", "Select", "Cancel");
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:editvcmds(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= 4)
- {
- ShowPlayerDialog(playerid, DIALOG_VCMD_MAIN, DIALOG_STYLE_LIST, "zAdmin - VIP Command Editor", "vCar\nvGun\nvHeal\nvFix\nVC", "Select", "Cancel");
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SetAdmin])
- {
- new targetid, level, string[128];
- if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setadmin [playerid] [level]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(PI[targetid][p_Admin] == level) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already that level ::.");
- PI[targetid][p_Admin] = level;
- format(string, sizeof(string), ".:: You have set %s to a(n) %s ::.", GetName(targetid), GetAdminName(targetid));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has set you to a(n) %s ::.", GetAdminName(playerid), GetName(playerid), GetAdminName(targetid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:kick(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Kick])
- {
- new targetid, reason[64], string[128];
- if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /kick [playerid] [reason]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: %s %s has kicked %s, reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), reason);
- SendClientMessageToAll(COLOR_REALRED, string);
- Kick(targetid);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:ban(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Ban])
- {
- new targetid, reason[64], string[128], tIP[16];
- if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /ban [playerid] [reaosn]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: %s %s has banned %s, reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), reason);
- SendClientMessageToAll(COLOR_REALRED, string);
- GetPlayerIp(targetid, tIP, sizeof(tIP));
- PI[targetid][p_Banned] = 1;
- AddBan(tIP);
- Kick(targetid);
- SaveAccount(targetid);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:unban(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Unban])
- {
- new targetname[MAX_PLAYER_NAME], string[128], pathstring[64];
- if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unban [account name]");
- format(pathstring, sizeof(pathstring), "zAdmin/Users/%s.ini", targetname);
- if(!fexist(pathstring)) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player's file does not exist.");
- new INI:File = INI_Open(pathstring);
- INI_SetTag(File, "data");
- INI_WriteInt(File, "Banned", 0);
- INI_Close(File);
- format(string, sizeof(string), ".:: %s %s has unbanned account '%s' ::.", GetAdminName(playerid), GetName(playerid), targetname);
- SendClientMessageToAll(COLOR_REALRED, string);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:banip(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_BanIP])
- {
- new tIP[16], string[128];
- if(sscanf(params, "s[16]", tIP)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /banip [IP]");
- if(CheckBan(tIP) == 1) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That IP is already banned ::.");
- format(string, sizeof(string), ".:: %s %s has banned IP '%s' ::.", GetAdminName(playerid), GetName(playerid), tIP);
- SendClientMessageToAll(COLOR_REALRED, string);
- AddBan(tIP);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:unbanip(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_UnbanIP])
- {
- new tIP[16], string[128];
- if(sscanf(params, "s[16]", tIP)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unbanip [IP]");
- if(CheckBan(tIP) == 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That IP is not banned ::.");
- format(string, sizeof(string), ".:: %s %s has unbanned IP '%s' ::.", GetAdminName(playerid), GetName(playerid), tIP);
- SendClientMessageToAll(COLOR_REALRED, string);
- RemoveBan(tIP);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Freeze])
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /freeze [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(pFrozen[targetid] == true) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already frozen ::.");
- format(string, sizeof(string), ".:: %s %s has frozen %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
- SendClientMessageToAll(COLOR_REALRED, string);
- TogglePlayerControllable(targetid, 0);
- pFrozen[targetid] = true;
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Unfreeze])
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unfreeze [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(pFrozen[targetid] == false) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is not frozen ::.");
- format(string, sizeof(string), ".:: %s %s has unfrozen %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
- SendClientMessageToAll(COLOR_REALRED, string);
- TogglePlayerControllable(targetid, 1);
- pFrozen[targetid] = false;
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Slap])
- {
- new targetid, height, string[128];
- if(sscanf(params, "ud", targetid, height)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /slap [playerid] [height]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- new Float: x, Float: y, Float: z;
- GetPlayerPos(targetid, x, y, z);
- format(string, sizeof(string), ".:: %s %s has slapped %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
- SendClientMessageToAll(COLOR_REALRED, string);
- SetPlayerPos(targetid, x, y, z+height);
- GameTextForPlayer(targetid, "~r~SLAPPED!", 3000, 5);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:isolate(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Isolate])
- {
- new targetid, time, reason[64], string[128];
- if(sscanf(params, "uds[64]", targetid, time, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /isolate [playerid] [time(minutes)] [reason]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(strlen(reason) <= 0) reason = "Not specified.";
- if(time < 1 || time > 30) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Time must be between 1 and 30 ::.");
- if(PI[targetid][p_Isolated] == 1) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already isolated ::.");
- new Float: x, Float: y, Float: z;
- GetPlayerPos(targetid, x, y, z);
- format(string, sizeof(string), ".:: %s %s has isolated %s for %d minute(s), reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), time, reason);
- SendClientMessageToAll(COLOR_REALRED, string);
- PI[targetid][p_IsolationTime] = time;
- PI[targetid][p_Isolated] = 1;
- SetPlayerPos(targetid, x, y, z+2000);
- TogglePlayerControllable(targetid, 0);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:unisolate(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Unisolate])
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unisolate [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(PI[targetid][p_Isolated] == 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is not isolated ::.");
- new Float: x, Float: y, Float: z;
- GetPlayerPos(targetid, x, y, z);
- format(string, sizeof(string), ".:: %s %s has un-isolated %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
- SendClientMessageToAll(COLOR_REALRED, string);
- SetPlayerPos(targetid, x, y, z-2000);
- TogglePlayerControllable(targetid, 1);
- PI[targetid][p_Isolated] = 0;
- PI[targetid][p_IsolationTime] = 0;
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:sethealth(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SetHealth])
- {
- new targetid, Float: health, string[128];
- if(sscanf(params, "uf", targetid, health)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /sethealth [playerid] [health]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: You have set %s's health to %.01f ::.", GetName(targetid), health);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has set your health to %.01f ::.", GetAdminName(playerid), GetName(playerid), health);
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerHealth(targetid, health);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:setarmour(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SetArmour])
- {
- new targetid, Float: armour, string[128];
- if(sscanf(params, "uf", targetid, armour)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /sethealth [playerid] [armour]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: You have set %s's armour to %.01f ::.", GetName(targetid), armour);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has set your armour to %.01f ::.", GetAdminName(playerid), GetName(playerid), armour);
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerArmour(targetid, armour);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:givegun(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_GiveGun])
- {
- new targetid, weapon, string[128];
- if(sscanf(params, "ud", targetid, weapon)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /givegun [playerid] [weapon]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: You have given %s weapon ID %d ::.", GetName(targetid), weapon);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has given you weapon ID %d ::.", GetAdminName(playerid), GetName(playerid), weapon);
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- GivePlayerWeapon(targetid, weapon, 999999);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:givecar(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_GiveCar])
- {
- new targetid, car, string[128];
- if(sscanf(params, "ud", targetid, car)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /givecar [playerid] [vehicleid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- new Float: x, Float: y, Float: z, Float: a;
- GetPlayerPos(targetid, x, y, z);
- GetPlayerFacingAngle(targetid, a);
- new rd1 = random(20);
- new rd2 = random(20);
- format(string, sizeof(string), ".:: You have given %s vehicle ID %d ::.", GetName(targetid), car);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has given you vehicle ID %d ::.", GetAdminName(playerid), GetName(playerid), car);
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- new veh = CreateVehicle(car, x, y, z, a, rd1, rd2, -1);
- PutPlayerInVehicle(targetid, veh, 0);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:takeguns(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_TakeGuns])
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /takeguns [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- format(string, sizeof(string), ".:: %s %s has stripped %s of all his weapons ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
- SendClientMessageToAll(COLOR_REALRED, string);
- ResetPlayerWeapons(targetid);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Goto])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /goto [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- new Float: x, Float: y, Float: z;
- GetPlayerPos(targetid, x, y, z);
- SetPlayerPos(playerid, x, y, z+0.2);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:gethere(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_GetHere])
- {
- new targetid, string[128];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /gethere [playerid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- new Float: x, Float: y, Float: z;
- GetPlayerPos(playerid, x, y, z);
- format(string, sizeof(string), ".:: %s %s has teleported you to them ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerPos(targetid, x, y, z+0.2);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:explode(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Explode])
- {
- new targetid, type, Float: radius, string[128];
- if(sscanf(params, "udf", targetid, type, radius)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /explode [playerid] [type(0-13)] [radius]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(type < 0 || type > 13) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Explosion type must must be between 0 and 13 ::.");
- new Float: x, Float: y, Float: z;
- GetPlayerPos(targetid, x, y, z);
- format(string, sizeof(string), ".:: %s %s has exploded %s [Type: %d | Radius: %.01f] ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), type, radius);
- SendClientMessageToAll(COLOR_REALRED, string);
- CreateExplosion(x, y, z, type, radius);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:setskin(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SetSkin])
- {
- new targetid, skin, string[128];
- if(sscanf(params, "ui", targetid, skin)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setskin [playerid] [skinid]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(GetPlayerSkin(targetid) == skin) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player already has that skin ::.");
- format(string, sizeof(string), ".:: You have set %s's skin to %i ::.", GetName(targetid), skin);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), ".:: %s %s has set your skin to %i ::.", GetAdminName(playerid), GetName(playerid), skin);
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerSkin(targetid, skin);
- PI[targetid][p_Skin] = skin;
- SaveAccount(targetid);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- // ----- [NEW COMMANDS IN VERSION 1.0.1.0] -----
- // ----- [NEW VIP SYSTEM COMMANDS (1.0.1.0)] -----
- CMD:vcar(playerid, params[])
- {
- if(PI[playerid][p_VIP] >= VCI[vcmd_Car])
- {
- new car, col1, col2, string[128];
- if(sscanf(params, "ddd", car, col1, col2)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vcar [modelid] [color1] [color2]");
- new rdc1 = random(25);
- new rdc2 = random(25);
- if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Vehicle model must be between 400 and 611 ::.");
- if(!col1) col1 = rdc1;
- if(!col2) col2 = rdc2;
- new Float: x, Float: y, Float: z, Float: a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- new veh = CreateVehicle(car, x, y, z, a, col1, col2, -1);
- PutPlayerInVehicle(playerid, veh, 0);
- format(string, sizeof(string), ".:: Vehicle created! [Model: %d | Color1: %d | Color2: %d] ::.", car, col1, col2);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- if(ZADMIN_VIP_ALERT == true)
- {
- format(string, sizeof(string), ".:: [VIP NOTICE]: %s just created a vehicle with model ID %d ::.", GetName(playerid), car);
- SendAdminMessage(COLOR_YELLOW, string);
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:vgun(playerid, params[])
- {
- if(PI[playerid][p_VIP] >= VCI[vcmd_Gun])
- {
- new gun, string[128];
- if(sscanf(params, "d", gun)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vgun [weaponid]");
- switch(gun)
- {
- case 38, 39, 40, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 200, 201:
- {
- SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Invalid weapon ID ::.");
- return 1;
- }
- }
- GivePlayerWeapon(playerid, gun, 999999);
- format(string, sizeof(string), ".:: Weapon created! [Weapon ID: %d] ::.", gun);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- if(ZADMIN_VIP_ALERT == true)
- {
- format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just spawned weapon ID %d ::.", GetName(playerid), gun);
- SendAdminMessage(COLOR_YELLOW, string);
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:vheal(playerid, params[])
- {
- new string[128];
- if(PI[playerid][p_VIP] >= VCI[vcmd_Heal])
- {
- format(string, sizeof(string), ".:: You have set your health and armour to 100 ::.");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- if(ZADMIN_VIP_ALERT == true)
- {
- format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just used /vheal ::.", GetName(playerid));
- SendAdminMessage(COLOR_YELLOW, string);
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:vfix(playerid, params[])
- {
- new string[128];
- if(PI[playerid][p_VIP] >= VCI[vcmd_Fix])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You must be in a vehicle to use this ::.");
- format(string, sizeof(string), ".:: Vehicle repaired! ::.");
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- new veh = GetPlayerVehicleID(playerid);
- SetVehicleHealth(veh, 1000.0);
- RepairVehicle(veh);
- if(ZADMIN_VIP_ALERT == true)
- {
- format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just used /vfix ::.", GetName(playerid));
- SendAdminMessage(COLOR_YELLOW, string);
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:vc(playerid, params[])
- {
- if(PI[playerid][p_VIP] >= VCI[vcmd_VC])
- {
- new msg[64], string[128];
- if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vc [message]");
- if(strlen(msg) <= 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a message ::.");
- foreach(Player, i)
- {
- if(IsPlayerConnected(i) && PI[i][p_VIP] >= 1 || PI[i][p_Admin] >= 1)
- {
- SendClientMessage(i, COLOR_PURPLE, string);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- // -----------------------------------------------
- CMD:freezeall(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_FreezeAll])
- {
- new string[128];
- format(string, sizeof(string), ".:: %s %s has frozen all players ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_REALRED, string);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i) && PI[i][p_Admin] != 0)
- {
- pFrozen[i] = true;
- TogglePlayerControllable(i, 0);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:unfreezeall(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_UnfreezeAll])
- {
- new string[128];
- format(string, sizeof(string), ".:: %s %s has unfrozen all players ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_REALRED, string);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i) && PI[i][p_Admin] == 0)
- {
- pFrozen[i] = true;
- TogglePlayerControllable(i, 1);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:getallhere(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_GetAllHere])
- {
- new string[128];
- format(string, sizeof(string), ".:: %s %s has teleported all players to his location ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_REALRED, string);
- new Float: x, Float: y, Float: z;
- GetPlayerPos(playerid, x, y, z);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerPos(i, x, y, z+0.2);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:kickall(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_KickAll])
- {
- new string[128];
- format(string, sizeof(string), ".:: %s %s has kicked all players ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_REALRED, string);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i) && PI[i][p_Admin] == 0)
- {
- Kick(i);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:ann(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_Ann])
- {
- new text[64], time, style, string[128];
- if(sscanf(params, "s[64]dd", text, time, style)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /ann [text] [time(ms)] [style(0-5)]");
- if(strlen(text) < 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter any text ::.");
- if(!time) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a time ::.");
- if(!style) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a style ::.");
- format(string, sizeof(string), "%s", text);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- GameTextForPlayer(i, string, time, style);
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:setcolor(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SetColor])
- {
- new targetid, color[8], string[128];
- if(sscanf(params, "us[8]", targetid, color))
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setcolor [playerid] [color]");
- SendClientMessage(playerid, COLOR_WHITE, "COLORS: White | Blue | Yellow | Orange | Purple | Grey | DarkRed | Red | Green | Cyan");
- return 1;
- }
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(strcmp(color, "white", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_WHITE"white"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_WHITE);
- }
- if(strcmp(color, "blue", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_BLUE"blue"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_BLUE);
- }
- if(strcmp(color, "yellow", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_YELLOW"yellow"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_YELLOW);
- }
- if(strcmp(color, "orange", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_ORANGE"orange"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_ORANGE);
- }
- if(strcmp(color, "purple", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_PURPLE"purple"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_PURPLE);
- }
- if(strcmp(color, "grey", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_GREY"grey"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_GREY);
- }
- if(strcmp(color, "darkred", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_RED"dark red"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_RED);
- }
- if(strcmp(color, "red", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_NICERED"red"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_REALRED);
- }
- if(strcmp(color, "green", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_GREEN"green"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_GREEN);
- }
- if(strcmp(color, "cyan", true) == 0)
- {
- format(string, sizeof(string), ".:: %s %s has set your color to "COL_CYAN"cyan"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
- SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
- SetPlayerColor(targetid, COLOR_CYAN);
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:makevip(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_MakeVIP])
- {
- new targetid, viplevel, string[128];
- if(sscanf(params, "ud", targetid, viplevel)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /makevip [playerid] [level(1-4)]");
- if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
- if(viplevel < 1 || viplevel > 4) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: VIP level must be between 1 and 4 ::.");
- format(string, sizeof(string), ".:: %s %s has set %s's VIP level to %d ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), viplevel);
- SendClientMessageToAll(COLOR_REALRED, string);
- PI[targetid][p_VIP] = viplevel;
- SaveAccount(targetid);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:gotoloc(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_GotoLoc])
- {
- new Float: x, Float: y, Float: z, Interior, VW, string[128];
- if(sscanf(params, "fffdd", x, y, z, Interior, VW)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /gotoloc [X] [Y] [Z] [INT] [VW]");
- if(!Interior) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter an interior ::.");
- if(!VW) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a virtual world ::.");
- format(string, sizeof(string), ".:: Teleported! [X: %.02f | Y: %.02f | Z: %.02f | INT: %d | VW: %d", x, y, z, Interior, VW);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
- SetPlayerPos(playerid, x, y, z);
- SetPlayerInterior(playerid, Interior);
- SetPlayerVirtualWorld(playerid, VW);
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:savecfgs(playerid, params[])
- {
- if(PI[playerid][p_Admin] >= CI[cmd_SaveCFGs])
- {
- foreach(Player, i)
- {
- if(IsPlayerConnected(i) && pLogged[i] == true)
- {
- SaveAccount(i);
- }
- }
- SaveCommands();
- SaveVIPCommands();
- foreach(Player, a)
- {
- if(IsPlayerConnected(a) && PI[a][p_Admin] >= 1)
- {
- SendClientMessage(a, COLOR_YELLOW, ".:: SERVER: All configuration files have been updated ::.");
- }
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- CMD:vipalert(playerid, params[])
- {
- new string[128];
- if(PI[playerid][p_Admin] >= CI[cmd_VIPAlert])
- {
- if(ZADMIN_VIP_ALERT == true)
- {
- format(string, sizeof(string), ".:: [VIP ALERT]: %s %s has disabled VIP alerting ::.", GetAdminName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_YELLOW, string);
- ZADMIN_VIP_ALERT = false;
- }
- else
- {
- format(string, sizeof(string), ".:: [VIP ALERT]: %s %s has enabled VIP alerting ::.", GetAdminName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_YELLOW, string);
- ZADMIN_VIP_ALERT = true;
- }
- }
- else
- {
- SendPermissionError(playerid);
- }
- return 1;
- }
- // ---------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment