Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- //INCLUDES
- #include <a_samp>
- #include <YSI\y_ini>
- #include <streamer>
- #include <sscanf2>
- #include <zcmd>
- #include <foreach>
- //==============================================================================
- //Teams
- #define TEAM_GROVE 1
- #define TEAM_BALLAS 2
- #define TEAM_VAGOS 3
- #define TEAM_AZTECAS 4
- #define TEAM_TRIADS 5
- #define TEAM_MAFIA 6
- #define TEAM_HOBO 7
- #define TEAM_GROVE_COLOR 0x33AA33AA//GREEN 1 change ltr :P
- #define TEAM_BALLAS_COLOR 0x800080FF//Purple 2
- #define TEAM_VAGOS_COLOR 0xFFFFFFAA//Yellow 3
- #define TEAM_TRIADS_COLOR 0xFF0000FF//RED 4
- #define TEAM_AZTECAS_COLOR 0x33CCFFAA//LightBlue 5
- #define TEAM_MAFIA_COLOR 0x000000AA//BLACK 6
- #define TEAM_HOBO_COLOR 0xAFAFAFAA//Grey 7
- //==============================================================================
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xFF0000FF
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_ORANGE 0xFF9900AA
- //==============================================================================
- #define GREY 0xAFAFAFAA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_PURPLE 0x800080FF
- #define COLOR_YELLOW 0xFFFFFFAA
- //==============================================================================
- //DIALOGS
- #define DIALOG_REGISTER 1
- #define DIALOG_LOGIN 2
- #define DIALOG_CMDS 3
- #define DIALOG_ACMDS 4
- //==============================================================================
- #define PATH "/Users/%s.ini"
- //==============================================================================
- #define COL_WHITE "{FFFFFF}"
- #define COL_RED "{F81414}"
- #define COL_GREEN "{00FF22}"
- #define COL_LIGHTBLUE "{00CED1}"
- //==============================================================================
- enum pInfo
- {
- pPass,
- pCash,
- pAdmin,
- pWarns,
- pKills,
- pBanned,
- pDeaths
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- forward LoadUser_data(playerid,name[],value[]);
- public LoadUser_data(playerid,name[],value[])
- {
- INI_Int("Password",PlayerInfo[playerid][pPass]);
- INI_Int("Cash",PlayerInfo[playerid][pCash]);
- INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
- INI_Int("Kills",PlayerInfo[playerid][pKills]);
- INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
- return 1;
- }
- stock UserPath(playerid)
- {
- new string[128],playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- format(string,sizeof(string),PATH,playername);
- return string;
- }
- stock SendAdminMessage(color,const astring[])
- {
- foreach(Player, i)
- {
- if(GetPlayerState(i) != PLAYER_STATE_NONE)
- {
- if(IsPlayerAdmin(i))
- {
- SendClientMessage(i, color, astring);
- }
- else if(PlayerInfo[i][pAdmin] >= 1)
- {
- SendClientMessage(i, color, astring);
- }
- }
- }
- return 1;
- }
- /*Credits to Dracoblue*/
- stock udb_hash(buf[]) {
- new length=strlen(buf);
- new s1 = 1;
- new s2 = 0;
- new n;
- for (n=0; n<length; n++)
- {
- s1 = (s1 + buf[n]) % 65521;
- s2 = (s2 + s1) % 65521;
- }
- return (s2 << 16) + s1;
- }
- main(){}
- new InDM[MAX_PLAYERS];
- new Dead[MAX_PLAYERS];
- new gTeam[MAX_PLAYERS];
- new IsOnduty[MAX_PLAYERS];
- new fstr[200];
- new grider[MAX_PLAYERS][5];
- new IsMuted[MAX_PLAYERS];
- //==============================================================================
- public OnGameModeInit()
- {
- SetGameModeText("GangWars v1.1");
- DisableInteriorEnterExits();
- //GROVE
- AddPlayerClass(105,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
- AddPlayerClass(106,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
- AddPlayerClass(107,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
- AddPlayerClass(149,2497.5190,-1646.3367,13.5405,157.9393,0,0,0,0,0,0);
- //BALLAS
- AddPlayerClass(102,2157.4441,-1612.4562,14.2938,202.2420,0,0,0,0,0,0);
- AddPlayerClass(103,2166.7832,-1613.4037,14.3594,163.3884,0,0,0,0,0,0);
- AddPlayerClass(104,2142.4939,-1641.6448,14.8686,308.1265,0,0,0,0,0,0);
- //VAGOS
- AddPlayerClass(108,2256.0142,-1333.7314,23.9817,229.5982,0,0,0,0,0,0);
- AddPlayerClass(109,2263.1296,-1336.2548,23.9845,259.0517,0,0,0,0,0,0);
- AddPlayerClass(110,2264.0396,-1346.9767,23.9832,325.7923,0,0,0,0,0,0);
- //AZTECAS
- AddPlayerClass(114,2685.0576,-1428.3448,30.5107,93.2903,0,0,0,0,0,0);
- AddPlayerClass(115,2667.0266,-1444.2384,30.5259,317.3023,0,0,0,0,0,0);
- AddPlayerClass(116,2670.7781,-1457.7408,30.5485,358.9526,0,0,0,0,0,0);
- //TRIADS
- AddPlayerClass(117,2261.2849,-1904.8745,14.9375,10.2138,0,0,0,0,0,0);
- AddPlayerClass(118,2283.6514,-1902.6400,13.5670,359.8502,0,0,0,0,0,0);
- AddPlayerClass(120,2269.5051,-1882.6860,14.2344,162.1349,0,0,0,0,0,0);
- //MAFIA
- AddPlayerClass(111,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
- AddPlayerClass(112,1949.8657,-1558.8053,13.6318,176.1411,0,0,0,0,0,0);
- AddPlayerClass(113,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
- AddPlayerClass(124,1936.9249,-1584.0172,13.5708,179.6112,0,0,0,0,0,0);
- AddPlayerClass(125,1949.8657,-1558.8053,13.6318,176.1411,0,0,0,0,0,0);
- AddPlayerClass(126,1961.5153,-1634.1903,15.9612,87.1536,0,0,0,0,0,0);
- AddPlayerClass(127,1961.5153,-1634.1903,15.9612,87.1536,0,0,0,0,0,0);
- //Hobo
- AddPlayerClass(230,2304.4458,-1785.9780,13.5575,15.7005,0,0,0,0,0,0);
- AddPlayerClass(137,2292.6584,-1796.5696,13.5469,345.6202,0,0,0,0,0,0);
- //GROVE Cars
- AddStaticVehicleEx(567,2490.7607,-1683.4261,13.2885,275.3206,86,86,8000);//Low Rider
- AddStaticVehicleEx(541,2518.4236,-1663.8990,13.7979,95.7908,86,86,8000);//Bullet
- AddStaticVehicleEx(541,2518.8640,-1668.4261,14.0463,93.7776,86,86,8000);//Bullet
- AddStaticVehicleEx(504,2506.6702,-1651.1348,13.4935,139.6581,86,86,8000);//Bloodring
- AddStaticVehicleEx(495,2488.6318,-1653.7251,13.7581,85.0858,86,86,8000);//SandKing
- AddStaticVehicleEx(411,2511.6003,-1688.5813,13.2796,45.3268,86,86,8000); //Infernus
- AddStaticVehicleEx(463,2514.0093,-1680.2672,13.0241,46.1333,86,86,8000); //Nrg-500 current a freeway
- //BALLAS Cars
- AddStaticVehicleEx(522,2167.9104,-1654.8807,14.6948,320.7073,211,211,8000);//Nrg-500
- AddStaticVehicleEx(494,2177.3792,-1642.8383,14.8432,251.8386,211,211,8000);//HotRing Racer
- AddStaticVehicleEx(494,2180.1619,-1632.6628,14.8439,256.4447,211,211,8000);//HotRing Racer
- AddStaticVehicleEx(411,2150.6958,-1637.5159,13.4757,274.4271,211,211,8000);//Infernus
- AddStaticVehicleEx(451,2154.2903,-1624.8654,13.3870,250.3402,211,211,8000);//Turismo
- //VAGOS Cars
- AddStaticVehicleEx(541,2275.5583,-1332.6943,23.5293,179.8865,6,6,8000);//Bullet
- AddStaticVehicleEx(451,2266.3171,-1332.6750,23.5226,179.8358,6,6,8000);//Turismo
- AddStaticVehicleEx(411,2266.3440,-1348.3184,23.5278,179.7608,6,6,8000);//Infernus
- AddStaticVehicleEx(411,2275.5525,-1348.3644,23.5415,179.8123,6,6,8000);//Infernus
- AddStaticVehicleEx(522,2261.6194,-1344.1903,23.5949,180.7501,6,6,8000);//Nrg-500
- //AZTECAS Cars
- AddStaticVehicleEx(541,2673.2263,-1442.2036,30.0715,357.3026,135,135,8000);//Bullet
- AddStaticVehicleEx(411,2672.4028,-1458.9976,30.0891,356.8409,135,135,8000);//Infernus
- AddStaticVehicleEx(451,2682.4988,-1445.3346,30.0750,355.7568,135,135,8000);//Turismo
- AddStaticVehicleEx(429,2681.5261,-1458.8330,30.0878,356.1672,135,135,8000);//Banshee
- //TRIADS Cars
- AddStaticVehicleEx(411,2273.0483,-1908.1461,13.2538,1.4100,3,3,8000);//Infernus
- AddStaticVehicleEx(451,2249.7756,-1908.6405,13.2534,359.0685,3,3,8000);//Turismo
- AddStaticVehicleEx(522,2255.9285,-1878.6984,13.8403,182.0271,3,3,8000);//Nrg-500
- AddStaticVehicleEx(522,2282.9189,-1877.9165,13.8419,179.1341,3,3,8000);//Nrg-500
- AddStaticVehicleEx(415,2265.0911,-1889.5537,13.1250,90.8826,3,3,8000);//Cheetah
- AddStaticVehicleEx(429,2259.4453,-1899.7599,13.1558,91.9257,3,3,8000);//Banshee
- //MAFIA Cars
- AddStaticVehicleEx(451,2299.2148,-1747.0513,13.2531,271.0845,0,0,8000);//Turismo
- AddStaticVehicleEx(451,2299.0151,-1737.2966,13.2481,271.1233,0,0,8000);//Turismo
- AddStaticVehicleEx(411,2285.9077,-1754.2102,13.2536,271.4731,0,0,8000);//Infernus
- AddStaticVehicleEx(522,2277.7419,-1747.4136,13.2530,267.4197,0,0,8000);//Infernus
- AddStaticVehicleEx(504,2278.4419,-1737.4795,13.2531,270.3918,0,0,8000);//BloodRing
- //Hobo Cars
- AddStaticVehicleEx(411,1932.3667,-1585.1436,13.2719,179.6139,252,252,8000);//Infernus
- AddStaticVehicleEx(411,1940.6488,-1585.1996,13.2795,179.6146,252,252,8000);//Infernus
- AddStaticVehicleEx(429,1936.3250,-1560.2512,13.3152,223.7088,252,252,8000);//Banshee
- AddStaticVehicleEx(541,1935.9469,-1625.7687,13.1686,180.2713,252,252,8000);//Bullet
- AddStaticVehicleEx(451,1946.2505,-1630.8336,13.1684,179.2144,252,252,8000);//Turismo
- AddStaticVehicleEx(522,1947.2510,-1576.2006,13.1902,134.4855,252,252,8000);//Nrg-500
- AddStaticVehicleEx(522,1970.9478,-1619.1942,15.5774,266.9412,252,252,8000);//Nrg-500
- return 1;
- }
- //==============================================================================
- public OnGameModeExit()
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerTeamFromClass(playerid, classid);
- SetPlayerInterior(playerid, 6);
- SetPlayerPos(playerid, 345.5598,301.1534,999.9382);
- SetPlayerFacingAngle(playerid, 0.9177);
- SetPlayerCameraLookAt(playerid, 345.5598,301.1534,999.9382);
- SetPlayerCameraPos(playerid, 345.5598 + (5 * floatsin(-0.6528, degrees)), 301.1534 + (5 * floatcos(-0.6528, degrees)), 999.9382);
- switch (classid)
- {
- case 0..3://GROVE
- {
- if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
- {
- GameTextForPlayer(playerid,"~g~Grove Street",4000,4);
- }
- }
- case 4..6://BALLAS
- {
- if(classid == 4 || classid == 5 || classid == 6)
- {
- GameTextForPlayer(playerid,"~p~BALLAS",4000,4);
- }
- }
- case 7..9://Vagos
- {
- if(classid == 7 || classid == 8 || classid == 9)
- {
- GameTextForPlayer(playerid,"~y~Vagos",4000,4);
- }
- }
- case 10..12://AZTECAS
- {
- if(classid == 10 || classid == 11 || classid == 12)
- {
- GameTextForPlayer(playerid,"~b~AZTECAS",4000,4);
- }
- }
- case 13..15:
- {
- if(classid == 13 || classid == 14 || classid == 15)
- {
- GameTextForPlayer(playerid,"~r~TRIADS",4000,4);
- }
- }
- case 16..22:
- {
- if(classid == 16 || classid == 17 || classid == 18 || classid == 19 || classid == 20 || classid == 21 || classid == 22)
- {
- GameTextForPlayer(playerid,"~w~MAFIA",4000,4);
- }
- }
- case 23..24:
- {
- if(classid == 23 || classid == 24)
- {
- GameTextForPlayer(playerid,"~l~Hobo",4000,4);
- }
- }
- }
- ApplyAnimation(playerid, "CAMERA", "CAMSTND_CMON", 4.1, false, false, false, false, 0, false); // 2
- ApplyAnimation(playerid, "CRIB", "PED_CONSOLE_WIN", 4.1, false, false, false, false, 0, false);
- ApplyAnimation(playerid, "CRIB", "PED_CONSOLE_LOOP", 4.1, false, false, false, false, 0, false); // 3
- return 1;
- }
- //==============================================================================
- public OnPlayerConnect(playerid)
- {
- if(fexist(UserPath(playerid)))
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_LIGHTBLUE"Account Registration",""COL_WHITE"Welcome To Los Santos Street Wars\nEnter a password below to register a new account...","Register","Quit");
- }
- SendClientMessage(playerid, GREY, "Welcome To Los Santos Street Wars.");
- SendClientMessage(playerid, -1, "{FFFFFF}_____________________________________________________________________________________________________________");
- SendClientMessage(playerid, -1, "{FF0000}Warning: {a9c4e4}The Concept In This Server And GTA in general maybe considered Explicit Material.");
- SendClientMessage(playerid, -1, "{a9c4e4}Visit Our Website For More Information and Community forums.");
- SendClientMessage(playerid, -1, "{FFFFFF}_____________________________________________________________________________________________________________");
- InDM[playerid] = 0;
- new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s [%d] has joined the Server.",pname,playerid);
- SendClientMessageToAll(0xAAAAAAAA, string);
- return 1;
- }
- //==============================================================================
- public OnPlayerDisconnect(playerid, reason)
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_Close(File);
- new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- switch(reason)
- {
- case 0: format(string, sizeof(string), "%s [%d] has left the Server. (Timeout / Crash).", pname,playerid);
- case 1: format(string, sizeof(string), "%s [%d] has left the Server. (Leaving / Quit).", pname,playerid);
- case 2: format(string, sizeof(string), "%s [%d] has left the Server. (Kicked / Banned).", pname,playerid);
- }
- SendClientMessageToAll(0xAAAAAAAA, string);
- return 1;
- }
- //==============================================================================
- public OnPlayerSpawn(playerid)
- {
- SetPlayerToTeamColor(playerid);
- SetPlayerInterior(playerid, 0);
- SetPlayerArmour(playerid,100);
- SetPlayerScore(playerid,5);
- GivePlayerWeapon(playerid,31,204);
- GivePlayerWeapon(playerid,25,104);
- GivePlayerWeapon(playerid,24,104);
- if(Dead[playerid] == 1)
- {
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- Dead[playerid] = 0;
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
- {
- // antiteamkill
- new Float:Health;
- GetPlayerHealth(playerid, Health);
- if(gTeam[issuerid] == gTeam[playerid])
- {
- GetPlayerHealth(playerid, Health);
- SetPlayerHealth(playerid, Health+amount);
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerDeath(playerid, killerid, reason)
- {
- PlayerInfo[killerid][pKills]++;
- PlayerInfo[playerid][pDeaths]++;
- SendDeathMessage(killerid, playerid, reason);
- return 1;
- }
- //==============================================================================
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerText(playerid, text[])
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mycommand", cmdtext, true, 10) == 0)
- {
- // Do something here
- 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;
- }
- //==============================================================================
- SetPlayerTeamFromClass(playerid, classid)
- {
- if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
- {
- gTeam[playerid] = TEAM_GROVE;
- }
- else if(classid == 4 || classid == 5 || classid == 6)
- {
- gTeam[playerid] = TEAM_BALLAS;
- }
- else if(classid == 7 || classid == 8 || classid == 9)
- {
- gTeam[playerid] = TEAM_VAGOS;
- }
- else if(classid == 10 || classid == 11 || classid == 12)
- {
- gTeam[playerid] = TEAM_AZTECAS;
- }
- else if(classid == 13 || classid == 14 || classid == 15)
- {
- gTeam[playerid] = TEAM_TRIADS;
- }
- else if(classid == 16 || classid == 17 || classid == 18 || classid == 19 || classid == 20 || classid == 21)
- {
- gTeam[playerid] = TEAM_MAFIA;
- }
- else if(classid == 22 || classid == 23)
- {
- gTeam[playerid] = TEAM_HOBO;
- }
- return 1;
- }
- //==============================================================================
- SetPlayerToTeamColor(playerid)
- {
- if (gTeam[playerid] == TEAM_GROVE)
- {
- SetPlayerColor(playerid, TEAM_GROVE_COLOR);
- }
- else if (gTeam[playerid] == TEAM_BALLAS)
- {
- SetPlayerColor(playerid, TEAM_BALLAS_COLOR);
- }
- else if (gTeam[playerid] == TEAM_VAGOS)
- {
- SetPlayerColor(playerid, TEAM_VAGOS_COLOR);
- }
- else if (gTeam[playerid] == TEAM_AZTECAS)
- {
- SetPlayerColor(playerid, TEAM_AZTECAS_COLOR);
- }
- else if (gTeam[playerid] == TEAM_TRIADS)
- {
- SetPlayerColor(playerid, TEAM_TRIADS_COLOR);
- }
- else if (gTeam[playerid] == TEAM_MAFIA)
- {
- SetPlayerColor(playerid, TEAM_MAFIA_COLOR);
- }
- else if (gTeam[playerid] == TEAM_HOBO)
- {
- SetPlayerColor(playerid, TEAM_HOBO_COLOR);
- }
- }
- //==============================================================================
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_REGISTER)
- {
- if (!response) return Kick(playerid);
- if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_LIGHTBLUE"Account Registration",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Password",udb_hash(inputtext));
- INI_WriteInt(File,"Cash",0);
- INI_WriteInt(File,"Admin",0);
- INI_WriteInt(File,"Kills",0);
- INI_WriteInt(File,"Deaths",0);
- INI_Close(File);
- }
- else if(dialogid == DIALOG_LOGIN)
- {
- if ( !response ) return Kick ( playerid );
- if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
- {
- INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- }
- }
- else if(dialogid == DIALOG_ACMDS)
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 1", "/ban /kick /warn /duty /mute /unmute", "Close", "");
- }
- case 1:
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
- ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 2", "/sethealth /setarmour /goto /get /ac /ip /fix", "Close", "");
- }
- case 2:
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
- ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Admin Level 3", "/givecash /jetpack /removejetpack /freeze /unfreeze ", "Close", "");
- }
- }
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(!success) SendClientMessage(playerid, -1, "{FFFFFF} I dont know that command type /cmds for a list of Commands.");
- return 1;
- }
- //==============================================================================
- //*******************************End Of Script**********************************
- //=====================================================Commands=================
- //General Commands
- CMD:changeteam(playerid) //Cmd to change your team
- {
- SetPlayerHealth(playerid, 0.0);
- ForceClassSelection(playerid);
- return 1;
- }
- CMD:kill(playerid) // CMD to commit a suicide
- {
- SetPlayerHealth(playerid, 0);
- return 1;
- }
- CMD:pm(playerid, params[])
- {
- new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
- if(sscanf(params, "us", id, str2))
- {
- SendClientMessage(playerid, 0xFFFF00AA, "Usage: /pm <Name/Id> <message>");
- return 1;
- }
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "[ERROR]: Player not connected");
- if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "[ERROR]: You cannot PM yourself!");
- {
- GetPlayerName(playerid, Name1, sizeof(Name1));
- GetPlayerName(id, Name2, sizeof(Name2));
- format(str, sizeof(str), "PM Sent To %s(ID %d): %s", Name2, id, str2);
- SendClientMessage(playerid, 0xFFFF00AA, str);
- format(str, sizeof(str), "From %s(ID %d): %s", Name1, playerid, str2);
- SendClientMessage(id, 0xFFFF00AA, str);
- new astring[100];
- format(astring, sizeof(astring),"PM: %s [%d] to %s [%d]: %s", GetName(playerid), playerid, GetName(id), id, str);
- SendAdminMessage(GREY, astring);
- }
- return 1;
- }
- CMD:arena(playerid, params[])
- {
- InDM[playerid] = 1;
- SetPlayerPos(playerid, -975.975708,1060.983032,1345.671875);
- SetPlayerInterior(playerid, 10);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerFacingAngle(playerid, 89.1282);
- SetCameraBehindPlayer(playerid);
- SetPlayerArmour(playerid,100);
- SetPlayerHealth(playerid,100);
- SetPlayerTeam(playerid, playerid);
- SendClientMessage(playerid, -1, "{FFFFFF}[Arena]:{a9c4e4}You Have Join The Arena Type /qarena To Exit.");
- return 1;
- }
- CMD:qarena(playerid, params[])
- {
- if(InDM[playerid] == 0)
- {
- SendClientMessage(playerid, -1, "[Arena]:{a9c4e4}You are not at the DM arena!");
- return 1;
- }
- else if(InDM[playerid] == 1)
- {
- InDM[playerid] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerHealth(playerid, 0.00);
- SetPlayerInterior(playerid, 0);
- SendClientMessage(playerid, -1, "[Arena]:{a9c4e4}You have left the DM arena!");
- return 1;
- }
- return 1;
- }
- CMD:cmds(playerid, params[])
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "{a9c4e4}General Commands", "{FFFFFF}/changeteam /kill /pm /arena /qarena", "Close", "");
- return 1;
- }
- //=============================================================================
- //===================================ADMIN COMMANDS============================
- //Rcon login commands
- CMD:setlevel(playerid, params[])
- {
- new level, id;
- if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /setlevel [name/id] [level]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- if(IsPlayerAdmin(playerid))
- {
- PlayerInfo[id][pAdmin] = level;
- PlayerPlaySound(id,1085,0.0,0.0,0.0);
- format(fstr, sizeof(fstr), "You have set %s [%d] admin level to %d.", GetName(id), id, level);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- format(fstr, sizeof(fstr), "Admin %s [%d] has set your admin level to %d.", GetName(playerid), playerid, level);
- SendClientMessage(id, COLOR_LIGHTBLUE, fstr);
- }
- else if(PlayerInfo[playerid][pAdmin] == 4)
- {
- PlayerInfo[id][pAdmin] = level;
- PlayerPlaySound(id,1085,0.0,0.0,0.0);
- format(fstr, sizeof(fstr), "You have set %s [%d] admin level to %d.", GetName(id), id, level);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- format(fstr, sizeof(fstr), "Admin %s [%d] has set your admin level to %d.", GetName(playerid), playerid, level);
- SendClientMessage(id, COLOR_LIGHTBLUE, fstr);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Only Rcon Login Admins can use this command.");
- }
- return true;
- }
- //Admin Level 1 Commands
- //==============================================================================
- CMD:acmds(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_LIST, "{FFFFFF}Admin Commands", "{FFFFFF}Admin Level 1\n{a9c4e4}Admin Level 2\n{FF0000}Admin Level 3", "Ok", "Cancel");
- return 1;
- }
- CMD:ban(playerid, params[]) // CMD for banning someone
- {
- new pid;
- new str[128];
- new reason;
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- if(sscanf(params,"us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [Player ID] [Reason]");
- {
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if(PlayerInfo[playerid][pAdmin]<=PlayerInfo[pid][pAdmin]) return SendClientMessage(playerid, COLOR_RED, "That admin has an higher admin rank, therefor you can't ban him!");
- if(playerid==pid) return SendClientMessage(playerid, COLOR_RED, "You can't ban yourself!");
- format(str, sizeof(str), "You have banned %s. Reason: %s", GetName(pid), reason);
- SendClientMessage(playerid, COLOR_PURPLE, str);
- format(str, sizeof(str), "ADMCMD: %s have been banned from Lssw. Reason:(%s)", GetName(pid), GetName(playerid), reason );
- SendClientMessageToAll(COLOR_RED, str);
- PlayerInfo[pid][pBanned] = 1;
- Kick(pid);
- new astring[64];
- format(astring, sizeof(astring),"%s [%d] typed: /ban %s", GetName(playerid), playerid);
- SendAdminMessage(GREY, astring);
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new
- pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
- return pName;
- }
- CMD:kick(playerid, params[]) // CMD for unbanning someone
- {
- new pid;
- new str[128];
- new reason;
- if(sscanf(params,"us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [Player ID] [Reason]");
- if (PlayerInfo[playerid][pAdmin]>=1)
- {
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if(PlayerInfo[playerid][pAdmin]<=PlayerInfo[pid][pAdmin]) return SendClientMessage(playerid, COLOR_RED, "PlayerID is higher admin rank, can't kick him!");
- format(str, sizeof(str), "You have kicked %s. Reason: %s", GetName(pid), reason);
- SendClientMessage(playerid, COLOR_RED, str);
- format(str, sizeof(str), "%s have been kicked by %s. Reason: %s", GetName(pid), GetName(playerid), reason);
- SendClientMessage(playerid, COLOR_BLUE, str);
- Kick(playerid);
- }
- return 1;
- }
- CMD:warn(playerid, params[]) // CMD for warning someone
- {
- new pid;
- new str[128];
- new reason;
- if(sscanf(params, "us", pid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /warn [Player ID] [Reason]");
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if(PlayerInfo[playerid][pAdmin]>=1)
- {
- if(PlayerInfo[pid][pAdmin]>=PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_WHITE, "You can't warn this player: he's higher admin rank!");
- if(PlayerInfo[pid][pWarns]>=3)
- {
- PlayerInfo[pid][pWarns]++;
- PlayerInfo[pid][pBanned]++;
- format(str, sizeof(str), "ADMCMD: %s has been warned by an %s. Reason: %s", GetName(pid), GetName(playerid), reason);
- SendClientMessageToAll(COLOR_PURPLE, str);
- format(str, sizeof(str), "AUTO-BAN: %s has been automatically banned. Reason: Too much warnings.", GetName(pid));
- SendClientMessageToAll(COLOR_PURPLE, str);
- Kick(pid);
- }
- else
- {
- PlayerInfo[pid][pWarns]++;
- format(str, sizeof(str), "ADMCMD: %s has been warned by an %s. Reason: %s", GetName(pid), GetName(playerid), reason);
- SendClientMessageToAll(COLOR_PURPLE, str);
- }
- }
- return 1;
- }
- CMD:duty(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- if(PlayerInfo[playerid][pAdmin] >= 1 && IsOnduty{playerid} == 0)
- {
- IsOnduty{playerid} = 1;
- SetPlayerHealth(playerid,9999999.0);
- SetPlayerArmour(playerid,9999999.0);
- GivePlayerWeapon(playerid,38,999999);
- grider[playerid][2] = CreateObject(18693, 0.0, 0.0, 0.0, 0.0, 0.0, 256.0);
- AttachObjectToPlayer(grider[playerid][2], playerid, 0.0, -0.01, -0.9, 0.0, 0.0, 0.0);
- }
- else if( IsOnduty{playerid} == 1)
- {
- IsOnduty{playerid} = 0;
- ResetPlayerWeapons(playerid);
- SetPlayerHealth(playerid, 100.0);
- SetPlayerArmour(playerid, 100.0);
- }
- return 1;
- }
- CMD:mute(playerid, params[])
- {
- new muteid, reason[24];
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- if(sscanf(params, "us[24]", muteid, reason)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /mute [name/id] [reason]");
- if(strlen(reason) < 1 || strlen(reason) > 24) return SendClientMessage(playerid, COLOR_RED, "Your reason can only contain 1-24 characters.");
- if(muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- if(muteid == playerid) return SendClientMessage(playerid, COLOR_RED, "You cant mute yourself.");
- if(PlayerInfo[muteid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_RED, "You cant mute admins.");
- {
- IsMuted{muteid} = 1;
- GameTextForPlayer(muteid,"~r~Muted", 3000, 5);
- format(fstr, sizeof(fstr), "Admin %s [%d] has muted you - Reason: %s", GetName(playerid), playerid, reason);
- SendClientMessage(muteid, COLOR_RED, fstr);
- format(fstr, sizeof(fstr), "You have muted %s [%d] - Reason: %s", GetName(muteid), muteid, reason);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- new astring[100];
- format(astring, sizeof(astring), "Admin %s [%d] has muted %s [%d] - Reason: %s", GetName(playerid), playerid, GetName(muteid), muteid, reason);
- SendAdminMessage(GREY, astring);
- }
- return 1;
- }
- CMD:unmute(playerid, params[])
- {
- new muteid;
- if(sscanf(params, "u", muteid)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /unmute [name/id]");
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- if(muteid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- {
- IsMuted{muteid} = 0;
- GameTextForPlayer(muteid,"~g~Unmuted", 3000, 5);
- format(fstr, sizeof(fstr), "Admin %s [%d] has unmuted you.", GetName(playerid), playerid);
- SendClientMessage(muteid, COLOR_LIGHTBLUE, fstr);
- format(fstr, sizeof(fstr), "You have unmuted %s [%d]", GetName(muteid), muteid);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- new astring[100];
- format(astring, sizeof(astring), "Admin %s [%d] has unmuted %s [%d]", GetName(playerid), playerid, GetName(muteid), muteid);
- SendAdminMessage(GREY, astring);
- }
- return true;
- }
- //Admin Level 2 commands
- //====================================================
- CMD:sethealth(playerid, params[]) // CMD for setting someone his health
- {
- new amount;
- new pid;
- new str[128];
- if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethealth [Player ID] [Amount]");
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if (PlayerInfo[playerid][pAdmin]>=2)
- {
- SetPlayerHealth(pid, amount);
- format(str, sizeof(str), "Your health has been set to %i by an Admin!", amount);
- SendClientMessage(pid, COLOR_RED, str);
- format(str, sizeof(str), "You just set %s's health to %i.", GetName(pid), amount);
- SendClientMessage(playerid, COLOR_RED, str);
- }
- else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be an Admin Level 2+ to use this command!");
- return 1;
- }
- CMD:setarmour(playerid, params[]) // CMD for setting someone his armour
- {
- new amount;
- new pid;
- new str[128];
- if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmour [Player ID] [Amount]");
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if (PlayerInfo[playerid][pAdmin]>=2)
- {
- SetPlayerArmour(pid, amount);
- format(str, sizeof(str), "An Admin has set your armour to %i!", amount);
- SendClientMessage(pid, COLOR_YELLOW, str);
- format(str, sizeof(str), "You just set %s's armour to %i.", GetName(pid), amount);
- SendClientMessage(playerid, COLOR_RED, str);
- }
- else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be an Admin Level 2+ to use this command!");
- return 1;
- }
- CMD:goto(playerid, params[]) // CMD to go to someone
- {
- new pid;
- if(IsPlayerConnected(pid))
- {
- if(PlayerInfo[playerid][pAdmin]>=2)
- {
- if(!sscanf(params, "ui", pid))
- {
- new string[64];
- new Float:x, Float:y, Float:z; GetPlayerPos(pid,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(pid));
- format(string, sizeof(string), "You teleported yourself to %s .", GetName(pid));
- SendClientMessage(playerid, COLOR_RED, string);
- SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(pid));
- SetPlayerPos(playerid,x+2,y,z);
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /goto [PlayerID/PartOfName]");
- }
- else return SendClientMessage(playerid, COLOR_RED, "You must be an admin to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- }
- CMD:get(playerid, params[]) // CMD to get someone to you
- {
- new pid;
- if(IsPlayerConnected(pid))
- {
- if(PlayerInfo[playerid][pAdmin]>=2)
- {
- if(!sscanf(params, "ui", pid))
- {
- new string[64];
- new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(pid,GetPlayerInterior(playerid));
- format(string, sizeof(string), "You teleported %s to you.", GetName(pid));
- SendClientMessage(playerid, COLOR_YELLOW, string);
- SetPlayerVirtualWorld(pid,GetPlayerVirtualWorld(playerid));
- SetPlayerPos(pid,x+2,y,z);
- return 1;
- }
- else return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /get [Name/PlayerID]");
- }
- else return SendClientMessage(playerid, COLOR_RED, "You must be an admin to use this command!");
- }
- else return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- }
- CMD:ac(playerid, params[])
- {
- new msg[30];
- if(sscanf(params, "s[30]", msg)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /a [msg]]");
- if(strlen(msg) < 1 || strlen(msg) > 30) return SendClientMessage(playerid, COLOR_RED, "Your message can only contain 1-30 characters.");
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 1+ can use this command.");
- {
- format(fstr, sizeof(fstr), "~w~%s", msg);
- GameTextForAll(fstr, 5000, 5);
- new astring[64];
- format(astring, sizeof(astring),"%s [%d] typed: /ann", GetName(playerid), playerid);
- SendAdminMessage(GREY, astring);
- }
- return 1;
- }
- CMD:ip(playerid, params[])
- {
- new targetid, ip[50];
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
- if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /ip [name/id]");
- if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- {
- GetPlayerIp(targetid, (ip),sizeof(ip));
- format(fstr, sizeof(fstr), "[IP]: %s [%d] - %s", GetName(targetid), targetid, ip);
- SendClientMessage(playerid, GREY, fstr);
- }
- return 1;
- }
- CMD:fix(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, "Only admin level 2+ can use this command.");
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED, "You need to be in a vehicle to use this command.");
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- GameTextForPlayer(playerid,"~w~Vehicle ~g~Repaired", 5000, 5);
- }
- new astring[100];
- format(astring, sizeof(astring), "%s [%d] typed: /afix", GetName(playerid), playerid);
- SendAdminMessage(GREY, astring);
- return 1;
- }
- //Admin Level 3 Commands
- //==============================================================================
- CMD:givecash(playerid, params[]) // CMD to give somebody some cash
- {
- new amount;
- new pid;
- new str[128];
- if(sscanf(params, "ui", pid, amount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [Player ID] [Amount]");
- if(!IsPlayerConnected(pid)) return SendClientMessage(playerid, COLOR_RED, "PlayerID is not connected.");
- if (PlayerInfo[playerid][pAdmin]>=3)
- {
- GivePlayerMoney(pid, amount);
- format(str, sizeof(str), "You have been granted $%i by an Admin!", amount);
- SendClientMessage(pid, COLOR_YELLOW, str);
- format(str, sizeof(str), "You just gave $%i to %s.", amount, GetName(pid));
- SendClientMessage(playerid, COLOR_GREEN, str);
- }
- else SendClientMessage(playerid, COLOR_RED, "SERVER: You must be Admin level 3+ To use this Command");
- return 1;
- }
- CMD:jetpack(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "IMPORTANT: Use /removejetpack when your done, DONT LET A PLAYER ACCESS THIS JETPACK!");
- format(fstr, sizeof(fstr), "Admin %s [%d] has spawned a jetpack.", GetName(playerid), playerid);
- SendAdminMessage(GREY, fstr);
- }
- return true;
- }
- CMD:removejetpack(playerid, params[])
- {
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
- {
- new Float:x, Float:y, Float:z, Float:ang;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, ang);
- new VehicleID = CreateVehicle(522, x, y, z, ang, -1, -1, -1);
- PutPlayerInVehicle(playerid, VehicleID, 0);
- SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
- LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
- ChangeVehicleColor(VehicleID,0,3);
- DestroyVehicle(GetPlayerVehicleID(playerid));
- }
- else
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE, "You do not have a jetpack.");
- }
- return 1;
- }
- CMD:freeze(playerid, params[])
- {
- new target, reason[24];
- if(sscanf(params, "us[24]", target, reason)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /freeze [name/id]");
- if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- if(PlayerInfo[target][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_RED, "You cant freeze admins higher rank than you.");
- {
- TogglePlayerControllable(target,false);
- GameTextForPlayer(target,"~r~Frozen", 3000, 5);
- format(fstr, sizeof(fstr), "Admin %s [%d] has frozen you", GetName(playerid), playerid);
- SendClientMessage(target, COLOR_RED, fstr);
- format(fstr, sizeof(fstr), "You have frozen %s [%d]", GetName(target), target);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- new astring[24];
- format(astring, sizeof(astring), "Admin %s [%d] has frozen %s [%d]", GetName(playerid), playerid, GetName(target), target);
- SendAdminMessage(GREY, astring);
- }
- return 1;
- }
- CMD:unfreeze(playerid, params[])
- {
- new target;
- if(sscanf(params, "u", target)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /unfreeze [name/id]");
- if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_RED, "Only admin level 3+ can use this command.");
- if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "Player not found.");
- {
- TogglePlayerControllable(target,true);
- GameTextForPlayer(target,"~g~Unfrozen", 3000, 5);
- format(fstr, sizeof(fstr), "Admin %s [%d] has unfrozen you.", GetName(playerid), playerid);
- SendClientMessage(target, COLOR_LIGHTBLUE, fstr);
- format(fstr, sizeof(fstr), "You have unfrozen %s [%d]", GetName(target), target);
- SendClientMessage(playerid, COLOR_YELLOW, fstr);
- new astring[100];
- format(astring, sizeof(astring), "Admin %s [%d] has unfrozen %s [%d]", GetName(playerid), playerid, GetName(target), target);
- SendAdminMessage(GREY, astring);
- }
- return true;
- }
- //==============================================================================
- CMD:objects(playerid,parmas[])
- {
- ShowPlayerDialog(playerid, 3, DIALOG_STYLE_MSGBOX, "{a9c4e4}Object Commands", "{FFFFFF}/penis /fire /clucker", "Close", ""); return 1;
- }
- CMD:penis(playerid,params[])
- {
- SetPlayerAttachedObject(playerid, 0, 19086, 6, 0.000000, 0.000000, 0.000000, 0.000000, -101.899971, 0.000000);
- return 1;
- }
- CMD:clucker(playerid,params[])
- {
- SetPlayerAttachedObject(playerid, 1, 19137, 2, 0.093000, 0.000000, 0.000000);
- return 1;
- }
- CMD:fire(playerid,params[])
- {
- SetPlayerAttachedObject(playerid, 3, 18688, 2, -0.134000, -0.157999, -1.584001, 0.000000, -7.199995, 0.000000);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement