Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- MeanAdmin filterscript made by:
- _________
- |\ /| | /\ |\ |
- | \ / | | / \ | \ |
- | \ / | | / \ | \ |
- | \ / | |_________ /______\ | \ |
- | \ / | | / \ | \ |
- | \ / | | / \ | \ |
- | \/ | |_________ / \ | \|
- Sorry for using the slowest methods, you can also optimize the code if you like
- */
- //Includes
- #include <a_samp>
- #include <dudb>
- #include <streamer>
- #include <zcmd>
- #include <foreach>
- #include <YSI/Y_Ini>
- //Forwards
- forward ServerBot();
- forward God(playerid);
- forward SetPlayerPosTravelTimer(playerid, Float:x, Float:y, Float:z);
- forward unfreezetimer(playerid);
- forward SaveIn(filename[],text[]);
- forward ParsePlayerPass( playerid, name[ ], value[ ] );
- forward VehRes(vehicleid);
- forward LoadStats(playerid, name[], value[]);
- public VehRes(vehicleid)
- {
- DestroyVehicle(vehicleid);
- }
- //Defines
- //#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50
- /*#define Loop(%1,%2) \
- for(new %1=0; %1<%2; %1++)*/
- #define GREY 0xAFAFAFAA
- #define GREEN 0x33AA33AA
- #define YELLOW 0xFFFF00AA
- #define LIGHTBLUE 0x33CCFFAA
- #define ORANGE 0xFF9900AA
- #define WHITE 0xFFFFFFAA
- #define MAX_STRING 255
- #define TRAVEL_TIME 20 // seconds
- public unfreezetimer(playerid)
- {
- TogglePlayerControllable(playerid, 1);
- GameTextForPlayer(playerid, "Objects loaded", 1000, 6);
- return true;
- }
- new VehicleNames[][] =
- {
- "Landstalker",
- "Bravura",
- "Buffalo",
- "Linerunner",
- "Pereniel",
- "Sentinel",
- "Dumper",
- "Firetruck",
- "Trashmaster",
- "Stretch",
- "Manana",
- "Infernus",
- "Voodoo",
- "Pony",
- "Mule",
- "Cheetah",
- "Ambulance",
- "Leviathan",
- "Moonbeam",
- "Esperanto",
- "Taxi",
- "Washington",
- "Bobcat",
- "Mr Whoopee",
- "BF Injection",
- "Hunter",
- "Premier",
- "Enforcer",
- "Securicar",
- "Banshee",
- "Predator",
- "Bus",
- "Rhino",
- "Barracks",
- "Hotknife",
- "Trailer",
- "Previon",
- "Coach",
- "Cabbie",
- "Stallion",
- "Rumpo",
- "RC Bandit",
- "Romero",
- "Packer",
- "Monster Truck",
- "Admiral",
- "Squalo",
- "Seasparrow",
- "Pizzaboy",
- "Tram",
- "Trailer",
- "Turismo",
- "Speeder",
- "Reefer",
- "Tropic",
- "Flatbed",
- "Yankee",
- "Caddy",
- "Solair",
- "Berkley's RC Van",
- "Skimmer",
- "PCJ-600",
- "Faggio",
- "Freeway",
- "RC Baron",
- "RC Raider",
- "Glendale",
- "Oceanic",
- "Sanchez",
- "Sparrow",
- "Patriot",
- "Quad",
- "Coastguard",
- "Dinghy",
- "Hermes",
- "Sabre",
- "Rustler",
- "ZR-350",
- "Walton",
- "Regina",
- "Comet",
- "BMX",
- "Burrito",
- "Camper",
- "Marquis",
- "Baggage",
- "Dozer",
- "Maverick",
- "News Chopper",
- "Rancher",
- "FBI Rancher",
- "Virgo",
- "Greenwood",
- "Jetmax",
- "Hotring",
- "Sandking",
- "Blista Compact",
- "Police Maverick",
- "Boxville",
- "Benson",
- "Mesa",
- "RC Goblin",
- "Hotring Racer",
- "Hotring Racer",
- "Bloodring Banger",
- "Rancher",
- "Super GT",
- "Elegant",
- "Journey",
- "Bike",
- "Mountain Bike",
- "Beagle",
- "Cropdust",
- "Stunt",
- "Tanker",
- "RoadTrain",
- "Nebula",
- "Majestic",
- "Buccaneer",
- "Shamal",
- "Hydra",
- "FCR-900",
- "NRG-500",
- "HPV1000",
- "Cement Truck",
- "Tow Truck",
- "Fortune",
- "Cadrona",
- "FBI Truck",
- "Willard",
- "Forklift",
- "Tractor",
- "Combine",
- "Feltzer",
- "Remington",
- "Slamvan",
- "Blade",
- "Freight",
- "Streak",
- "Vortex",
- "Vincent",
- "Bullet",
- "Clover",
- "Sadler",
- "Firetruck",
- "Hustler",
- "Intruder",
- "Primo",
- "Cargobob",
- "Tampa",
- "Sunrise",
- "Merit",
- "Utility",
- "Nevada",
- "Yosemite",
- "Windsor",
- "Monster Truck",
- "Monster Truck",
- "Uranus",
- "Jester",
- "Sultan",
- "Stratum",
- "Elegy",
- "Raindance",
- "RC Tiger",
- "Flash",
- "Tahoma",
- "Savanna",
- "Bandito",
- "Freight",
- "Trailer",
- "Kart",
- "Mower",
- "Duneride",
- "Sweeper",
- "Broadway",
- "Tornado",
- "AT-400",
- "DFT-30",
- "Huntley",
- "Stafford",
- "BF-400",
- "Newsvan",
- "Tug",
- "Trailer",
- "Emperor",
- "Wayfarer",
- "Euros",
- "Hotdog",
- "Club",
- "Trailer",
- "Trailer",
- "Andromada",
- "Dodo",
- "RC Cam",
- "Launch",
- "Police Car (LSPD)",
- "Police Car (SFPD)",
- "Police Car (LVPD)",
- "Police Ranger",
- "Picador",
- "S.W.A.T. Van",
- "Alpha",
- "Phoenix",
- "Glendale",
- "Sadler",
- "Luggage Trailer",
- "Luggage Trailer",
- "Stair Trailer",
- "Boxville",
- "Farm Plow",
- "Utility Trailer"
- };
- public ParsePlayerPass( playerid, name[ ], value[ ] )
- {
- if ( !strcmp( name, "Password" ) )
- {
- SetPVarString( playerid, "pPass", value );
- }
- }
- public SaveIn(filename[],text[])
- {
- new File:Lfile;
- new filepath[256];
- new string[256];
- new year,month,day;
- new hour,minute,second;
- getdate(year,month,day);
- gettime(hour,minute,second);
- format(filepath,sizeof(filepath),"mAdmin/Logs/%s.txt",filename);
- Lfile = fopen(filepath,io_append);
- format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
- fwrite(Lfile,string);
- fclose(Lfile);
- return 1;
- }
- public SetPlayerPosTravelTimer(playerid, Float:x, Float:y, Float:z)
- {
- TogglePlayerControllable(playerid, false);
- GameTextForPlayer(playerid, "Loading ~r~objects", 3000, 6);
- SetTimerEx("unfreezetimer",3000,0,"d",playerid);
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, x, y, z);
- GameTextForPlayer(playerid, "Traveling over", 3000, 1);
- return true;
- }
- stock SetPlayerPosTravel(playerid, Float:x, Float:y, Float:z)
- {
- TogglePlayerControllable(playerid, false);
- GameTextForPlayer(playerid, "Traveling", 3000, 1);
- SetPlayerInterior(playerid, 1);
- SetPlayerPos(playerid, 1.7313,27.1232,1199.5938);
- SetTimerEx("SetPlayerPosTravelTimer", TRAVEL_TIME*1000, 0, "ifff", playerid, x, y, z);
- return 1;
- }
- public OnFilterScriptInit()
- {
- SetTimer("ServerBot", 15*1000, 1);
- CreateDynamicObject(9931, 369.681640625, 2339.9267578125, 1904.9915771484, 0, 0, 0);
- CreateDynamicObject(9931, 369.7060546875, 2308.431640625, 1904.9920654297, 0, 0, 0);
- CreateDynamicObject(6959, 380.3193359375, 2327.4951171875, 1888.5981445313, 0, 0, 0);
- CreateDynamicObject(6959, 378.1806640625, 2333.775390625, 1897.5466308594, 296.47705078125, 0, 0);
- CreateDynamicObject(6959, 378.0703125, 2314.8393554688, 1897.5084228516, 63.740020751953, 0, 0);
- CreateDynamicObject(6959, 363.0498046875, 2326.4736328125, 1902.5007324219, 0, 270.18676757813, 0);
- CreateDynamicObject(9931, 409.28952026367, 2325.361328125, 1903.9514160156, 0, 0, 182.88500976563);
- CreateDynamicObject(6959, 349.35693359375, 2328.1083984375, 1889.6359863281, 0, 0, 0);
- CreateDynamicObject(14394, 370.83624267578, 2320.2700195313, 1888.7946777344, 0, 0, 179.43994140625);
- CreateDynamicObject(14394, 370.92697143555, 2328.2631835938, 1888.7946777344, 0, 0, 179.43969726563);
- CreateDynamicObject(3657, 373.32641601563, 2328.6003417969, 1889.0850830078, 0, 0, 269.96997070313);
- CreateDynamicObject(3657, 375.27359008789, 2328.5871582031, 1889.0850830078, 0, 0, 269.96704101563);
- CreateDynamicObject(3657, 377.10638427734, 2328.55078125, 1889.0850830078, 0, 0, 269.96704101563);
- CreateDynamicObject(3657, 379.10192871094, 2328.5529785156, 1889.0850830078, 0, 0, 269.96704101563);
- CreateDynamicObject(3657, 381.24136352539, 2328.552734375, 1889.0850830078, 0, 0, 269.96704101563);
- CreateDynamicObject(3657, 383.30206298828, 2328.5458984375, 1889.0850830078, 0, 0, 269.96704101563);
- CreateDynamicObject(3657, 373.34204101563, 2320.0771484375, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(3657, 375.22265625, 2320.0434570313, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(3657, 377.12313842773, 2320.0419921875, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(3657, 379.14074707031, 2320.0615234375, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(3657, 381.31060791016, 2320.05859375, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(3657, 383.32202148438, 2320.029296875, 1889.0850830078, 0, 0, 269.96154785156);
- CreateDynamicObject(8131, 359.04635620117, 2324.1560058594, 1890.9467773438, 334.75, 0, 270.44000244141);
- CreateDynamicObject(14705, 367.74389648438, 2322.6496582031, 1890.7045898438, 0, 0, 0);
- CreateDynamicObject(2208, 367.70974731445, 2325.3110351563, 1889.6047363281, 0, 0, 269.95498657227);
- CreateDynamicObject(2868, 367.74664306641, 2325.3173828125, 1890.4699707031, 0, 0, 0);
- CreateDynamicObject(2894, 367.60568237305, 2324.0219726563, 1890.4699707031, 0, 0, 269.39514160156);
- CreateDynamicObject(2869, 368.66561889648, 2331.6791992188, 1889.6047363281, 0, 0, 320.9599609375);
- CreateDynamicObject(2869, 365.07345581055, 2331.7023925781, 1889.6047363281, 0, 0, 322.20654296875);
- CreateDynamicObject(2869, 365.21087646484, 2316.7504882813, 1889.6047363281, 0, 0, 320.95458984375);
- CreateDynamicObject(2869, 368.77743530273, 2316.8020019531, 1889.6047363281, 0, 0, 320.95458984375);
- CreateDynamicObject(2896, 367.05938720703, 2318.2067871094, 1890.2440185547, 0, 0, 0);
- CreateDynamicObject(1664, 367.76473999023, 2323.0808105469, 1890.63671875, 0, 0, 0);
- CreateDynamicObject(1667, 367.53042602539, 2323.2294921875, 1890.55859375, 0, 0, 0);
- CreateDynamicObject(2869, 375.79760742188, 2316.7111816406, 1888.5668945313, 0, 0, 320.95458984375);
- CreateDynamicObject(2869, 382.89117431641, 2316.5712890625, 1888.5668945313, 0, 0, 320.95458984375);
- CreateDynamicObject(2869, 375.69821166992, 2331.720703125, 1888.5668945313, 0, 0, 320.95458984375);
- CreateDynamicObject(2869, 382.8698425293, 2331.7434082031, 1888.5668945313, 0, 0, 320.95458984375);
- CreateDynamicObject(6959, 375.40222167969, 2326.0595703125, 1915.3721923828, 0, 0, 0);
- CreateDynamicObject(6959, 387.21533203125, 2323.322265625, 1924.6811523438, 0, 269.68676757813, 2.75);
- CreateDynamicObject(3462, 364.39996337891, 2328.1259765625, 1890.3927001953, 0, 0, 179.65002441406);
- CreateDynamicObject(3462, 364.37484741211, 2320.1662597656, 1890.3676757813, 0, 0, 180.3984375);
- return 1;
- }
- new MAX_PING = 1000;
- enum gPInfo
- {
- Logged,
- Regged,
- Level,
- Muted,
- Kills,
- Deaths,
- AdminDuty,
- Spectate,
- Jail,
- Vehicle,
- Cash,
- Score,
- Kills1,
- Deaths1,
- Level1
- };
- new PInfo[MAX_PLAYERS][gPInfo];
- new Text3D:label[MAX_PLAYERS];
- new Godtimer;
- public LoadStats(playerid, name[], value[])
- {
- if(!strcmp(name, "Cash"))
- PInfo[playerid][Cash] = strval(value);
- if(!strcmp(name, "Score"))
- PInfo[playerid][Score] = strval(value);
- if(!strcmp(name, "Level"))
- PInfo[playerid][Level1] = strval(value);
- if(!strcmp(name, "Kills"))
- PInfo[playerid][Kills1] = strval(value);
- if(!strcmp(name, "Deaths"))
- PInfo[playerid][Deaths1] = strval(value);
- if(!strcmp(name, "Password"))
- {
- SetPVarString(playerid, "pPass", value);
- }
- return 1;
- }
- stock IsValidSkin(SkinID)
- {
- if((SkinID == 0)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
- else return false;
- }
- stock IsNumeric(string[])
- {
- for (new i = 0, j = strlen(string);
- i < j; i++)
- {
- if (string[i] > '9' || string[i] < '0')
- return 0;
- }
- return 1;
- }
- stock EraseVeh(vehicleid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- new Float:X,Float:Y,Float:Z;
- if(IsPlayerInVehicle(i, vehicleid))
- {
- RemovePlayerFromVehicle(i);
- GetPlayerPos(i,X,Y,Z);
- SetPlayerPos(i,X,Y+3,Z);
- }
- SetVehicleParamsForPlayer(vehicleid,i,0,1);
- }
- SetTimerEx("VehRes",1500,0,"i",vehicleid);
- }
- stock SetAllHealth(Float:health)
- {
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerHealth(i, health);
- }
- }
- return 1;
- }
- /*INI:PlayerStats(name[], value[])
- {
- if(!strcmp(name, "Cash"))
- {
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, value);
- }
- if(!strcmp(name, "Score"))
- {
- SetPlayerScore(playerid, value);
- }
- if(!strcmp(name, "Level"))
- {
- PInfo[playerid][Level] = value;
- }
- if(!strcmp(name, "Kills"))
- {
- PInfo[playerid][Kills] = value;
- }
- if(!strcmp(name, "Deaths"))
- {
- PInfo[playerid][Deaths] = value;
- }
- }*/
- stock SetAllArmor(Float:armor)
- {
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerArmour(i, armor);
- }
- }
- return 1;
- }
- stock GivePlayerScore(playerid, score)
- {
- SetPlayerScore(playerid, GetPlayerScore(playerid) + (score) );
- return 1;
- }
- GetVehicleModelIDFromName(vname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if ( strfind(VehicleNames[i], vname, true) != -1 )
- return i + 400;
- }
- return -1;
- }
- stock AdminCommand(playerid,command[])
- {
- new string[128];
- GetPlayerName(playerid,string,128);
- format(string,sizeof(string),"[ADMIN] %s || Level: %d || Command used: %s", string, PInfo[playerid][Level], command);
- foreach(Player, i)
- {
- if(PInfo[i][Level] >= 1)
- {
- SendClientMessage(i, WHITE, string);
- }
- }
- }
- stock PlayerName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- //Other
- #pragma unused ret_memcpy
- public OnPlayerConnect(playerid)
- {
- PInfo[playerid][Logged] = 0;
- PInfo[playerid][Regged] = 0;
- PInfo[playerid][Level] = 0;
- PInfo[playerid][Jail] = 0;
- PInfo[playerid][Kills] = 0;
- PInfo[playerid][Deaths] = 0;
- PInfo[playerid][AdminDuty] = 0;
- PInfo[playerid][Muted] = 0;
- new n[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid,n,sizeof(n));
- format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
- if(fexist(file))
- {
- SendClientMessage(playerid,LIGHTBLUE,"You are registered, Please /login!");
- PInfo[playerid][Regged] = 1;
- PInfo[playerid][Logged] = 0;
- return 1;
- }
- if(!fexist(file))
- {
- SendClientMessage(playerid,LIGHTBLUE,"You are not register, Please /register!");
- PInfo[playerid][Regged] = 0;
- PInfo[playerid][Logged] = 0;
- return 1;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new n[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid,n,sizeof(n));
- format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
- PInfo[playerid][Logged] = 0;
- new INI:PlayerAcc = INI_Open(file);
- switch(reason)
- {
- case 0:
- {
- if(fexist(file))
- {
- INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
- INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(PlayerAcc,"Logged",0);
- INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
- INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
- return 1;
- }
- }
- case 1:
- {
- if(fexist(file))
- {
- INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
- INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(PlayerAcc,"Logged",0);
- INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
- INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
- return 1;
- }
- }
- case 2:
- {
- if(fexist(file))
- {
- INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
- INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(PlayerAcc,"Logged",0);
- INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
- INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
- return 1;
- }
- }
- }
- INI_Close(PlayerAcc);
- Delete3DTextLabel(label[playerid]);
- return 1;
- }
- /*public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256], idx;
- cmd = strtok(cmdtext, idx);
- dcmd(register,8,cmdtext);
- dcmd(login,5,cmdtext);
- dcmd(setlevel,8,cmdtext);
- dcmd(kick,4,cmdtext);
- dcmd(ban,3,cmdtext);
- dcmd(mute,4,cmdtext);
- dcmd(looptest,8,cmdtext);
- dcmd(healall,7,cmdtext);
- dcmd(armorall,8,cmdtext);
- dcmd(setscore,8,cmdtext);
- dcmd(setmoney,8,cmdtext);
- dcmd(richestplayers,14,cmdtext);
- dcmd(stats,5,cmdtext);
- dcmd(admins,6,cmdtext);
- dcmd(get,3,cmdtext);
- dcmd(goto,4,cmdtext);
- dcmd(explode,7,cmdtext);
- dcmd(slap,4,cmdtext);
- dcmd(givescore,9,cmdtext);
- dcmd(setskin,7,cmdtext);
- dcmd(report,6,cmdtext);
- dcmd(adminduty,9,cmdtext);
- dcmd(kill,4,cmdtext);
- dcmd(asay,4,cmdtext);
- dcmd(spec,4,cmdtext);
- dcmd(endspec,7,cmdtext);
- dcmd(adminarea,9,cmdtext);
- dcmd(jail,4,cmdtext);
- dcmd(unjail,6,cmdtext);
- dcmd(spawn,5,cmdtext);
- dcmd(gmx,3,cmdtext);
- dcmd(ahelp,5,cmdtext);
- return 0;
- }*/
- CMD:register(playerid, params[])
- {
- new file[256],n[MAX_PLAYER_NAME];
- GetPlayerName(playerid,n,MAX_PLAYER_NAME);
- format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
- if(fexist(file))
- return SendClientMessage(playerid,YELLOW,"You are already registered!");
- if(PInfo[playerid][Regged] == 1)
- return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
- if(PInfo[playerid][Logged] == 1)
- return SendClientMessage(playerid,ORANGE,"You are already registered, and logged in!");
- new INI:PlayerAcc = INI_Open(file);
- if(!isnull(params))
- {
- if(!fexist(file))
- {
- INI_WriteString(PlayerAcc,"Password",params);
- INI_WriteInt(PlayerAcc,"Regged",1);
- INI_WriteInt(PlayerAcc,"Logged",0);
- INI_WriteInt(PlayerAcc,"Level",0);
- INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
- INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(PlayerAcc,"Deaths",0);
- INI_WriteInt(PlayerAcc,"Kills",0);
- INI_Close(PlayerAcc);
- SendClientMessage(playerid,ORANGE,"You have just registered, Please use /login [password] to login!");
- PInfo[playerid][Regged] = 1;
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
- return 1;
- }
- return 1;
- }
- /*
- if(!strcmp(name, "Cash"))
- PInfo[playerid][Cash] = strval(value);
- if(!strcmp(name, "Score"))
- PInfo[playerid][Score] = strval(value);
- if(!strcmp(name, "Level"))
- PInfo[playerid][Level] = strval(value);
- if(!strcmp(name, "Kills"))
- PInfo[playerid][Kills] = strval(value);
- if(!strcmp(name, "Deaths"))
- PInfo[playerid][Deaths] = strval(value);*/
- CMD:login(playerid,params[])
- {
- new file[256],n[MAX_PLAYER_NAME];
- GetPlayerName(playerid,n,MAX_PLAYER_NAME);
- format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
- if(!fexist(file))
- return SendClientMessage(playerid,YELLOW,"You are not registered! Please /register");
- if(PInfo[playerid][Logged] == 1)
- return SendClientMessage(playerid,LIGHTBLUE,"You are already logged in!");
- if(PInfo[playerid][Regged] == 0)
- return SendClientMessage(playerid,ORANGE,"You are not registered! Please /register");
- if(!isnull(params))
- {
- new pass[256];
- if(fexist(file))
- {
- INI_ParseFile(file, "LoadStats", false, true, playerid, true, false);
- GetPVarString(playerid, "pPass", pass, sizeof(pass));
- if(!strcmp(params, pass, false))
- {
- SetPlayerScore(playerid, PInfo[playerid][Score]);
- ResetPlayerMoney(playerid);
- SetPlayerMoney(playerid, PInfo[playerid][Cash]);
- PInfo[playerid][Level] = PInfo[playerid][Level1];
- PInfo[playerid][Kills] = PInfo[playerid][Kills1];
- PInfo[playerid][Deaths] = PInfo[playerid][Deaths1];
- new INI:PlayerAcc = INI_Open(file);
- INI_WriteInt(PlayerAcc,"Logged",1);
- INI_Close(PlayerAcc);
- PInfo[playerid][Logged] = 1;
- if(PInfo[playerid][Level] == 0) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Normal player");
- if(PInfo[playerid][Level] == 1) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 1 admin (Test admin)");
- if(PInfo[playerid][Level] == 2) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 2 admin (Standard admin)");
- if(PInfo[playerid][Level] == 3) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 3 admin (Pro admin)");
- if(PInfo[playerid][Level] == 4) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 4 admin (Leading admin)");
- if(PInfo[playerid][Level] == 5) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 5 admin (Head admin)");
- if(PInfo[playerid][Level] > 5) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 5+ admin (Master admin)");
- }
- else
- {
- SendClientMessage(playerid,YELLOW,"Wrong Password!");
- }
- }
- }
- else
- {
- SendClientMessage(playerid,GREY,"USAGE: /login <Password>");
- }
- return 1;
- }
- CMD:setlevel(playerid,params[])
- {
- new level,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
- new tmp[MAX_STRING], tmp2[MAX_STRING], Index,str[51];// creating the new variables
- tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),level = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
- GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
- format(file,sizeof(file),"mAdmin/Users/%s.ini",n);//formatting the file
- if(IsPlayerAdmin(playerid) || PInfo[playerid][Level] >= 5)
- {
- if(isnull(params))
- return SendClientMessage(playerid,GREY,"USAGE: /setlevel <ID> <Level>");// if the string is empty
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"You have entered an incorrect ID"); //if the id is not connected
- PInfo[id][Level] = level;//sets the level of the player
- new INI:PlayerAcc = INI_Open(file);
- INI_WriteInt(PlayerAcc,"Level",level);
- INI_Close(PlayerAcc);
- format(str,sizeof(str),"You have set %s's level to %d",n,level);//creates the string
- return SendClientMessage(playerid,LIGHTBLUE,str);
- }
- else return SendClientMessage(playerid,GREY,"You need to be RCON admin or level 5+!");
- }
- CMD:kick(playerid,params[])
- {
- new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
- new tmp[MAX_STRING], tmp2[MAX_STRING], Index, str[128];
- tmp = strtok(params,Index);
- tmp2 = strtok(params,Index);
- id = strval(tmp);
- GetPlayerName(id,on,sizeof(on));
- GetPlayerName(playerid,n,sizeof(n));
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid,ORANGE,"You need to be level 1 to use this command!");
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /kick <ID> <Reason> ");
- if(isnull(tmp2))
- {
- format(str,sizeof(str),"Administrator %s has kicked %s || Reason: Not given",n,on);
- return SendClientMessageToAll(YELLOW, str);
- }
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- format(str,sizeof(str),"Administrator %s has kicked %s || Reason: %s",n,on,params[strlen(tmp)+1]);
- SendClientMessageToAll(YELLOW, str);
- Kick(id);
- return 1;
- }
- CMD:ban(playerid,params[])
- {
- new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
- new tmp[MAX_STRING], tmp2[MAX_STRING], Index, str[128];
- tmp = strtok(params,Index), id = strval(tmp);
- tmp2 = strtok(params, Index);
- GetPlayerName(id,on,sizeof(on));
- GetPlayerName(playerid,n,sizeof(n));
- if(PInfo[playerid][Level] < 3)
- return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!");
- if(isnull(params))
- return SendClientMessage(playerid,GREY,"USAGE: /ban <ID> <Reason> ");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- if(isnull(tmp2))
- {
- format(str,sizeof(str),"Administrator %s has banned %s || Reason: Not given",n,on);
- return SendClientMessageToAll(YELLOW, str);
- }
- format(str,sizeof(str),"Administrator %s has banned %s || Reason: %s",n,on,params[strlen(tmp)+1]);
- SaveIn("BanLog", str);
- SendClientMessageToAll(ORANGE,str);
- BanEx(id, params[strlen(tmp)+1]);
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[MAX_STRING], Index, id;
- tmp = strtok(params, Index);
- id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /mute <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[65];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- if(PInfo[id][Muted] == 1)
- {
- PInfo[id][Muted] = 0;
- format(string, 65, "You have unmuted %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 65, "You have been unmuted by administrator %s", aName);
- SendClientMessage(id, YELLOW, string);
- }
- else
- {
- PInfo[id][Muted] = 1;
- format(string, 65, "You have muted %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 65, "You have been muted by administrator %s", aName);
- SendClientMessage(id, YELLOW, string);
- }
- return 1;
- }
- CMD:looptest(playerid, params[])
- {
- #pragma unused params
- if(IsPlayerAdmin(playerid))
- {
- foreach(Player, i) // Loop through your defined MAX_PLAYERS ^^
- {
- if(IsPlayerConnected(i))
- {
- SendClientMessage(i, YELLOW, "Looping");
- return Kick(i);
- }
- }
- }
- else return 0;
- return 1;
- }
- CMD:healall(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] < 4)
- return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
- new string[71];
- GetPlayerName(playerid, string, 128);
- format(string, 71, "Administrator %s has restored everyone's health!", string);
- SendClientMessageToAll(YELLOW, string);
- SetAllHealth(100.0);
- AdminCommand(playerid, "HEALALL");
- return 1;
- }
- CMD:armorall(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] < 4)
- return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
- new string[71];
- GetPlayerName(playerid, string, 128);
- format(string, 71, "Administrator %s has restored everyone's armor!", string);
- SendClientMessageToAll(YELLOW, string);
- SetAllArmor(100.0);
- AdminCommand(playerid, "ARMORALL");
- return 1;
- }
- CMD:setscore(playerid, params[])
- {
- if(PInfo[playerid][Level] < 4)
- return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
- new tmp[MAX_STRING], tmp2[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- new id = strval(tmp);
- new score = strval(tmp2);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /setscore <ID> <Score> ");
- if(isnull(tmp2))
- return SendClientMessage(playerid,GREY,"USAGE: /setscore <ID> <Score> ");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[72];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 72, "Administrator %s has set your score to %d", aName, score);
- SendClientMessage(id, YELLOW, string);
- format(string, 72, "You have set %s's score to %d", pName, score);
- SendClientMessage(playerid, YELLOW, string);
- SetPlayerScore(id, score);
- AdminCommand(playerid, "SETSCORE");
- return 1;
- }
- CMD:setmoney(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[MAX_STRING], tmp2[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- new id = strval(tmp);
- new money = strval(tmp2);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /setmoney <ID> <Money> ");
- if(isnull(tmp2))
- return SendClientMessage(playerid,GREY,"USAGE: /setmoney <ID> <Money> ");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[72];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 72, "Administrator %s has set your money to $%d", aName, money);
- SendClientMessage(id, YELLOW, string);
- format(string, 72, "You have set %s's money to $%d", pName, money);
- SendClientMessage(playerid, YELLOW, string);
- SetPlayerMoney(id, money);
- AdminCommand(playerid, "SETMONEY");
- return 1;
- }
- CMD:richestplayers(playerid, params[])
- {
- #pragma unused params
- new string[71], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1;
- new HighestCash = -9999;
- SendClientMessage(playerid,GREEN,"Richest Players Online:");
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x))
- if(GetPlayerMoney(x) >= HighestCash)
- {
- HighestCash = GetPlayerMoney(x);
- Slot1 = x;
- }
- HighestCash = -9999;
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x) && x != Slot1)
- if(GetPlayerMoney(x) >= HighestCash)
- {
- HighestCash = GetPlayerMoney(x);
- Slot2 = x;
- }
- HighestCash = -9999;
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
- if(GetPlayerMoney(x) >= HighestCash)
- {
- HighestCash = GetPlayerMoney(x);
- Slot3 = x;
- }
- HighestCash = -9999;
- for(new x=0; x<MAX_PLAYERS; x++)
- if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
- if(GetPlayerMoney(x) >= HighestCash)
- {
- HighestCash = GetPlayerMoney(x);
- Slot4 = x;
- }
- format(string, sizeof(string), "(%d) Player %s - $%d", Slot1,PlayerName(Slot1),GetPlayerMoney(Slot1));
- SendClientMessage(playerid,WHITE,string);
- if(Slot2 != -1){
- format(string, sizeof(string), "(%d) Player %s - $%d", Slot2,PlayerName(Slot2),GetPlayerMoney(Slot2));
- SendClientMessage(playerid,WHITE,string);
- }
- if(Slot3 != -1){
- format(string, sizeof(string), "(%d) Player %s - $%d", Slot3,PlayerName(Slot3),GetPlayerMoney(Slot3));
- SendClientMessage(playerid,WHITE,string);
- }
- if(Slot4 != -1){
- format(string, sizeof(string), "(%d) Player %s - $%d", Slot4,PlayerName(Slot4),GetPlayerMoney(Slot4));
- SendClientMessage(playerid,WHITE,string);
- }
- return 1;
- }
- CMD:stats(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Logged] == 0)
- return SendClientMessage(playerid, ORANGE, "You need to be logged in to use this command");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- format(string, 128, "[STATS]: Name: %s, Score: %d, Money: $%d, Current level: %d, Kills: %d, Deaths: %d", pName, GetPlayerScore(playerid), GetPlayerMoney(playerid), PInfo[playerid][Level], PInfo[playerid][Kills], PInfo[playerid][Deaths]);
- SendClientMessage(playerid, GREEN, string);
- return 1;
- }
- CMD:admins(playerid, params[])
- {
- new string[128];
- #pragma unused params
- SendClientMessage(playerid, WHITE, "Admins online:");
- foreach(Player, i)
- {
- new aName[MAX_PLAYER_NAME];
- if(PInfo[i][Level] >= 1)
- {
- GetPlayerName(i, aName, MAX_PLAYER_NAME);
- if(PInfo[i][Level] == 1)
- format(string, 128, "[LEVEL]: 1 [RANK]: Test admin [ID]: %d [NAME]: %s", i, aName);
- if(PInfo[i][Level] == 2)
- format(string, 128, "[LEVEL]: 2 [RANK]: Standard admin [ID]: %d [NAME]: %s", i, aName);
- if(PInfo[i][Level] == 3)
- format(string, 128, "[LEVEL]: 3 [RANK]: Pro admin [ID]: %d [NAME]: %s", i, aName);
- if(PInfo[i][Level] == 4)
- format(string, 128, "[LEVEL]: 4 [RANK]: Leading admin [ID]: %d [NAME]: %s", i, aName);
- if(PInfo[i][Level] == 5)
- format(string, 128, "[LEVEL]: 5 [RANK]: Head admin [ID]: %d [NAME]: %s", i, aName);
- if(PInfo[i][Level] > 5)
- format(string, 128, "[LEVEL]: %d [RANK]: Master admin [ID]: %d [NAME]: %s", PInfo[i][Level], i, aName);
- }
- }
- SendClientMessage(playerid, WHITE, string);
- return 1;
- }
- CMD:get(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /get <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[78];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 78, "You have teleported %s to your position", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 78, "You have been teleported to administrator %s's position", aName);
- SendClientMessage(id, YELLOW, string);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- SetPlayerPos(id, x, y, z);
- AdminCommand(playerid, "GET");
- return 1;
- }
- CMD:goto(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /goto <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 128, "You have teleported to %s's position", pName);
- SendClientMessage(playerid, YELLOW, string);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(playerid, x, y, z);
- AdminCommand(playerid, "GOTO");
- return 1;
- }
- CMD:explode(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /explode <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 128, "You have exploded %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- CreateExplosion(x, y, z, 7, 10.0);
- AdminCommand(playerid, "EXPLODE");
- return 1;
- }
- CMD:slap(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this command");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /slap <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 128, "You have slapped %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- new Float:x, Float:y, Float:z;
- GetPlayerPos(id, x, y, z);
- SetPlayerPos(id, x, y, z+5);
- PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
- PlayerPlaySound(id,1190,0.0,0.0,0.0);
- new Float:health;
- GetPlayerHealth(id, health);
- SetPlayerHealth(id, health-15);
- AdminCommand(playerid, "SLAP");
- return 1;
- }
- CMD:givescore(playerid, params[])
- {
- if(PInfo[playerid][Level] < 4)
- return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
- new tmp[MAX_STRING];
- new tmp2[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- new id = strval(tmp);
- new score = strval(tmp2);
- if(isnull(tmp))
- return SendClientMessage(playerid,GREY,"USAGE: /givescore <ID> <Score>");
- if(isnull(tmp2))
- return SendClientMessage(playerid,GREY,"USAGE: /givescore <ID> <Score>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 128, "You gave %s score to %s", params[strlen(tmp)+1], pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 128, "Administrator %s gave you %s score", aName, params[strlen(tmp)+1]);
- SendClientMessage(id, YELLOW, string);
- GivePlayerScore(id, score);
- AdminCommand(playerid, "GIVESCORE");
- return 1;
- }
- CMD:setskin(playerid,params[])
- {
- if(PInfo[playerid][Level] < 4)
- return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
- new Index;
- new tmp[MAX_STRING];
- new tmp2[MAX_STRING];
- tmp = strtok(params,Index);
- tmp2 = strtok(params,Index);
- if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2))
- return SendClientMessage(playerid, GREY, "USAGE: /setskin <ID> <Skin>");
- new id = strval(tmp);
- new skin = strval(tmp2);
- new string[128];
- if(!IsValidSkin(skin))
- return SendClientMessage(playerid, GREY, "ERROR: Invaild Skin ID!");
- if(!IsPlayerConnected(id) && id == INVALID_PLAYER_ID)
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- format(string, 128, "You have set %s's skin to %d", pName, skin);
- SendClientMessage(playerid, YELLOW, string);
- format(string,sizeof(string),"Administrator %s has set your skin to %d", aName, skin);
- SendClientMessage(id, YELLOW, string);
- SetPlayerSkin(id, skin);
- AdminCommand(playerid, "SETSKIN");
- return 1;
- }
- CMD:report(playerid, params[])
- {
- new tmp[MAX_STRING];
- new tmp2[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp) || isnull(tmp2))
- return SendClientMessage(playerid, GREY, "USAGE: /report <ID> <Reason>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME];
- new reported[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- GetPlayerName(id, reported, MAX_PLAYER_NAME);
- SendClientMessage(playerid, YELLOW, "Your report has been sent to all online administrators and has been saved to file");
- foreach(Player, i)
- {
- if(PInfo[i][Level] >= 1)
- {
- format(string, 128, "[REPORT] %s reported %s || Reason: %s", pName, reported, params[strlen(tmp)+1]);
- SendClientMessage(i, WHITE, string);
- }
- }
- SaveIn("ReportLog",string);
- return 1;
- }
- CMD:adminduty(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- if(PInfo[playerid][AdminDuty] == 0)
- {
- PInfo[playerid][AdminDuty] = 1;
- new string[128];
- GetPlayerName(playerid, string, 128);
- format(string, 128, "Administrator %s is now On-Duty!", string);
- SendClientMessageToAll(LIGHTBLUE, string);
- Godtimer = SetTimerEx("God", 500, 1, "i", playerid);
- SetPlayerHealth(playerid, 10000);
- GivePlayerWeapon(playerid, WEAPON_MINIGUN, 100000);
- label[playerid] = Create3DTextLabel("On-Duty admin, do not attack",0x008080FF,30.0,40.0,50.0,40.0,0);
- Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
- SetPlayerSkin(playerid, 217);
- SetPlayerColor(playerid, LIGHTBLUE);
- }
- else
- {
- PInfo[playerid][AdminDuty] = 0;
- new string[128];
- GetPlayerName(playerid, string, 128);
- format(string, 128, "Administrator %s is now Off-Duty!", string);
- SendClientMessageToAll(LIGHTBLUE, string);
- KillTimer(Godtimer);
- SetPlayerHealth(playerid, 100.0);
- Delete3DTextLabel(label[playerid]);
- SetPlayerHealth(playerid, 0.0);
- }
- return 1;
- }
- CMD:kill(playerid, params[])
- {
- #pragma unused params
- SetPlayerHealth(playerid, 0.0);
- return 1;
- }
- CMD:asay(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- new string[128];
- GetPlayerName(playerid, string, 128);
- format(string, 128, "Admin %s: %s", string, params);
- SendClientMessageToAll(LIGHTBLUE, string);
- return 1;
- }
- CMD:spec(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid, GREY, "USAGE: /spec <ID>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- format(string, 128, "Now spectating %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 128, "Administrator %s is now spectating [%d]%s", aName, id, pName);
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, id);
- PInfo[playerid][Spectate] = 1;
- foreach(Player, i)
- {
- if(PInfo[i][Level] >= 1)
- {
- SendClientMessage(i, WHITE, string);
- }
- }
- return 1;
- }
- CMD:endspec(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- if(PInfo[playerid][Spectate] == 0)
- return SendClientMessage(playerid, ORANGE, "You aren't spectating");
- TogglePlayerSpectating(playerid, 0);
- PInfo[playerid][Spectate] = 0;
- SendClientMessage(playerid, YELLOW, "Spectate ended");
- return 1;
- }
- CMD:adminarea(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
- SetPlayerInterior(playerid, 10);
- Streamer_UpdateEx(playerid, 382.7088,2324.7488,1889.5669);
- SetPlayerPos(playerid, 382.7088,2324.7488,1889.5669);
- return 1;
- }
- CMD:jail(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[MAX_STRING], tmp2[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- new id = strval(tmp);
- if(isnull(tmp) || isnull(tmp2))
- return SendClientMessage(playerid, GREY, "USAGE: /jail <ID> <Reason>");
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- new string[128];
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- if(PInfo[id][Jail] == 0)
- {
- SetPlayerPos(id,197.6661,173.8179,1003.0234);
- SetPlayerInterior(id,3);
- format(string, 128, "You have jailed %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 128, "Administrator %s has jailed you || Reason: %s", aName, params[strlen(tmp)+1]);
- SendClientMessage(id, YELLOW, string);
- PInfo[id][Jail] = 1;
- format(string, 128, "%s has been jailed by administrator %s || Reason: %s", pName, aName, params[strlen(tmp)+1]);
- SendClientMessageToAll(YELLOW, string);
- }
- else
- return SendClientMessage(playerid, ORANGE, "Player is in jail already");
- AdminCommand(playerid, "JAIL");
- return 1;
- }
- CMD:unjail(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- new string[128];
- if(PInfo[id][Jail] == 1)
- {
- SpawnPlayer(id);
- format(string, 128, "You have unjailed %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- format(string, 128, "Administrator %s has unjailed you", aName);
- SendClientMessage(id, YELLOW, string);
- format(string, 128, "%s has been unjailed by administrator %s", pName, aName);
- SendClientMessageToAll(YELLOW, string);
- AdminCommand(playerid, "UNJAIL");
- }
- else if(PInfo[id][Jail] == 0)
- SendClientMessage(playerid, ORANGE, "Player is not in jail");
- return 1;
- }
- CMD:spawn(playerid, params[])
- {
- if(PInfo[playerid][Level] < 1)
- return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this command");
- new tmp[MAX_STRING];
- new Index;
- tmp = strtok(params, Index);
- new id = strval(tmp);
- new string[128];
- if(!IsPlayerConnected(id))
- return SendClientMessage(playerid,GREY,"Invalid ID");
- if(isnull(tmp))
- return SendClientMessage(playerid, GREY, "USAGE: /spawn <ID>");
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(id, pName, MAX_PLAYER_NAME);
- SpawnPlayer(id);
- format(string, 128, "You have spawned %s", pName);
- SendClientMessage(playerid, YELLOW, string);
- AdminCommand(playerid, "SPAWN");
- return 1;
- }
- CMD:gmx(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid))
- {
- new string[128];
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
- if(isnull(params))
- {
- format(string,sizeof(string), "Administrator %s has restarted the server || Reason: Not given", playername);
- }
- else
- {
- format(string,sizeof(string), "Administrator %s has restarted the server || Reason: %s", playername, params);
- }
- for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) PlayerPlaySound(i,1057,0.0,0.0,0.0);
- SendClientMessageToAll(YELLOW, string);
- SendRconCommand("gmx");
- }
- else return 0;
- return 1;
- }
- CMD:v(playerid, params[])
- {
- if(PInfo[playerid][Level] < 3)
- return SendClientMessage(playerid, ORANGE, "You need to be level 3+ to use this command");
- new Index;
- new tmp[256];
- new tmp2[256];
- new tmp3[256];
- tmp = strtok(params, Index);
- tmp2 = strtok(params, Index);
- tmp3 = strtok(params, Index);
- if(isnull(tmp))
- return SendClientMessage(playerid, GREY, "USAGE: /v <Vehicle ID/Model> <Color 1> <Color 2>");
- new car;
- new string[128];
- new color1, color2;
- if(!IsNumeric(tmp))
- car = GetVehicleModelIDFromName(tmp);
- else car = strval(tmp);
- if(car < 400 || car > 611)
- return SendClientMessage(playerid, GREY, "Invalid car ID/Name");
- if(!strlen(tmp2))
- color1 = random(126);
- else color1 = strval(tmp2);
- if(!strlen(tmp3))
- color2 = random(126);
- else color2 = strval(tmp3);
- new vID;
- new Float:x, Float:y, Float:z, Float:angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- new interior = GetPlayerInterior(playerid);
- vID = CreateVehicle(car, x+3,y,z, angle, color1, color2, -1);
- LinkVehicleToInterior(vID, interior);
- format(string, 128, "[VEHICLE SPAWNED] %s || MODEL: %d || COLORS: %d, %d -|", VehicleNames[car-400], car, color1, color2);
- SendClientMessage(playerid, YELLOW, string);
- AdminCommand(playerid, "V");
- return 1;
- }
- CMD:spawnvehicle(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[256];
- new Index;
- tmp = strtok(params, Index);
- new car = strval(tmp);
- SetVehicleToRespawn(car);
- SendClientMessage(playerid, YELLOW, "Vehicle spawned!");
- AdminCommand(playerid, "SPAWNVEHICLE");
- return 1;
- }
- CMD:deletevehicle(playerid, params[])
- {
- if(PInfo[playerid][Level] < 2)
- return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
- new tmp[256];
- new Index;
- tmp = strtok(params, Index);
- new car = strval(tmp);
- EraseVeh(car);
- SendClientMessage(playerid, YELLOW, "Vehicle deleted!");
- AdminCommand(playerid, "DELETEVEHICLE");
- return 1;
- }
- CMD:sv(playerid, params[])
- {
- return cmd_spawnvehicle(playerid, params);
- }
- CMD:dv(playerid, params[])
- {
- return cmd_deletevehicle(playerid, params);
- }
- CMD:skinall(playerid, params[])
- {
- if(PInfo[playerid][Level] < 5)
- return SendClientMessage(playerid, ORANGE, "You need to be level 5+ to use this command");
- new tmp[256];
- new Index;
- tmp = strtok(params, Index);
- new skin = strval(tmp);
- if(isnull(tmp))
- return SendClientMessage(playerid, GREY, "USAGE: /skinall <Skin>");
- if(!IsValidSkin(skin))
- return SendClientMessage(playerid, GREY, "ERROR: Invaild Skin ID!");
- new string[128];
- new aName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
- format(string, 128, "Administrator %s has set everyone's skin to %d", aName, skin);
- SendClientMessageToAll(YELLOW, string);
- foreach(Player, i)
- {
- if(IsPlayerConnected(i))
- {
- SetPlayerSkin(i, skin);
- }
- }
- AdminCommand(playerid, "SKINALL");
- return 1;
- }
- CMD:ahelp(playerid, params[])
- {
- #pragma unused params
- if(PInfo[playerid][Level] == 1)
- {
- SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
- }
- else if(PInfo[playerid][Level] == 2)
- {
- SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
- SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
- }
- else if(PInfo[playerid][Level] == 3)
- {
- SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
- SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
- SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
- }
- else if(PInfo[playerid][Level] == 4)
- {
- SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
- SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
- SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
- SendClientMessage(playerid, WHITE, "Level 4 commands: healall, armorall, setscore, givescore, setskin");
- }
- else if(PInfo[playerid][Level] >= 5)
- {
- SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
- SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
- SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
- SendClientMessage(playerid, WHITE, "Level 4 commands: healall, armorall, setscore, givescore, setskin");
- SendClientMessage(playerid, WHITE, "Level 5+ commands: setlevel, gmx, skinall");
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(PInfo[playerid][AdminDuty] == 1)
- {
- label[playerid] = Create3DTextLabel("On-Duty admin, do not attack",0x008080FF,30.0,40.0,50.0,40.0,0);
- Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
- SetPlayerSkin(playerid, 217);
- SetPlayerHealth(playerid, 10000);
- GivePlayerWeapon(playerid, WEAPON_MINIGUN, 100000);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_CROUCH)
- {
- if(PInfo[playerid][Spectate] == 1)
- {
- TogglePlayerSpectating(playerid, 0);
- PInfo[playerid][Spectate] = 0;
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(text[0] == '#' || text[0] == '.' && PInfo[playerid][Level] >= 1)
- {
- new string[128];
- GetPlayerName(playerid, string, 128);
- format(string,sizeof(string),"[ADMIN CHAT] %s: %s",string,text[1]);
- foreach(Player, i)
- {
- if(PInfo[i][Level] >= 1)
- SendClientMessage(playerid, WHITE, string);
- }
- return 0;
- }
- if(PInfo[playerid][Muted] == 1)
- {
- SendClientMessage(playerid, GREY, "You cannot talk while muted!");
- return 0;
- }
- if(PInfo[playerid][AdminDuty] == 1)
- {
- new string[128];
- GetPlayerName(playerid, string, 128);
- format(string, 128, "Admin %s: %s", string, text);
- SendClientMessageToAll(LIGHTBLUE, string);
- return 0;
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- if(PInfo[playerid][Logged] == 0)
- {
- SendClientMessage(playerid, ORANGE, "You need to be logged in before spawning");
- return 0;
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PInfo[playerid][Deaths]++;
- PInfo[killerid][Kills]++;
- return 1;
- }
- public ServerBot()
- {
- new string[128];
- foreach(Player, i)
- {
- new pName[MAX_PLAYER_NAME];
- GetPlayerName(i, pName, MAX_PLAYER_NAME);
- if(GetPlayerPing(i) > MAX_PING && GetPlayerPing(i) < 2500)
- {
- format(string, 128, "[SERVER BOT] %s has been kicked from the server || Reason: High Ping (%d), Max allowed (%d)",pName, GetPlayerPing(i), MAX_PING);
- SendClientMessageToAll(GREY, string);
- Kick(i);
- }
- if(GetPlayerWeapon(i) == WEAPON_MINIGUN && PInfo[i][Level] < 1)
- {
- format(string, 128, "[SERVER BOT] %s has been banned from the server || Reason: Weapon hack", pName);
- SendClientMessageToAll(GREY, string);
- BanEx(i, "Weapon hack");
- }
- }
- return 1;
- }
- public God(playerid)
- {
- SetPlayerHealth(playerid, 10000);
- if(IsPlayerInAnyVehicle(playerid))
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- RepairVehicle(vehicleid);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement