Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- NAME: bAdministration
- DATE: 26/01/2014
- AUTHORIZATION: Blunt
- */
- //====================================================
- #define FILTERSCRIPT
- #include <a_samp>
- #include <ZCMD>
- #include <YSI\y_ini>
- #include <streamer>
- #include <foreach>
- #include <sscanf2>
- #include <samp_addons>
- //====================================================
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE 0xC8C8C8C8
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_YELLOW 0xDABB3E00
- #define COLOR_BLACK 0x000000AA
- #define COLOR_BLUE 0x1E90FFAA
- #define COLOR_PINK 0xFF1493AA
- #define COLOR_GREEN 0x006400AA
- #define COLOR_ORANGE 0xFF4500AA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_SILVER 0x7BDDA5AA
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COL_GREY "{AFAFAF}"
- #define COL_SILVER "{7BDDA5}"
- //====================================================
- #define PATH "/adminaccounts/%s.ini"
- #define PATH2 "/useraccounts/%s.ini"
- #define DIALOG_REGISTER 9999
- #define DIALOG_LOGIN 9998
- #define DIALOG_BUTTON_RIGHT 0
- #define DIALOG_BUTTON_LEFT 1
- #define ALTCOMMAND:%1->%2; \
- COMMAND:%1(playerid, params[]) \
- return cmd_%2(playerid, params);
- //====================================================
- enum aInfo
- {
- aAdmin,
- aLoggedOn,
- aPassword[50]
- }
- enum pInfo
- {
- pBanned,
- pBanReason[30]
- }
- //====================================================
- new AdminInfo[MAX_PLAYERS][aInfo];
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new Spectate[MAX_PLAYERS];
- new Muted[MAX_PLAYERS];
- native WP_Hash(buffer[],len,const str[]);
- //====================================================
- forward LoadUser_user(playerid,name[],value[]);
- forward LoadUser2_user(playerid,name[],value[]);
- //====================================================
- stock AdminAccountPath(playerid) // PATH
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock UserAccountPath(playerid) // PATH 2
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH2,playername);
- return string;
- }
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- }
- return Name;
- }
- ReturnUser(text[], playerid = INVALID_PLAYER_ID)
- {
- new pos = 0;
- while (text[pos] < 0x21)
- {
- if (text[pos] == 0) return INVALID_PLAYER_ID;
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos]))
- {
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS)
- {
- if(!IsPlayerConnected(userid))
- {
- userid = INVALID_PLAYER_ID;
- }
- else
- {
- return userid;
- }
- }
- }
- new len = strlen(text[pos]);
- new count = 0;
- new name[MAX_PLAYER_NAME];
- foreach (Player,i)
- {
- GetPlayerName(i, name, sizeof (name));
- if (strcmp(name, text[pos], true, len) == 0)
- {
- if (len == strlen(name))
- {
- return i;
- }
- else
- {
- count++;
- userid = i;
- }
- }
- }
- if (count != 1)
- {
- if (playerid != INVALID_PLAYER_ID)
- {
- if (count)
- {
- SendClientMessage(playerid, 0xFF0000AA, "Multiple users found, please narrow earch");
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "No matching user found");
- }
- }
- userid = INVALID_PLAYER_ID;
- }
- return userid;
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- stock TogglePlayerSpectatingEx(playerid,toggle)
- {
- Spectate[playerid] = toggle;
- return TogglePlayerSpectating(playerid, toggle);
- }
- stock DisplayLoginDialog(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Please type in your password in order to login to your admin account.", "LOG-IN", "");
- }
- stock DisplayRegisterDialog(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Please type in a password you would like to use for your admin account.", "REGISTER", "");
- }
- stock DisplayInvalidPasswordDialog(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "ADMINISTRATOR ACCOUNT", ""COL_SILVER"INFO: Invalid password. \nPlease type in the correct password for your admin account to log-in too.", "LOG-IN", "");
- }
- stock CallLogin(playerid)
- {
- new string[50];
- if(PlayerInfo[playerid][pBanned] == 1) // Checks if the player is banned
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "INFO: You have been IP banned for attempting to access a banned account.");
- format(string,sizeof(string), "BAN REASON:[ %s ]", PlayerInfo[playerid][pBanReason]);
- SendClientMessage(playerid, COLOR_WHITE, string);
- Ban(playerid);
- }
- else
- {
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have been logged into your admin account.");
- PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
- AdminInfo[playerid][aLoggedOn] = 1; // Logged in
- }
- }
- stock GetAdminLevelName(playerid)
- {
- new string[64];
- if (AdminInfo[playerid][aAdmin] == 0) string = ("None");
- if (AdminInfo[playerid][aAdmin] == 1) string = ("Un-registered Administrator");
- if (AdminInfo[playerid][aAdmin] == 2) string = ("Level 1 Moderator");
- if (AdminInfo[playerid][aAdmin] == 3) string = ("Level 2 General Administrator");
- if (AdminInfo[playerid][aAdmin] == 4) string = ("Level 3 General Administrator");
- if (AdminInfo[playerid][aAdmin] == 5) string = ("Senior Administrator");
- if (AdminInfo[playerid][aAdmin] == 6) string = ("Lead Administrator");
- return string;
- }
- stock SendAdminMessage(color,string[])
- {
- foreach (Player,i)
- {
- if(AdminInfo[i][aAdmin] > 1)
- {
- SendClientMessage(i,color,string);
- }
- }
- }
- stock WriteUserAccountData(playerid)
- {
- new INI:User = INI_Open(UserAccountPath(playerid));
- INI_SetTag(User, "data");
- INI_WriteInt(User,"Banned", 0);
- INI_WriteString(User,"BanReason","NOT BANNED");
- INI_Close(User);
- }
- stock SaveUserAccountData(playerid)
- {
- new INI:File2 = INI_Open(UserAccountPath(playerid));
- INI_SetTag(File2,"data");
- INI_WriteInt(File2,"Banned",PlayerInfo[playerid][pBanned]);
- INI_WriteString(File2,"BanReason",PlayerInfo[playerid][pBanReason]);
- INI_Close(File2);
- }
- stock SaveAdminAccountData(playerid)
- {
- new INI:File = INI_Open(AdminAccountPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Admin",AdminInfo[playerid][aAdmin]);
- INI_WriteInt(File,"LoggedOn",0);
- INI_WriteString(File,"Password",AdminInfo[playerid][aPassword]);
- INI_Close(File);
- }
- //====================================================
- public LoadUser_user(playerid,name[],value[])
- {
- INI_Int("Admin",AdminInfo[playerid][aAdmin]);
- INI_Int("LoggedOn",AdminInfo[playerid][aLoggedOn]);
- INI_String("Password",AdminInfo[playerid][aPassword], 50);
- return 1;
- }
- public LoadUser2_user(playerid,name[],value[])
- {
- INI_Int("Banned",PlayerInfo[playerid][pBanned]);
- INI_String("BanReason",PlayerInfo[playerid][pBanReason], 30);
- return 1;
- }
- //====================================================
- public OnFilterScriptInit()
- {
- print("NAME: bAdministration");
- print("DATE CREATED: 26/01/2014");
- print("FILTERSCRIPT LOADED SUCCESSFULLY");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- }
- //====================================================
- public OnPlayerSpawn(playerid)
- {
- if(fexist(AdminAccountPath(playerid))) // If admin account exists
- {
- INI_ParseFile(AdminAccountPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- SendClientMessage(playerid, COLOR_WHITE, "ADMIN: You have an existing administration account. Please use /adminlogin to log in to the account.");
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserAccountPath(playerid))) // If user account exists
- {
- INI_ParseFile(UserAccountPath(playerid), "LoadUser2_%s", .bExtra = true, .extra = playerid);
- }
- else { WriteUserAccountData(playerid); }
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(AdminInfo[playerid][aLoggedOn] == 1)
- {
- SaveAdminAccountData(playerid);
- new string[50];
- format(string,sizeof(string),"ADMIN FILE SAVED SUCCESSFULLY: [%s]", GetName(playerid));
- print(string);
- }
- SaveUserAccountData(playerid);
- new string2[50];
- format(string2,sizeof(string2),"USER FILE SAVED SUCCESSFULLY: [%s]", GetName(playerid));
- print(string2);
- }
- public OnPlayerText(playerid, text[])
- {
- if(Muted[playerid] == 1) return SendClientMessage(playerid, COLOR_GREY, "WARNING: You are currently muted and unable to speak");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_REGISTER:
- {
- switch(response)
- {
- case DIALOG_BUTTON_RIGHT: { }
- case DIALOG_BUTTON_LEFT:
- {
- new hash[50];
- WP_Hash(hash,sizeof(hash),inputtext);
- new INI:File = INI_Open(AdminAccountPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteString(File,"Password",inputtext);
- INI_WriteInt(File,"LoggedOn",0);
- INI_WriteInt(File,"Admin", 2);
- INI_Close(File);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully registered an administration account. Use /adminlogin to login.");
- new string[50];
- format(string,sizeof(string),"FILE WRITTEN SUCCESSFULLY: [%s]", GetName(playerid));
- print(string);
- }
- }
- }
- case DIALOG_LOGIN:
- {
- new hash[50];
- WP_Hash(hash,sizeof(hash),inputtext);
- switch(response)
- {
- case DIALOG_BUTTON_RIGHT: { }
- case DIALOG_BUTTON_LEFT:
- {
- if(!strcmp(hash, AdminInfo[playerid][aPassword]))
- {
- INI_ParseFile(AdminAccountPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- CallLogin(playerid);
- }
- else { DisplayInvalidPasswordDialog(playerid); }
- }
- }
- }
- }
- return 1;
- }
- //====================================================
- COMMAND:ahelp(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (AdminInfo[playerid][aAdmin] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You do not have access to this command.");
- SendClientMessage(playerid, COLOR_WHITE, "____________________________________________________________________");
- SendClientMessage(playerid, COLOR_FADE, " bADMINISTRATION COMMANDS: ");
- if(AdminInfo[playerid][aAdmin] >= 1) // UNREGISTERED ADMINS + LEVEL 1 & 2s.
- {
- SendClientMessage(playerid, COLOR_FADE, "UNREGISTERED ADMIN COMMANDS: /adminregister");
- SendClientMessage(playerid, COLOR_FADE, "UNLOGGED IN ADMIN COMMANDS: /adminlogin");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /kick /spectate /warn /checkhealth /checkarmour /checkweapons ");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /setskin /setworld /setint /setpos /setcolor /a /getid");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /gotogrove /gotols /gotosf /gotolv /gotogas /gotoelcorona");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 1 COMMANDS: /gotomotel /gotobank /mute /unmute");
- }
- if(AdminInfo[playerid][aAdmin] >= 3) // LEVEL 3
- {
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 2 COMMANDS: /ban /gethere /goto /spec /specoff /hack /shakeplayerscreen");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 2 COMMANDS: /getvehiclespeed /getvehiclehealth /getvehicleangle /getip");
- }
- if(AdminInfo[playerid][aAdmin] >= 5) // LEVEL 4
- {
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /givegun /reconnect /clearplayerchat /clearallplayerschat");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /countallplayers /countallvehicles /countallpausedplayers /removeweapon");
- SendClientMessage(playerid, COLOR_FADE, "LEVEL 3 COMMANDS: /setplayermoney /crashplayer /explodeplayer /killplayer /explodevehicle");
- }
- if(AdminInfo[playerid][aAdmin] >= 6) // LEVEL 6
- {
- SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /jetpack /disablesprunkmachines /freezeall /unfreezeall /sendaudiomessagetoall");
- SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /changeserverpassword /changeservermap /changeserverwebsite /changeservername");
- SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /countallobjects /getallplayers /countallrconadmins /countallnpcs");
- SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /sendrconmessagetoserver /sendmessagetorconadmins /setadmin /setplayercolor");
- SendClientMessage(playerid, COLOR_FADE, "LEAD ADMIN COMMANDS: /muteallplayers /unmuteallplayers /spawnvehicle /spawnobject ");
- }
- SendClientMessage(playerid, COLOR_WHITE, "____________________________________________________________________");
- return 1;
- }
- COMMAND:makemeadmin(playerid, params[])
- {
- if(IsPlayerAdmin(playerid))
- {
- AdminInfo[playerid][aAdmin] = 1;
- SendClientMessage(playerid, COLOR_SILVER, "INFO: Administration given, you can now use /adminregister to register yourself as an admin.");
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- return 1;
- }
- COMMAND:adminlogin(playerid, params[])
- {
- if(AdminInfo[playerid][aLoggedOn] == 1) { SendClientMessage(playerid, COLOR_GREY, "INFO: You have already logged into your administration account."); }
- if(fexist(AdminAccountPath(playerid))) { DisplayLoginDialog(playerid); }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- return 1;
- }
- COMMAND:adminregister(playerid, params[])
- {
- if(AdminInfo[playerid][aAdmin] >= 2) { SendClientMessage(playerid, COLOR_GREY, "INFO: You already have an existing administration account."); }
- if(AdminInfo[playerid][aAdmin] == 1) // Checks in un-registered admin
- {
- DisplayRegisterDialog(playerid);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- return 1;
- }
- COMMAND:admins(playerid, params[])
- {
- new string[128];
- SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________");
- SendClientMessage(playerid, COLOR_WHITE, " ONLINE ADMINISTRATORS ");
- new found = 0;
- foreach (Player,i)
- {
- if(AdminInfo[i][aAdmin] >= 1)
- {
- if(AdminInfo[i][aAdmin] != 5)
- {
- format(string, sizeof(string), "ONLINE: %s (%s): %s [ID: %d]", GetAdminLevelName(i), GetName(i), i);
- SendClientMessage(playerid, COLOR_FADE, string);
- }
- found++;
- }
- }
- if(found == 0)
- {
- SendClientMessage(playerid, COLOR_FADE, "INFO: No admins online.");
- }
- SendClientMessage(playerid, COLOR_WHITE, "__________________________________________________");
- return 1;
- }
- //====================================================
- /* LEVEL 1 COMMANDS */
- //====================================================
- COMMAND:mute(playerid, params[])
- {
- new string[80], targetid;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /mute [PlayerID/PartOfName]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s muted %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
- SendAdminMessage(COLOR_BLUE,string);
- Muted[targetid] = 1;
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:unmute(playerid, params[])
- {
- new string[80], targetid;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /unmute [PlayerID/PartOfName]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(Muted[targetid] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: This player is already unmuted.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s unmuted %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
- SendAdminMessage(COLOR_BLUE,string);
- Muted[targetid] = 0;
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:kick(playerid, params[])
- {
- new string[80], targetid, reason;
- if(sscanf(params, "us[80]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [PlayerID/PartOfName] [Reason]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "ADMCMD: %s %s kicked %s for reason:[%s]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), reason);
- SendClientMessageToAll(COLOR_RED, string);
- Kick(targetid);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:getid(playerid, params[])
- {
- new targetid[128],targetid2,string[128];
- if(sscanf(params, "s[128]", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /getid [playerid/PartOfName]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- targetid2 = ReturnUser(targetid);
- if(IsPlayerConnected(targetid2))
- {
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string, sizeof(string), "ID: (%d) %s",targetid2,GetName(playerid));
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- }
- return 1;
- }
- COMMAND:a(playerid, params[])
- {
- new message[128],string[128];
- if(sscanf(params, "s[128]", message)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [ADMINISTRATION CHAT]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string, sizeof(string), "*ADMCHAT: %s %s: %s *", GetAdminLevelName(playerid), GetName(playerid), message);
- SendAdminMessage(COLOR_BLUE, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:checkhealth(playerid, params[])
- {
- new targetid,string[128];
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkhealth [playerid]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- new Float:shealth;
- GetPlayerHealth(targetid,shealth);
- format(string, sizeof(string), "INFO: %s Health is: %.2f.", GetName(targetid),shealth);
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:checkarmour(playerid, params[])
- {
- new targetid,string[128];
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkarmour [playerid]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- new Float:shealth;
- GetPlayerArmour(targetid,shealth);
- format(string, sizeof(string), "INFO: %s Armour is: %.2f.", GetName(targetid),shealth);
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:checkweapons(playerid, params[])
- {
- new targetid,string[128];
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /checkweapons [playerid]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- new sweapon, sammo;
- format(string, sizeof(string), "%s has the following weapons:", GetName(targetid));
- SendClientMessage(playerid, COLOR_GREY, string);
- for (new i=0; i<9; i++)
- {
- GetPlayerWeaponData(targetid, i, sweapon, sammo);
- if(sweapon != 0)
- {
- format(string, sizeof(string), "%d: %d (%d)", i, sweapon, sammo);
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- }
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:gotols(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),1529.6,-1691.2,13.3);
- }
- else
- {
- SetPlayerPos(playerid,1529.6,-1691.2,13.3);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotolv(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),1699.2, 1435.1, 10.7);
- }
- else
- {
- SetPlayerPos(playerid,1699.2, 1435.1, 10.7);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotosf(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),-1417.0,-295.8,14.1);
- }
- else
- {
- SetPlayerPos(playerid,-1417.0,-295.8,14.1);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotogas(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),1943.5698,-1771.3066,19.5250);
- }
- else
- {
- SetPlayerPos(playerid,1943.5698,-1771.3066,19.5250);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotoelcorona(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),1908.7719,-2020.0188,13.5469);
- }
- else
- {
- SetPlayerPos(playerid,1908.7719,-2020.0188,13.5469);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotogrove(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),2529.5720,-1667.7911,15.1690);
- }
- else
- {
- SetPlayerPos(playerid,2529.5720,-1667.7911,15.1690);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotomotel(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),2196.0056,-1139.6841,38.1016);
- }
- else
- {
- SetPlayerPos(playerid,2196.0056,-1139.6841,38.1016);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gotobank(playerid, params[])
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehiclePos(GetPlayerVehicleID(playerid),1448.1796,-1010.7741,26.8438);
- }
- else
- {
- SetPlayerPos(playerid,1448.1796,-1010.7741,26.8438);
- SetPlayerInterior(playerid,0);
- SetPlayerVirtualWorld(playerid,0);
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:setskin(playerid, params[])
- {
- new type, targetid, string[40];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setskin [PlayerID/PartOfName] [Skin ID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- if(type < 0 || type > 299) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot use IDs under 0 or over 299");
- format(string,sizeof(string), "AdmCMD: %s %s has set %s to SKIN-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE, string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: Skin ID has been changed by an Administrator.");
- SetPlayerSkin(targetid, type);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
- }
- return 1;
- }
- COMMAND:setworld(playerid, params[])
- {
- new type, targetid, string[40];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setworld [PlayerID/PartOfName] [World ID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- if(type < 0 || type > 1000) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot use IDs under 0 or over 1000");
- format(string,sizeof(string), "AdmCMD: %s %s has set %s to WORLD-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE, string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: World ID has been changed by an Administrator.");
- SetPlayerVirtualWorld(targetid, type);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
- }
- return 1;
- }
- COMMAND:setint(playerid, params[])
- {
- new type, targetid, string[40];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setint [PlayerID/PartOfName] [Interior ID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s has set %s to INTERIOR-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE, string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: Interior ID has been changed by an Administrator.");
- SetPlayerVirtualWorld(targetid, type);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
- }
- return 1;
- }
- COMMAND:setpos(playerid, params[])
- {
- new typeX, typeY, typeZ, targetid, string[40];
- if(sscanf(params, "ufff", targetid, typeX, typeY, typeZ)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setpos [PlayerID/PartOfName] [Coord X] [Coord Y] [Coord Z]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s has set %s's COORDINATES to: X:[%d] Y:[%d] Z:[%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), typeX, typeY, typeZ);
- SendAdminMessage(COLOR_BLUE, string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: Position has been changed by an Administrator.");
- SetPlayerPos(targetid, typeX, typeY, typeZ);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command."); }
- }
- return 1;
- }
- //====================================================
- /* LEVEL 2 COMMANDS */
- //====================================================
- COMMAND:shakeplayerscreen(playerid, params[])
- {
- new targetid, time, string[60];
- if(sscanf(params, "ui", targetid, time)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /shakeplayerscreen [PlayerID/PartOfName] [time]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- format(string,sizeof(string), "AdmCMD: %s %s has shaken %s's screen for time: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), time);
- SendAdminMessage(COLOR_BLUE, string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: Youre screen has begun to shake. Reason:[Administrative command]");
- ShakePlayerScreen(targetid, time);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:getvehiclespeed(playerid, params[])
- {
- new vehicleid, string[50];
- if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehiclespeed [VehicleID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- GetVehicleSpeed(vehicleid);
- format(string,sizeof(string), "INFO: Vehicle speed. (VEHICLE ID:[%d] SPEED:[%d])",vehicleid, GetVehicleSpeed(vehicleid));
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:getvehicleangle(playerid, params[])
- {
- new vehicleid, string[50];
- if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehicleangle [VehicleID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- format(string,sizeof(string), "INFO: Vehicle angle. (VEHICLE ID:[%d] ANGLE:[%d])", vehicleid, GetVehiclesAngle(vehicleid));
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:getvehiclehealth(playerid, params[])
- {
- new vehicleid, string[50];
- if(sscanf(params, "u", vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /getvehiclehealth [VehicleID]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- format(string,sizeof(string), "INFO: Vehicle angle. (VEHICLE ID:[%d] HEALTH:[%d])",vehicleid, GetVehiclesHealth(vehicleid));
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:ban(playerid, params[])
- {
- new string[80], targetid, reason;
- if(sscanf(params, "us[80]", targetid, reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [PlayerID/PartOfName] [Reason]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- format(string,sizeof(string), "ADMCMD: %s %s banned %s for reason:[%s]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), reason);
- SendClientMessageToAll(COLOR_RED, string);
- SendClientMessage(targetid, COLOR_WHITE, "SERVER: You have been banned from this server.");
- PlayerInfo[targetid][pBanned] = 1;
- Kick(targetid);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:getip(playerid, params[])
- {
- new string[80], targetid;
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [PlayerID/PartOfName]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "INFO: Invalid player ID or PartOfName.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- format(string,sizeof(string), "INFO: %s(IP:[%s])", GetName(targetid),GetPlayersIP(targetid));
- SendClientMessage(targetid, COLOR_GREY, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- }
- return 1;
- }
- COMMAND:hack(playerid, params[])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /hack [playerid]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- new Float:health;
- GetPlayerHealth(targetid,health);
- SetPlayerHealth(targetid,health-1.0);
- SendClientMessage(playerid,COLOR_YELLOW,"INFO: Players health has been -1 down.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- COMMAND:spec(playerid, params[])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /spec [playerid]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- Spectate[playerid] = 0;
- if (IsPlayerInAnyVehicle(targetid))
- {
- TogglePlayerSpectatingEx(playerid, 1);
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
- SetPlayerInterior(playerid,GetPlayerInterior(targetid));
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
- }
- else
- {
- TogglePlayerSpectatingEx(playerid, 1);
- PlayerSpectatePlayer(playerid, targetid);
- SetPlayerInterior(playerid,GetPlayerInterior(targetid));
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- COMMAND:specoff(playerid, params[])
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- TogglePlayerSpectatingEx(playerid, 0);
- SetPlayerPos(playerid,1642.2334,-2240.4983,13.4952);
- SetPlayerFacingAngle(playerid, 0);
- SetPlayerInterior(playerid,0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:gethere(playerid, params[])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /gethere [playerid]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- SetPlayerPos(targetid,x,y,z);
- SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(targetid,GetPlayerInterior(playerid));
- SendClientMessage(targetid,COLOR_GREY,"INFO: You have been teleported.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- COMMAND:goto(playerid, params[])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /goto [playerid]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 3)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(targetid,x,y,z);
- SetPlayerPos(playerid,x,y,z);
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
- SetPlayerInterior(playerid,GetPlayerInterior(targetid));
- SendClientMessage(playerid,COLOR_GREY,"INFO: You have been teleported.");
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- //====================================================
- /* LEVEL 3 COMMANDS */
- //====================================================
- COMMAND:givegun(playerid, params[])
- {
- new targetid,type,type2,string[128];
- if(sscanf(params, "uii", targetid, type, type2)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 50) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
- if(type2 < 0 || type2 > 9999) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 9999.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- GivePlayerWeapon(targetid,type,type2);
- format(string, sizeof(string),"AdmCmd: %s %s has given %s weapon id: %d with %d bullets", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type, type2);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- COMMAND:givecash(playerid, params[])
- {
- new targetid;
- new type;
- new string[256];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecash [playerid] [amount]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
- if(type < 0 || type > 10000) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Cannot go under $0 or above $10,000.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- GivePlayerMoney(targetid, type);
- format(string, sizeof(string), "AdmCMD: %s has given %s $%i", GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE, string);
- format(string, sizeof(string), "SERVER: %s has given you $%i", GetName(playerid), type);
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:killplayer(playerid, params[])
- {
- new targetid,string[60];
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /killplayer [PlayerID/PartOfName]");
- else
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string), "AdmCMD: %s %s has force killed %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
- SendAdminMessage(COLOR_BLUE, string);
- SetPlayerHealth(targetid, 0);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:removeweapon(playerid, params[])
- {
- new type,targetid,string[60];
- if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /removeweapon [PlayerID/PartOfName] [Weapon ID]");
- else
- {
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Sorry this player is not currently connected");
- if(type < 0 || type > 80) return SendClientMessage(playerid, COLOR_FADE, "SERVER: Cannot go under 1 or over 80");
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string), "AdmCMD: %s %s has removed WEAPON-ID:[%d] from %s", GetAdminLevelName(playerid), GetName(playerid), type, GetName(targetid));
- SendAdminMessage(COLOR_BLUE, string);
- RemovePlayerWeapon(targetid,type);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:crashplayer(playerid, params[])
- {
- new targetid,string[128];
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /crashplayer [PlayerID/PartOfName]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- CrashPlayer(targetid);
- format(string, sizeof(string),"AdmCMD: %s %s has force crashed %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
- SendAdminMessage(COLOR_BLUE,string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: You have been force crashed by an Administrator.");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:explodeplayer(playerid, params[])
- {
- new targetid,string[128];
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /explodeplayer [PlayerID/PartOfName]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- ExplodePlayer(targetid);
- format(string, sizeof(string),"AdmCMD: %s %s has exploded %s", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid));
- SendAdminMessage(COLOR_BLUE,string);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: You have been exploded by an Administrator.");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:explodevehicle(playerid, params[])
- {
- new vehicleid,string[128];
- if(sscanf(params, "u", vehicleid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /explodevehicle [PlayerID/PartOfName]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- ExplodeVehicle(vehicleid);
- format(string, sizeof(string),"AdmCMD: %s %s has exploded VEHICLE-ID:[%d]", GetAdminLevelName(playerid), GetName(playerid), vehicleid);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:setplayermoney(playerid, params[])
- {
- new targetid,type,string[128];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerarmour [PlayerID/PartOfName] [Armour]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- SetPlayerMoney(targetid, type);
- format(string, sizeof(string),"AdmCMD: %s %s has set %s's MONEY to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:countallplayers(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string), "INFO: There is currently %d players on the server.", CountTotalPlayers());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:countallvehicles(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string), "INFO: There is currently %d vehicles on the server.", CountTotalVehicles());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:countallpausedplayers(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string), "INFO: There is currently %d vehicles on the server.", CountTotalPausedPlayers());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:clearplayerchat(playerid, params[])
- {
- new targetid;
- if(sscanf(params, "u", targetid)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /clearplayerchat [PlayerID/PartOfName]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- ClearPlayersChat(targetid);
- SendClientMessage(targetid, COLOR_WHITE, "INFO: Your chat has been cleared by an Administrator.");
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have cleared that players chat box.");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:clearallplayerchat(playerid, params[])
- {
- new string[80];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string),"AdmCMD: %s %s has cleared all player chat boxes.");
- SendClientMessageToAll(COLOR_WHITE, string);
- foreach(Player, i)
- {
- ClearPlayersChat(i);
- }
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:setplayerhealth(playerid, params[])
- {
- new targetid,type,string[128];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerhealth [PlayerID/PartOfName] [Health]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- SetPlayerHealth(targetid, type);
- format(string, sizeof(string),"AdmCMD: %s %s has set %s's HEALTH to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:setplayerarmour(playerid, params[])
- {
- new targetid,type,string[128];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayerarmour [PlayerID/PartOfName] [Armour]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 100) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 50.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- SetPlayerArmour(targetid, type);
- format(string, sizeof(string),"AdmCMD: %s %s has set %s's ARMOUR to: [%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- //====================================================
- /* LEVEL 4 COMMANDS */
- //====================================================
- COMMAND:getallplayers(playerid, params[])
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid,x,y,z);
- foreach(Player, i)
- {
- SetPlayerPos(i, x, y, z);
- SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
- SetPlayerInterior(i,GetPlayerInterior(playerid));
- SendClientMessage(i,COLOR_GREY,"INFO: You have been teleported.");
- }
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- return 1;
- }
- COMMAND:countallrconadmins(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- format(string,sizeof(string), "INFO: There is currently %d RCON Administrators online.", CountTotalRCONAdmins());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:countallnps(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- format(string,sizeof(string), "INFO: There is currently %d NPCs on the server.", CountTotalNPCs());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:countallobjects(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- format(string,sizeof(string), "INFO: There is currently %d objects on the server.", CountTotalObjects());
- SendClientMessage(playerid, COLOR_GREY, string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:sendrconmessagetoserver(playerid, params[])
- {
- new message[60];
- if(sscanf(params,"s[60]", message)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendrconmessagetoserver [SERVER MESSAGE]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- SendServerRCONMessage(message);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:sendmessagetorconadmins(playerid, params[])
- {
- new message[60];
- if(sscanf(params,"s[60]", message)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendmessagetorconadmins [MESSAGE]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- SendMessageToRCONAdmins(COLOR_SILVER,message);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:changeservername(playerid, params[])
- {
- new newservername[60];
- if(sscanf(params,"s[60]", newservername)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeservername [SERVER NAME]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- ChangeServerName(newservername);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server password.");
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:changeserverpassword(playerid, params[])
- {
- new newpassword[60];
- if(sscanf(params,"s[60]", newpassword)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeserverpassword [PASSWORD]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- ChangeServerPassword(newpassword);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server password.");
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:changeservermap(playerid, params[])
- {
- new newmap[60];
- if(sscanf(params,"s[60]", newmap)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeservermap [MAP NAME]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- ChangeMapName(newmap);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server map name.");
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:changeserverwebsite(playerid, params[])
- {
- new newwebsite[60];
- if(sscanf(params,"s[60]", newwebsite)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeserverwebsite [WEBSITE URL]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- ChangeServerWebsite(newwebsite);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: You have successfully changed the server map name.");
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:sendaudiomessagetoall(playerid, params[])
- {
- new audiomessage[60], string[60];
- if(sscanf(params,"s[60]", audiomessage)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /sendaudiomessagetoall [MESSAGE]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- foreach(Player, i)
- {
- SendClientAudioMessage(i, audiomessage, false, -1, "en");
- }
- format(string,sizeof(string),"AdmCMD: %s %s has sent an audio-message to all clients in the server. MESSAGE:[%s]", GetAdminLevelName(playerid), GetName(playerid), audiomessage);
- SendAdminMessage(COLOR_BLUE, string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- }
- return 1;
- }
- COMMAND:freezeall(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- foreach(Player, i)
- {
- TogglePlayerControllable(i, false);
- }
- format(string, sizeof(string),"AdmCMD: %s %s has froze all players in the server.", GetAdminLevelName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE,string);
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command"); }
- return 1;
- }
- COMMAND:unfreezeall(playerid, params[])
- {
- new string[60];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- foreach(Player, i)
- {
- TogglePlayerControllable(i, true);
- }
- format(string, sizeof(string),"AdmCMD: %s %s has un-froze all players in the server.", GetAdminLevelName(playerid), GetName(playerid));
- SendClientMessageToAll(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:jetpack(playerid, params[])
- {
- new string[70];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- GivePlayerJetpack(playerid);
- format(string, sizeof(string),"AdmCMD: %s %s has been given a JETPACK.", GetAdminLevelName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:disablesprunkmachines(playerid, params[])
- {
- new string[70];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- DisableSprunkMachines();
- format(string, sizeof(string),"AdmCMD: %s %s has destroyed all spunk machines in the server.", GetAdminLevelName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_BLUE,string);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: All sprunk machines have been destroyed. Restart the server to get them back.");
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- return 1;
- }
- COMMAND:setadmin(playerid, params[])
- {
- new targetid,type,string[128], string2[128];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setadmin [PlayerID/PartOfName] [0-5]");
- else
- {
- if (AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if (!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 5) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 or above 5.");
- if(AdminInfo[playerid][aAdmin] >= 5)
- {
- SendClientMessage(playerid, COLOR_WHITE, "INFO: Administration level set.");
- format(string2, sizeof(string2),"INFO: %s %s has set your admin level to %d", GetAdminLevelName(playerid), GetName(playerid), type);
- SendClientMessage(COLOR_WHITE,targetid, string2);
- AdminInfo[targetid][aAdmin] = type;
- format(string, sizeof(string),"AdmCMD: %s %s has set %s's ADMIN-LEVEL:[%d]", GetAdminLevelName(playerid), GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE,string);
- }
- else SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command");
- }
- return 1;
- }
- COMMAND:setplayercolor(playerid, params[])
- {
- new targetid, type, string[128];
- if(sscanf(params, "ui", targetid, type)) SendClientMessage(playerid, COLOR_GREY, "USAGE: /setplayercolor [PlayerID/PartOfName] [color 0-10]");
- else
- {
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must be logged in to use this.");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "SERVER: This player is not connected.");
- if(type < 0 || type > 10) return SendClientMessage(playerid, COLOR_GREY, "SERVER: Cannot go under 0 and over 10.");
- if(AdminInfo[playerid][aAdmin] >= 4)
- {
- format(string,sizeof(string),"AdmCMD: %s %s has set %s's COLOR-ID:[%d]", GetAdminLevelName(playerid),GetName(playerid), GetName(targetid), type);
- SendAdminMessage(COLOR_BLUE, string);
- SetPlayerColor(targetid, type);
- format(string, sizeof(string), "INFO: You have set %s[%d]'s color to ID: %d", GetName(targetid), targetid, type);
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "INFO: Admin %s has set your name color to ID: %d", GetName(playerid), type);
- SendClientMessage(targetid, COLOR_WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You do not have access to this command.");
- }
- }
- return 1;
- }
- COMMAND:muteallplayers(playerid, params[])
- {
- new string[80];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s muted all players", GetAdminLevelName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_BLUE,string);
- foreach (Player, i)
- {
- Muted[i] = 1;
- }
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- return 1;
- }
- COMMAND:unmuteallplayers(playerid, params[])
- {
- new string[80];
- if(AdminInfo[playerid][aLoggedOn] == 0) return SendClientMessage(playerid, COLOR_GREY, "INFO: You are not logged into your administator account, therefore you do not have access to this command.");
- if(AdminInfo[playerid][aAdmin] >= 2)
- {
- format(string,sizeof(string), "AdmCMD: %s %s un-muted all players", GetAdminLevelName(playerid), GetName(playerid));
- SendAdminMessage(COLOR_BLUE,string);
- foreach (Player, i)
- {
- Muted[i] = 0;
- }
- }
- else { SendClientMessage(playerid, COLOR_LIGHTRED, "WARNING: You are not authorized to use this command."); }
- return 1;
- }
- COMMAND:spawnvehicle(playerid, params[])
- {
- new string[70], type, color;
- if(sscanf(params, "ii", type, color)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnvehicle [Vehicle ID] [Color ID]");
- else
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x, y, z);
- format(string, sizeof(string), "AdmCMD: %s %s has spawned VEHICLE-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), type);
- SendAdminMessage(COLOR_BLUE, string);
- CreateVehicle(type, x, y, z, 0, color, 0, 0);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: Administrator vehicle created.");
- }
- return 1;
- }
- COMMAND:spawnobject(playerid, params[])
- {
- new string[70], type;
- if(sscanf(params, "i", type)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /spawnobject [Object ID]");
- else
- {
- new Float:x,Float:y,Float:z,Float:angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- format(string, sizeof(string), "AdmCMD: %s %s has spawned OBJECT-ID: [%d]", GetAdminLevelName(playerid), GetName(playerid), type);
- SendAdminMessage(COLOR_BLUE, string);
- CreateDynamicObject(type, x,y,z,angle,angle,angle, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 200.0);
- SendClientMessage(playerid, COLOR_WHITE, "INFO: Administrator object created.");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment