Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ^ +--- ^ ^
- / \ | | |\ /|
- /___\ | | | \ / |
- / \ +--- | V |
- Admin Menu
- ______________________________________
- Created by: Hellhound(C)2011
- Correct Version: v1.2
- Special Thanks:
- BlueDarco, matraka, Kalcor
- License:
- 1. Do not remove Credits / Claim the Script as your own / Re-release without my (Hellhound) permission* / Sell it
- 2. Do not use that script for any Bad / Offensive / Evil / Wicked / Unkind Reasons.
- * You are not allowed to change *Command Engine* / *Streaming Engine* / *File/INI Engine* / *Audio Engine* and Re-Realese.
- If you agree those rules Change the '0' to '1': */
- new Agree = 1;
- /* If you Agreed, You are free to use that filterscript as long as you follow the License
- Have a nice day, Hellhound */
- #include <a_samp>
- #include <dutils>
- #include <Dini>
- #include <cpstream>
- #define Green 0x33FF3300
- #define Green_dark 0x33AA3300
- #define Cyan 0x33CCCC00
- #define Blue 0x3300FF00
- #define Red 0xFF000000
- #define White 0xFFFFFF00
- #define Black 0x00000000
- #define Gray 0x99999900
- #define Yellow 0xFFFF0000
- #define Gold 0xFFCC0000
- #define Error 0x99000000
- #pragma unused ret_memcpy
- #define Spawn_Delay 60000 /* Time for the created vehicles to respawn if there in no Driver */
- /**********************************************/
- /******** DONT TOUCH THOSE DEFINES ************/
- #define Dialog_Kick_ID 1 /***/
- #define Dialog_Kill_ID 2 /***/
- #define Dialog_Car 3 /***/
- #define Dialog_Car_Color 4 /***/
- #define Dialog_Car_Mods 5 /***/
- #define Dialog_CheckP 6 /***/
- #define Dialog_CheckP_D 7 /***/
- #define Dialog_PickUp 8 /***/
- #define Dialog_PickUp_D 9 /***/
- #define Dialog_Fill 10 /***/
- #define Dialog_God 11 /***/
- #define Dialog_Freeze 12 /***/
- #define Dialog_UnFreeze 13 /***/
- #define Dialog_Slap 14 /***/
- #define Dialog_TPto 15 /***/
- #define Dialog_TPu 16 /***/
- #define Dialog_Make_Adm 17 /***/
- #define Dialog_Remove_Adm 18 /***/
- #define Dialog_Adm_List 19 /***/
- #define Dialog_Say 20 /***/
- /***/
- #define MapIcon_CheckP 99 /***/
- /**********************************************/
- /**********************************************/
- new pt;
- new ptEx = 0;
- new pu;
- new Text3D:put;
- new puEx = 0;
- public OnFilterScriptInit()
- {
- #if !defined Agree
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- print("ADM - Add 'new Agree = 1;' in the script");
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- SendRconCommand("exit");
- #endif
- #if defined Agree
- if(Agree == 0)
- {
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- print(" ADM ");
- print(" ");
- print("You didn't agreed the License, Find 'new Agree = 0' and change it to '1'");
- print("GAMEMODE - EXITING");
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- SendRconCommand("exit");
- }
- if(Agree == 1)
- {
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- print("ADM Loaded - By 'Hellhound'");
- print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- }
- #endif
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- 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[])
- {
- new cmd[256], idx;
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/Adm", true) == 0)
- {
- if(!IsAdm(playerid) || !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
- new AdmInfo[500];
- format(AdmInfo, sizeof(AdmInfo), "{FF0000}Kick a Player\n{FF0000}Kill a Player\n{33FF33}Create Vehicle\n{33FF33}Change Vehicle Colour\n{33FF33}Vehicle Mods\n{33FF33}Create Point\n{FF0000}Destroy Point\n{33FF33}Create PickUp-Text\n{FF0000}Destroy PickUp-Text\n{33FF33}100% Health and Armor\n{33FF33}God-Mode\n{FF0000}Freeze\n{33FF33}UnFreeze\n{FF0000}Slap\n{33FF33}Teleport to player\n{33FF33}Teleport to you\n{33CCCC}Make Admin\n{33CCCC}Remove Admin\n{33FF33}Admin List\n{33FF33}Say / Announce");
- ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "{FF0000}Ad{FFFFFF}min {FF0000}M{FFFFFF}enu", AdmInfo, "Action", "Cancel");
- return 1;
- }
- 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[])
- {
- if(dialogid == 0)
- {
- if(!response) return 0;
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, Dialog_Kick_ID, DIALOG_STYLE_INPUT, "{FF0000}Kick a Player", "Choose player ID", "Kick", "Cancel");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, Dialog_Kill_ID, DIALOG_STYLE_INPUT, "{FF0000}Kill a Player", "Choose player ID", "Kill", "Cancel");
- return 1;
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid, Dialog_Car, DIALOG_STYLE_INPUT, "{FF0000}Create Vehicle", "Choose Vehicle ID", "Create", "Cancel");
- return 1;
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, Dialog_Car_Color, DIALOG_STYLE_INPUT, "{FF0000}Set Vehicle Color", "Choose Vehicle Color ID", "Change", "Cancel");
- return 1;
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, Dialog_Car_Mods, DIALOG_STYLE_LIST, "{FF0000}Set Vehicle Mods", "{FFFF00}Gold Rims\n{FF0000}Nitro\n{33FF33}Hydraulics", "Add", "Cancel");
- return 1;
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid, Dialog_CheckP, DIALOG_STYLE_MSGBOX, "{FF0000}Create Point", "{FFFF00}Are you sure you want to Create a Point?\n{FF0000}NOTE: The Point will be created in the Place you are correcly Standing.", "Create", "Cancel");
- return 1;
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid, Dialog_CheckP_D, DIALOG_STYLE_MSGBOX, "{FF0000}Destroy Point", "{FFFF00}Are you sure you want to Destroy a Point?", "Destroy", "Cancel");
- return 1;
- }
- if(listitem == 7)
- {
- ShowPlayerDialog(playerid, Dialog_PickUp, DIALOG_STYLE_INPUT, "{FF0000}Create PickUp-Text", "{FFFF00}Are you sure you want to Create a PickUp-Text?\n{FF0000}NOTE: The PiccUp-Text will be created in the Place you are correcly Standing.\n\n{33FF33}Write down the text that will be in the PickUp-Text", "Create", "Cancel");
- return 1;
- }
- if(listitem == 8)
- {
- ShowPlayerDialog(playerid, Dialog_PickUp_D, DIALOG_STYLE_MSGBOX, "{FF0000}Destroy PickUp-Text", "{FFFF00}Are you sure you want to Destroy a PickUp-Text?", "Destroy", "Cancel");
- return 1;
- }
- if(listitem == 9)
- {
- ShowPlayerDialog(playerid, Dialog_Fill, DIALOG_STYLE_INPUT, "{FF0000}100 Health and Armour", "{FFFF00}Choose player ID to Fill him with:\n\n{33CCCC}* {FFFFFF}100 Health\n\n{33CCCC}* {FFFFFF}100 Armour", "Process", "Cancel");
- return 1;
- }
- if(listitem == 10)
- {
- ShowPlayerDialog(playerid, Dialog_God, DIALOG_STYLE_INPUT, "{FF0000}God-Mode", "{FFFF00}Choose player ID to give him God-Mode", "Process", "Cancel");
- return 1;
- }
- if(listitem == 11)
- {
- ShowPlayerDialog(playerid, Dialog_Freeze, DIALOG_STYLE_INPUT, "{FF0000}Freeze", "{FFFF00}Choose player ID to freeze", "Freeze", "Cancel");
- return 1;
- }
- if(listitem == 12)
- {
- ShowPlayerDialog(playerid, Dialog_UnFreeze, DIALOG_STYLE_INPUT, "{FF0000}UnFreeze", "{FFFF00}Choose player ID to unfreeze", "UnFreeze", "Cancel");
- return 1;
- }
- if(listitem == 13)
- {
- ShowPlayerDialog(playerid, Dialog_Slap, DIALOG_STYLE_INPUT, "{FF0000}Slap", "{FFFF00}Choose player ID to slap", "Slap", "Cancel");
- return 1;
- }
- if(listitem == 14)
- {
- ShowPlayerDialog(playerid, Dialog_TPto, DIALOG_STYLE_INPUT, "{FF0000}Teleport to player", "{FFFF00}Choose player ID to teleport to his location.", "Teleport", "Cancel");
- return 1;
- }
- if(listitem == 15)
- {
- ShowPlayerDialog(playerid, Dialog_TPu, DIALOG_STYLE_INPUT, "{FF0000}Teleport to you", "{FFFF00}Choose player ID to teleport to you.", "Teleport", "Cancel");
- return 1;
- }
- if(listitem == 16)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
- ShowPlayerDialog(playerid, Dialog_Make_Adm, DIALOG_STYLE_INPUT, "{FF0000}Make Admin", "{FFFF00}Choose player ID to Make Admin", "Promote", "Cancel");
- return 1;
- }
- if(listitem == 17)
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
- ShowPlayerDialog(playerid, Dialog_Remove_Adm, DIALOG_STYLE_INPUT, "{FF0000}Remove Admin", "{FFFF00}Choose player ID to Remove Admin", "Remove", "Cancel");
- return 1;
- }
- if(listitem == 18)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- new DInfo[500];
- if(IsAdm(i) || IsPlayerAdmin(i))
- {
- new Admins[128], pName[128];
- GetPlayerName(i, pName, sizeof(pName));
- new AdmStr[128];
- if(IsPlayerAdmin(i) && IsAdm(i))
- {
- AdmStr = "{FF0000}RCON {33CCCC}Admin";
- }
- if(IsPlayerAdmin(i) && !IsAdm(i))
- {
- AdmStr = "{FF0000}RCON {33CCCC}Admin {FFFFFF}[{33FF33}Off-Duty{FFFFFF}]";
- }
- if(IsAdm(i) && !IsPlayerAdmin(i))
- {
- AdmStr = "{33FF33}Regular {33CCCC}Admin";
- }
- format(Admins, sizeof(Admins), "%s: {FFFF00}%s\n",AdmStr,pName);
- format(DInfo, sizeof(DInfo), "{33AA33}Admins Online:\n\n%s", Admins);
- }
- ShowPlayerDialog(playerid, Dialog_Adm_List, DIALOG_STYLE_MSGBOX, "{FF0000}Admin List", DInfo, "Close", "");
- }
- return 1;
- }
- if(listitem == 19)
- {
- ShowPlayerDialog(playerid, Dialog_Say, DIALOG_STYLE_INPUT, "{FF0000}Say", "{FFFF00}Write down Announce Text:", "Send", "Cancel");
- return 1;
- }
- }
- if(dialogid == Dialog_Kick_ID)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been kicked by %s", pN, aN);
- SendClientMessageToAll(White, str);
- Kick(strval(inputtext));
- return 1;
- }
- if(dialogid == Dialog_Kill_ID)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been killed by %s", pN, aN);
- SendClientMessageToAll(White, str);
- SetPlayerHealth(strval(inputtext), 0.0);
- return 1;
- }
- if(dialogid == Dialog_Car)
- {
- if(!response) return 0;
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You can't create a Vehicle while in Vehicle");
- if(strval(inputtext) < 400 || strval(inputtext) > 611) return SendClientMessage(playerid, Red, "Invalid Vehicle ID");
- new Float:X,Float:Y,Float:Z,Float:A;
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerFacingAngle(playerid, A);
- new Veh;
- Veh = AddStaticVehicleEx ( strval(inputtext), X, Y, Z, A, 0, 0, Spawn_Delay );
- PutPlayerInVehicle(playerid, Veh, 0);
- SendClientMessage(playerid, White, "{33FF33}Car Created");
- return 1;
- }
- if(dialogid == Dialog_Car_Color)
- {
- if(!response) return 0;
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You need to be in vehicle");
- if(strval(inputtext) < 0 || strval(inputtext) > 126) return SendClientMessage(playerid, Red, "Invalid Vehicle Color ID");
- ChangeVehicleColor(GetPlayerVehicleID(playerid), strval(inputtext), strval(inputtext));
- SendClientMessage(playerid, White, "{FFFF00}Car Color Changed.");
- return 1;
- }
- if(dialogid == Dialog_Car_Mods)
- {
- if(!response) return 0;
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Red, "You need to be in vehicle");
- if(listitem == 0)
- {
- SendClientMessage(playerid, White, "{FFFF00}Gold Rims{FFFFFF} Added!");
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid, White, "{FF0000}Nitro{FFFFFF} Added!");
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- return 1;
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid, White, "{33FF33}Hydraulics{FFFFFF} Added!");
- AddVehicleComponent(GetPlayerVehicleID(playerid), 1087);
- return 1;
- }
- return 1;
- }
- if(dialogid == Dialog_CheckP)
- {
- if(!response) return 0;
- if(ptEx == 1) return SendClientMessage(playerid, Red, "A checkpoint already exists, Destroy it first.");
- new Float:X,Float:Y,Float:Z;
- new pname[128], str[128];
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Created a point at %f, %f, %f", pname, X,Y,Z);
- SendClientMessageToAll(White, str);
- pt = CPS_AddCheckpoint(X,Y,Z,3,40);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SetPlayerMapIcon( i, MapIcon_CheckP, X, Y, Z, 33, 0, MAPICON_GLOBAL );
- }
- ptEx = 1;
- return 1;
- }
- if(dialogid == Dialog_CheckP_D)
- {
- if(!response) return 0;
- if(ptEx == 0) return SendClientMessage(playerid, Red, "There are no points to be destroyed");
- new pname[128], str[128];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Destroyed the Existing point", pname);
- SendClientMessageToAll(White, str);
- CPS_RemoveCheckpoint(pt);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- RemovePlayerMapIcon( i, MapIcon_CheckP );
- }
- ptEx = 0;
- return 1;
- }
- if(dialogid == Dialog_PickUp)
- {
- if(!response) return 0;
- if(puEx == 1) return SendClientMessage(playerid, Red, "A PickUp-Text already exists, Destroy it first.");
- puEx = 1;
- new Float:X,Float:Y,Float:Z;
- new pname[128], str[128], txtP[128];
- GetPlayerPos(playerid, X,Y,Z);
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Created a PickUp-Text at %f, %f, %f", pname, X,Y,Z);
- SendClientMessageToAll(White, str);
- pu = CreatePickup(1239, 1, X, Y, Z, GetPlayerVirtualWorld(playerid));
- format(txtP, sizeof(txtP), "{FF0000}%s\n{33FF33}- PickUp-Text", inputtext);
- put = Create3DTextLabel(txtP,Yellow,X,Y,Z,40.0,GetPlayerVirtualWorld(playerid), 1);
- return 1;
- }
- if(dialogid == Dialog_PickUp_D)
- {
- if(!response) return 0;
- if(puEx == 0) return SendClientMessage(playerid, Red, "There are no PickUp-Texts to be destroyed");
- puEx = 0;
- new pname[128], str[128];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}Admin %s, Destroyed the Existing PickUp-Text", pname);
- SendClientMessageToAll(White, str);
- Delete3DTextLabel(put);
- DestroyPickup(pu);
- return 1;
- }
- if(dialogid == Dialog_Fill)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been filled with Health and Armour by %s", pN, aN);
- SendClientMessageToAll(White, str);
- SetPlayerHealth(strval(inputtext), 100.0);
- SetPlayerArmour(strval(inputtext), 100.0);
- return 1;
- }
- if(dialogid == Dialog_God)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s has been God-Moded by %s", pN, aN);
- SendClientMessageToAll(White, str);
- SetPlayerHealth(strval(inputtext), 100000.0);
- SetPlayerArmour(strval(inputtext), 100000.0);
- return 1;
- }
- if(dialogid == Dialog_Freeze)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was frozen by %s", pN, aN);
- SendClientMessageToAll(White, str);
- TogglePlayerControllable(strval(inputtext), 0);
- return 1;
- }
- if(dialogid == Dialog_UnFreeze)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was unfrozen by %s", pN, aN);
- SendClientMessageToAll(White, str);
- TogglePlayerControllable(strval(inputtext), 1);
- return 1;
- }
- if(dialogid == Dialog_Slap)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], str[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(str, sizeof(str), "{FF0000}AdmCmd: {FFFF00}%s was slapped by %s", pN, aN);
- SendClientMessageToAll(White, str);
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(strval(inputtext), X,Y,Z);
- SetPlayerPos(strval(inputtext), X,Y,Z+5);
- new Float:H;
- GetPlayerHealth(playerid, H);
- SetPlayerHealth(playerid, H-20);
- return 1;
- }
- if(dialogid == Dialog_TPto)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], Amsg[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(strval(inputtext), X,Y,Z);
- SetPlayerPos(playerid, X+5,Y,Z+2);
- format(Amsg, sizeof(Amsg), "{33FF33}You have been Teleported to {FF0000}%s", pN);
- SendClientMessage(playerid, White, Amsg);
- return 1;
- }
- if(dialogid == Dialog_TPu)
- {
- if(!response) return 0;
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new aN[128], Amsg[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(playerid, X,Y,Z);
- SetPlayerPos(strval(inputtext), X+5,Y,Z);
- format(Amsg, sizeof(Amsg), "{33FF33}You have been Teleported to {FF0000}%s", pN);
- SendClientMessage(strval(inputtext), White, Amsg);
- return 1;
- }
- if(dialogid == Dialog_Make_Adm)
- {
- if(!response) return 0;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new pFile[100], aN[128], Amsg[128], Pmsg[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", pN);
- if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 1) return SendClientMessage(playerid, White, "{FF0000}The player is already an admin");
- format(Pmsg, sizeof(Pmsg), "{33FF33}The admin {FF0000}%s {33FF33}made you Admin.", aN);
- SendClientMessage(strval(inputtext), White, Pmsg);
- format(Amsg, sizeof(Amsg), "{33FF33}You made {FF0000}%s {33FF33}an Admin.", pN);
- SendClientMessage(playerid, White, Amsg);
- dini_Create(pFile);
- dini_IntSet(pFile, "Level", 1);
- return 1;
- }
- if(dialogid == Dialog_Remove_Adm)
- {
- if(!response) return 0;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, White, "{999999} You are not authorised to use this command");
- if(!IsPlayerConnected(strval(inputtext))) return SendClientMessage(playerid, Red, "Invalid Player ID");
- new pFile[100], aN[128], Amsg[128], Pmsg[128], pN[128];
- GetPlayerName(playerid, aN, sizeof(aN)), GetPlayerName(strval(inputtext), pN, sizeof(pN));
- format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", pN);
- if(!dini_Exists(pFile)) return SendClientMessage(playerid, White, "{FF0000}The player is not an admin");
- if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 0) return SendClientMessage(playerid, White, "{FF0000}The player is not an admin");
- format(Pmsg, sizeof(Pmsg), "{33FF33}The admin {FF0000}%s {33FF33}Demote you from Admin.", aN);
- SendClientMessage(strval(inputtext), White, Pmsg);
- format(Amsg, sizeof(Amsg), "{33FF33}You Demote {FF0000}%s {33FF33} from being an Admin.", pN);
- SendClientMessage(playerid, White, Amsg);
- dini_Remove(pFile);
- return 1;
- }
- if(dialogid == Dialog_Say)
- {
- if(IsAdm(playerid) || IsPlayerAdmin(playerid))
- {
- new pName[128], str[128];
- GetPlayerName(playerid, pName, sizeof(pName));
- if(IsPlayerAdmin(playerid) && IsAdm(playerid))
- {
- format(str, sizeof(str), "{FF0000}RCON Admin {00FFFF}%s: {FFFF00}%s", pName, inputtext);
- }
- if(IsPlayerAdmin(playerid) && !IsAdm(playerid))
- {
- format(str, sizeof(str), "[{00AAFF}Off-Duty{FFFFFF}] {FF0000}RCON Admin {FFFF00}%s:{00FFFF} %s", pName, inputtext);
- }
- if(IsAdm(playerid) && !IsPlayerAdmin(playerid))
- {
- format(str, sizeof(str), "{33FF33}Regular Admin {FFFF00}%s:{00FFFF} %s", pName, inputtext);
- }
- SendClientMessageToAll(White, str);
- }
- return 1;
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- stock IsAdm(playerid)
- {
- new pFile[100], name[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(pFile, sizeof(pFile), "Adm/Admins/%s.ini", name);
- if(!dini_Exists(pFile)) return false;
- if(dini_Exists(pFile) && dini_Int(pFile, "Level") == 0) return false;
- else return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement