Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //___________________________________________
- //DO NOT Delete credits!! |
- //By [HiC]Thekiller & [HiC]Cam! |
- //============================================
- //------ includes
- #include <a_samp>
- #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
- //-------levels!
- new LVL[MAX_PLAYERS], Score[MAX_PLAYERS];
- //-------Vehicles
- new hydra1,hydra2,hunter1,hunter2,rhyno,ss1,ss2,ss3;
- //-------Gang defines
- #define TEAM_Gangsta 1 //gang
- #define TEAM_Cops 2 //cops
- #define TEAM_Gangsta_COLOR 0x33AA33AA // Green
- #define TEAM_Cops_COLOR 0x0000FFAA //Blue
- new gTeam[MAX_PLAYERS];
- //-------Timers
- new tm1,tm2;
- //--------Renegede!
- new renegade;
- //--------Textdraw
- new Text:TextGa,Text:TextCp,Scop,Sgangsta;
- new Text:Textdraw2, Text:Textdraw3;
- //---------Area 51!
- new area51,Area51C,Area51G;
- new Float:Checkpoint ,Float:Checkpoint1, Float:Checkpoint2;
- //-------Special Spawn!
- new SpecialSpawn[MAX_PLAYERS];
- //-------spwan
- new Float:RandomSpawnGang[][4] =
- {
- {316.446594, 2530.556884, 16.378942, 69.271392},
- {278.986999, 2536.393798, 16.374141, 347.296722},
- {425.062469, 2436.829833, 16.065370, 237.485900}
- };
- new Float:RandomSpawnCops[][4] =
- {
- {-545.548706, 2586.130615, 53.515625, 170.062301},
- {-567.794860, 2575.760253, 53.934780, 77.668151},
- {-576.641967, 2613.563964, 53.515625, 18.763990}
- };
- //-------------Random Scores
- new RandomKill[][1] =
- {
- {8},
- {9},
- {10},
- {11},
- {12},
- {13},
- {15}
- };
- new RandomKillR[][1] =
- {
- {16},
- {18},
- {20},
- {22},
- {24},
- {26},
- {30}
- };
- //--------------Random Checkpoints
- new Float:CPS[][3] =
- {
- {245.858047, 1859.469238, 14.084012},
- {249.504058, 1799.019165, 7.414062},
- {219.404113, 1822.623291, 7.522557},
- {267.119537, 1856.765136, 8.757812},
- {268.536376, 1883.993408, -30.093750}
- };
- //=====================================
- main()
- {
- SetGameModeText("Area 51 DM!");
- //-----------------------------------------------
- print("\n----------------------------------");
- print(" Area 51 DM By [HiC]TheKiller \n");
- print(" Acesse WwW.MaiorMoral.DaHoRa.NeT ");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- //--------Cars!
- hydra1=AddStaticVehicle(520,398.4401,2444.2346,17.2233,357.3300,0,0); //
- hydra2=AddStaticVehicle(520,408.1099,2443.8965,17.2293,358.5307,0,0); //
- AddStaticVehicle(548,364.9654,2534.3472,18.2595,359.7653,1,1); //
- hunter2=AddStaticVehicle(425,349.1158,2538.5947,17.3162,0.3601,43,0); //
- hunter1=AddStaticVehicle(425,381.0984,2538.3628,17.1197,357.6414,43,0); //
- rhyno=AddStaticVehicle(432,374.0586,2462.6494,16.4970,358.9620,43,0); //
- AddStaticVehicle(433,321.9156,2551.7671,17.2449,179.8232,43,0); //
- AddStaticVehicle(433,328.7147,2552.0676,17.2415,180.8896,43,0); //
- AddStaticVehicle(433,329.0340,2531.4309,17.2385,180.8802,43,0); //
- AddStaticVehicle(433,321.5755,2531.5159,17.2424,179.1689,43,0); //
- AddStaticVehicle(470,297.2685,2534.6160,16.8105,1.4194,43,0); //
- AddStaticVehicle(470,297.0826,2542.1182,16.8127,1.4168,43,0); //
- AddStaticVehicle(470,297.2028,2550.3567,16.8128,358.7809,43,0); //
- AddStaticVehicle(470,290.1027,2531.7046,16.8109,178.6389,43,0); //
- AddStaticVehicle(470,290.2718,2538.8044,16.8119,178.6365,43,0); //
- AddStaticVehicle(470,290.4342,2545.6152,16.8135,178.6346,43,0); //
- AddStaticVehicle(470,290.5776,2551.6213,16.8135,178.6324,43,0); //
- AddStaticVehicle(455,283.3560,2552.2463,17.2575,359.8944,84,58); //
- AddStaticVehicle(455,283.3209,2531.7029,17.2505,359.8981,84,58); //
- AddStaticVehicle(497,-574.9012,2625.0830,53.5886,271.8229,0,1); //
- AddStaticVehicle(596,-520.8088,2582.2642,53.1339,89.9921,0,1); //
- AddStaticVehicle(596,-520.8108,2576.9492,53.1354,88.1579,0,1); //
- AddStaticVehicle(596,-521.0120,2571.8594,53.1345,88.5019,0,1); //
- AddStaticVehicle(596,-521.3567,2566.8269,53.1354,88.9090,0,1); //
- AddStaticVehicle(596,-521.4574,2561.7126,53.1350,90.8526,0,1); //
- AddStaticVehicle(596,-521.5957,2556.5986,53.1350,89.4514,0,1); //
- AddStaticVehicle(523,-539.3915,2603.2832,52.9810,87.2383,0,0); //
- AddStaticVehicle(523,-540.3836,2606.3867,52.9812,90.7301,0,0); //
- AddStaticVehicle(523,-540.2418,2609.0022,52.9796,90.6848,0,0); //
- AddStaticVehicle(523,-540.4328,2611.3677,52.9801,88.8680,0,0); //
- AddStaticVehicle(523,-539.9841,2613.7148,52.9852,86.8997,0,0); //
- AddStaticVehicle(490,-526.6431,2607.0732,53.5427,177.4171,0,0); //
- AddStaticVehicle(490,-526.2021,2616.8582,53.5421,177.4168,0,0); //
- AddStaticVehicle(490,-527.8973,2579.2708,53.5405,177.4180,0,0); //
- AddStaticVehicle(490,-528.3642,2568.9075,53.5420,177.4182,0,0); //
- AddStaticVehicle(528,-540.7623,2548.3965,53.4596,270.0656,0,0); //
- AddStaticVehicle(555,-234.7445,2595.2427,62.3899,1.2786,13,1); //
- AddStaticVehicle(555,-237.4528,2595.1685,62.3878,357.3091,13,1); //
- AddStaticVehicle(415,-198.3344,2608.8669,62.4754,358.1694,75,1); //
- AddStaticVehicle(415,-204.3017,2608.4463,62.4780,1.7810,75,1); //
- AddStaticVehicle(411,-213.4360,2609.1538,62.4302,3.3195,112,1); //
- AddStaticVehicle(411,-228.1968,2607.9126,62.4302,3.3262,112,1); //
- AddStaticVehicle(603,-240.2451,2608.3728,62.5418,356.7434,75,77); //
- AddStaticVehicle(603,-244.0009,2595.9663,62.5782,6.4424,75,77); //
- ss1=AddStaticVehicle(447,-252.7227,2620.1201,62.9064,0.0074,75,2); //
- ss2=AddStaticVehicle(447,-234.0194,2620.5742,63.8802,346.5994,75,2); //
- ss3=AddStaticVehicle(447,-208.6853,2624.0674,63.1131,359.0009,75,2); //
- //--------Gangsta's
- AddPlayerClass(0,0,0,0,0,12,1,23,150,0,0);
- AddPlayerClass(105,0,0,0,0,12,1,23,150,0,0);
- AddPlayerClass(106,0,0,0,0,12,1,23,150,0,0);
- AddPlayerClass(107,0,0,0,0,12,1,23,150,0,0);
- //---------Cops
- AddPlayerClass(280,0,0,0,0,22,150,10,1,0,0);
- AddPlayerClass(282,0,0,0,0,22,150,10,1,0,0);
- AddPlayerClass(285,0,0,0,0,22,150,10,1,0,0);
- AddPlayerClass(286,0,0,0,0,22,150,10,1,0,0);
- //----- Other GM related stuff
- for(new i=0; i < MAX_PLAYERS; i++)
- TogglePlayerClock(i,false);
- SetTimer("timer",500000,true);
- SetTimer("level",500,true);
- area51=0;
- //======TEXTDRAW!
- TextCp = TextDrawCreate(544.000000,415.000000,"50");
- TextGa = TextDrawCreate(465.000000,416.000000,"50");
- Textdraw2 = TextDrawCreate(549.000000,401.000000,"Cops!");
- Textdraw3 = TextDrawCreate(459.000000,401.000000,"Gangsta's!");
- TextDrawAlignment(TextCp,0);
- TextDrawAlignment(TextGa,0);
- TextDrawAlignment(Textdraw2,0);
- TextDrawAlignment(Textdraw3,0);
- TextDrawBackgroundColor(TextCp,0x000000ff);
- TextDrawBackgroundColor(TextGa,0x000000ff);
- TextDrawBackgroundColor(Textdraw2,0x000000ff);
- TextDrawBackgroundColor(Textdraw3,0x000000ff);
- TextDrawFont(TextCp,1);
- TextDrawLetterSize(TextCp,0.899999,2.699999);
- TextDrawFont(TextGa,1);
- TextDrawLetterSize(TextGa,0.899999,2.499999);
- TextDrawFont(Textdraw2,3);
- TextDrawLetterSize(Textdraw2,0.499999,1.100000);
- TextDrawFont(Textdraw3,3);
- TextDrawLetterSize(Textdraw3,0.399999,1.100000);
- TextDrawColor(TextCp,0x0000ff99);
- TextDrawColor(TextGa,0x00ff0099);
- TextDrawColor(Textdraw2,0x0000ff99);
- TextDrawColor(Textdraw3,0x00ff0099);
- TextDrawSetOutline(TextCp,1);
- TextDrawSetOutline(TextGa,1);
- TextDrawSetOutline(Textdraw2,1);
- TextDrawSetOutline(Textdraw3,1);
- TextDrawSetProportional(TextCp,1);
- TextDrawSetProportional(TextGa,1);
- TextDrawSetProportional(Textdraw2,1);
- TextDrawSetProportional(Textdraw3,1);
- TextDrawSetShadow(TextCp,1);
- TextDrawSetShadow(TextGa,1);
- TextDrawSetShadow(Textdraw2,1);
- TextDrawSetShadow(Textdraw3,1);
- Scop=50;
- Sgangsta=50;
- print("The GM has started");
- return 1;
- }
- //====================================
- public OnPlayerRequestClass(playerid, classid)
- {
- if (classid == 0 || classid == 1 || classid == 2 || classid == 3)
- {
- GameTextForPlayer(playerid, "~g~Gangsta's", 500, 3);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,308.261749, 2528.727783, 16.816020);
- SetPlayerFacingAngle(playerid, 179.004608);
- SetPlayerCameraPos(playerid, 308.124847, 2523.134033, 16.750083);
- SetPlayerCameraLookAt(playerid, 308.261749, 2528.727783, 16.816020);
- gTeam[playerid] = TEAM_Gangsta;
- SetPlayerTeam(playerid,1);
- }
- else if (classid == 4 || classid == 5 || classid == 6 || classid == 7)
- {
- GameTextForPlayer(playerid, "~b~Cops", 500, 3);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-540.319152, 2594.131347, 53.415424);
- SetPlayerFacingAngle(playerid, 267.393981);
- SetPlayerCameraPos(playerid, -533.715393, 2593.737548, 53.415424);
- SetPlayerCameraLookAt(playerid, -540.319152, 2594.131347, 53.415424);
- gTeam[playerid] = TEAM_Cops;
- SetPlayerTeam(playerid,1);
- }
- return 1;
- }
- //-------Team Colors
- SetPlayerToTeamColor(playerid)
- {
- if (gTeam[playerid] == TEAM_Gangsta)
- {
- SetPlayerTeam(playerid,1);
- SetPlayerColor(playerid, TEAM_Gangsta_COLOR);
- }
- else if (gTeam[playerid] == TEAM_Cops)
- {
- SetPlayerTeam(playerid,2);
- SetPlayerColor(playerid, TEAM_Cops_COLOR);
- }
- }
- public OnPlayerConnect(playerid)
- {
- //-------- Connect message
- SendClientMessage(playerid, 0x0ED0FF, "Welcome thsi server is currently running Area 51 DM 0.1 created by [HiC]TheKiller.");
- SendClientMessage(playerid, 0xFFFFF7FF, "This is a Gamemode where you have to kill people to earn points and gain levels. /levels to check the points for each level");
- SendClientMessage(playerid, 0xFFFFF7FF, "/Commands is our current server commands!");
- //--------------World bounds
- SetPlayerWorldBounds(playerid, 817.4513, -735.7062, 2849.402, 513.8265);
- LVL[playerid] = 0;
- Score[playerid] = 0;
- TextDrawShowForAll(TextCp); TextDrawShowForAll(TextGa); TextDrawShowForAll(Textdraw2); TextDrawShowForAll(Textdraw3);
- if (area51==1)
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- SetPlayerCheckpoint(i,Checkpoint,Checkpoint1,Checkpoint2,3);
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForAll(TextCp); TextDrawShowForAll(TextGa); TextDrawShowForAll(Textdraw2); TextDrawShowForAll(Textdraw3);
- //===== Levels
- if(GetPlayerScore(playerid) >= 50)
- {
- LVL[playerid] = 1;
- }
- if(GetPlayerScore(playerid) >= 110)
- {
- LVL[playerid] = 2;
- }
- if(GetPlayerScore(playerid) >= 180)
- {
- LVL[playerid] = 3;
- }
- if(GetPlayerScore(playerid) >= 260)
- {
- LVL[playerid] = 4;
- }
- if(GetPlayerScore(playerid) >= 340)
- {
- LVL[playerid] = 5;
- }
- if(GetPlayerScore(playerid) >= 450)
- {
- LVL[playerid] = 6;
- }
- if(GetPlayerScore(playerid) >= 590)
- {
- LVL[playerid] = 7;
- }
- if(GetPlayerScore(playerid) >= 730)
- {
- LVL[playerid] = 8;
- }
- if(GetPlayerScore(playerid) >= 890)
- {
- LVL[playerid] = 9;
- }
- if(GetPlayerScore(playerid) >= 1200)
- {
- LVL[playerid] = 10;
- }
- //=====Vehicle locks!
- if (LVL[playerid]==10)
- {
- SetVehicleParamsForPlayer(hydra1,playerid,0,0);
- SetVehicleParamsForPlayer(hydra2,playerid,0,0);
- }
- else
- {
- SetVehicleParamsForPlayer(hydra1,playerid,0,1);
- SetVehicleParamsForPlayer(hydra2,playerid,0,1);
- }
- if (LVL[playerid]==9 || LVL[playerid]==10)
- {
- SetVehicleParamsForPlayer(hunter1,playerid,0,0);
- SetVehicleParamsForPlayer(hunter2,playerid,0,0);
- }
- else
- {
- SetVehicleParamsForPlayer(hunter1,playerid,0,1);
- SetVehicleParamsForPlayer(hunter2,playerid,0,1);
- }
- if (LVL[playerid]==6 || LVL[playerid]==7 || LVL[playerid]==8|| LVL[playerid]==9|| LVL[playerid]==10)
- {
- SetVehicleParamsForPlayer(rhyno,playerid,0,0);
- }
- else
- {
- SetVehicleParamsForPlayer(rhyno,playerid,0,1);
- }
- if (SpecialSpawn[playerid]==1)
- {
- SetVehicleParamsForPlayer(ss2,playerid,0,0);
- SetVehicleParamsForPlayer(ss3,playerid,0,0);
- SetVehicleParamsForPlayer(ss1,playerid,0,0);
- }
- else
- {
- SetVehicleParamsForPlayer(ss2,playerid,0,1);
- SetVehicleParamsForPlayer(ss3,playerid,0,1);
- SetVehicleParamsForPlayer(ss1,playerid,0,1);
- }
- SetPlayerToTeamColor(playerid);
- SetPlayerHealth(playerid,50);
- //=====Spwans!
- if (gTeam[playerid] == TEAM_Gangsta && SpecialSpawn[playerid]==0)
- {
- new iRandom = random(3);
- SetPlayerPos(playerid, RandomSpawnGang[iRandom][0], RandomSpawnGang[iRandom][1],
- RandomSpawnGang[iRandom][2]);
- SetPlayerFacingAngle(playerid, RandomSpawnGang[iRandom][3]);
- }
- if (gTeam[playerid] == TEAM_Cops && SpecialSpawn[playerid]==0)
- {
- new iRandom = random(3);
- SetPlayerPos(playerid, RandomSpawnCops[iRandom][0], RandomSpawnCops[iRandom][1],
- RandomSpawnCops[iRandom][2]);
- SetPlayerFacingAngle(playerid, RandomSpawnCops[iRandom][3]);
- }
- if(SpecialSpawn[playerid]==1)
- {
- SetPlayerPos(playerid,-253.7227,2620.1201,62.9064);
- }
- //-------ARea 51 spawn
- if (area51==1&&Area51G==1)
- {
- if(gTeam[playerid]==TEAM_Gangsta)
- {
- SetPlayerPos(playerid,254.884613, 1912.585937, 245.541671);
- GivePlayerWeapon(playerid,46,1);
- }
- if (area51==1&&Area51C==1)
- {
- if(gTeam[playerid]==TEAM_Cops)
- {
- SetPlayerPos(playerid,254.884613, 1912.585937, 245.541671);
- GivePlayerWeapon(playerid,46,1);
- }
- }
- }
- //-------Weapons and armour
- if (LVL[playerid]==2&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,4,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,75);
- }
- if (LVL[playerid]==2&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,4,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,75);
- }
- if (LVL[playerid]==1&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,65);
- }
- if (LVL[playerid]==1&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,65);
- }
- if (LVL[playerid]==3&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,85);
- }
- if (LVL[playerid]==3&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,85);
- }
- if (LVL[playerid]==4&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,100);
- }
- if (LVL[playerid]==4&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,100);
- }
- if (LVL[playerid]==5&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,10);
- }
- if (LVL[playerid]==5&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,10);
- }
- if (LVL[playerid]==6&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,28,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,30);
- }
- if (LVL[playerid]==6&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,32,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,30);
- }
- if (LVL[playerid]==7&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,30,1000);
- GivePlayerWeapon(playerid,28,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,40);
- }
- if (LVL[playerid]==7&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,31,1000);
- GivePlayerWeapon(playerid,32,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,40);
- }
- if (LVL[playerid]==8&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,30,1000);
- GivePlayerWeapon(playerid,28,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,70);
- }
- if (LVL[playerid]==8&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,31,1000);
- GivePlayerWeapon(playerid,32,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- GivePlayerWeapon(playerid,16,100);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,70);
- }
- if (LVL[playerid]==9&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,37,500);
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,30,1000);
- GivePlayerWeapon(playerid,28,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- GivePlayerWeapon(playerid,18,100);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,80);
- }
- if (LVL[playerid]==9&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,37,500);
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,31,1000);
- GivePlayerWeapon(playerid,32,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,80);
- }
- if (LVL[playerid]==10&& gTeam[playerid] == TEAM_Gangsta)
- {
- GivePlayerWeapon(playerid,37,500);
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,30,1000);
- GivePlayerWeapon(playerid,28,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,33,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,25,1);
- GivePlayerWeapon(playerid,41,1000);
- GivePlayerWeapon(playerid,35,100);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,100);
- }
- if (LVL[playerid]==10&& gTeam[playerid] == TEAM_Cops)
- {
- GivePlayerWeapon(playerid,37,500);
- GivePlayerWeapon(playerid,34,300);
- GivePlayerWeapon(playerid,31,1000);
- GivePlayerWeapon(playerid,32,3000);
- GivePlayerWeapon(playerid,26,800);
- GivePlayerWeapon(playerid,27,300);
- GivePlayerWeapon(playerid,24,300);
- GivePlayerWeapon(playerid,29,1);
- GivePlayerWeapon(playerid,42,1000);
- GivePlayerWeapon(playerid,35,100);
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,100);
- }
- return 1;
- }
- forward timer();
- public timer()
- {
- SetTimer("timer2",60000,false);
- renegade =1;
- GameTextForAll("~B~RENEGADE!! (Double Points!)",5000,1);
- return 1;
- }
- forward timer2();
- public timer2()
- {
- GameTextForAll("~B~Renegade Finished!",5000,1);
- renegade=0;
- return 1;
- }
- forward level();
- public level()
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerScore(i) >= 50 && LVL[i] == 0)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 1 You will get new weapons next spawn!");
- LVL[i] = 1;
- }
- if(GetPlayerScore(i) >= 110 && LVL[i] == 1)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 2 You will get new weapons next spawn!");
- LVL[i] = 2;
- }
- if(GetPlayerScore(i) >= 180 && LVL[i] == 2)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 3 You will get new weapons next spawn!");
- LVL[i] = 3;
- }
- if(GetPlayerScore(i) >= 260 && LVL[i] == 3)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 4 You will get new weapons next spawn!");
- LVL[i] = 4;
- }
- if(GetPlayerScore(i) >= 340 && LVL[i] == 4)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 5 You will get new weapons next spawn!");
- LVL[i] = 5;
- }
- if(GetPlayerScore(i) >= 450 && LVL[i] == 5)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 6 You will get new weapons next spawn!");
- LVL[i] = 6;
- }
- if(GetPlayerScore(i) >= 590 && LVL[i] == 6)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 7 You will get new weapons next spawn!");
- LVL[i] = 7;
- }
- if(GetPlayerScore(i) >= 730 && LVL[i] == 7)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 8 You will get new weapons next spawn!");
- LVL[i] = 8;
- }
- if(GetPlayerScore(i) >= 890 && LVL[i] == 8)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 9 You will get new weapons next spawn!");
- LVL[i] = 9;
- }
- if(GetPlayerScore(i) >= 1200 && LVL[i] == 9)
- {
- GameTextForPlayer(i, "~b~Leveling!", 500, 3);
- SendClientMessage(i,0x0660FF,"You are now level 10 You will get new weapons next spawn!");
- LVL[i] = 10;
- }
- if(!IsPlayerInCheckpoint(i))
- {
- KillTimer(tm1);
- KillTimer(tm2);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if (gTeam[playerid]==TEAM_Cops)
- {
- Scop--;
- }
- if(gTeam[playerid]==TEAM_Gangsta)
- {
- Sgangsta --;
- }
- SendDeathMessage(killerid, playerid, reason);
- new string1[5], string[5];
- valstr(string, Scop);
- TextDrawSetString(TextCp, string);
- valstr(string1, Sgangsta);
- TextDrawSetString(TextGa, string1);
- if(Scop==0 && area51==0)
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- SendClientMessage(i,0x0660FF,"Gangsta's have WON the round! Cops spawn at area51!");
- GameTextForAll("~r~Area51!",5000,3);
- Scop=51;
- Sgangsta=51;
- new string2[5];
- valstr(string2, Scop);
- TextDrawSetString(TextCp, string2);
- valstr(string2, Sgangsta);
- TextDrawSetString(TextGa, string2);
- new iRandom = random(5);
- DisablePlayerCheckpoint(i);
- Checkpoint = CPS[iRandom][0] ,Checkpoint1 = CPS[iRandom][1], Checkpoint2 = CPS[iRandom][2];
- SetPlayerCheckpoint(i,Checkpoint,Checkpoint1,Checkpoint2,3);
- area51=1;
- Area51C=1;
- }
- }
- if(Sgangsta==0 && area51==0)
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- SendClientMessage(i,0x0660FF,"Cops have WON! Gangsta's spawn at area51");
- GameTextForAll("~r~Area51!",5000,3);
- Scop=51;
- Sgangsta=51;
- new string3[5];
- valstr(string3, Scop);
- TextDrawSetString(TextCp, string3);
- valstr(string3, Sgangsta);
- TextDrawSetString(TextGa, string3);
- new iRandom = random(5);
- DisablePlayerCheckpoint(i);
- Checkpoint = CPS[iRandom][0] ,Checkpoint1 = CPS[iRandom][1], Checkpoint2 = CPS[iRandom][2];
- SetPlayerCheckpoint(i,Checkpoint,Checkpoint1,Checkpoint2,3);
- area51=1;
- Area51G=1;
- }
- }
- if(Scop==0 && area51==1)
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- SendClientMessage(i,0x0660FF,"Gangsta's has WON!");
- GameTextForAll("~G~Gangsta's Have Won!!!",4000,3);
- Scop=51;
- Sgangsta=51;
- new string4[5];
- valstr(string4, Scop);
- TextDrawSetString(TextCp, string4);
- valstr(string4, Sgangsta);
- TextDrawSetString(TextGa, string4);
- SpawnPlayer(i);
- DisablePlayerCheckpoint(i);
- KillTimer(tm2);
- KillTimer(tm1);
- Area51G=0;
- Area51C=0;
- area51=0;
- if(gTeam[i]==TEAM_Gangsta)
- {
- SetPlayerScore(i, GetPlayerScore(i)+5);
- SendClientMessage(i,0x0660FF,"Everyone in team Gangsta has been given 5 points!");
- }
- }
- }
- if(Sgangsta==0 && area51==1)
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- SendClientMessage(i,0x0660FF,"Cops have WON!");
- GameTextForAll("~b~Cops Have Won!!!",4000,3);
- Scop=51;
- Sgangsta=51;
- new string5[5];
- valstr(string5, Scop);
- TextDrawSetString(TextCp, string5);
- valstr(string5, Sgangsta);
- TextDrawSetString(TextGa, string5);
- SpawnPlayer(i);
- DisablePlayerCheckpoint(i);
- KillTimer(tm2);
- KillTimer(tm1);
- Area51G=0;
- Area51C=0;
- area51=0;
- if(gTeam[i]==TEAM_Cops)
- {
- SetPlayerScore(i, GetPlayerScore(i)+5);
- SendClientMessage(i,0x0660FF,"Everyone in team Cops has been given 5 points!");
- }
- }
- return 1;
- }
- // Kills!
- if(killerid != INVALID_PLAYER_ID)
- {
- new iRandom = random(6);
- SetPlayerScore(killerid, GetPlayerScore(killerid)+RandomKill[iRandom][0]);
- if (renegade==1)
- {
- new iRandom2 = random(6);
- SetPlayerScore(killerid, GetPlayerScore(killerid)+RandomKillR[iRandom2][0]);
- }
- else if (area51==1)
- {
- new iRandom2 = random(6);
- SetPlayerScore(killerid, GetPlayerScore(killerid)+RandomKillR[iRandom2][0]);
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/kill", cmdtext, true, 10) == 0)
- {
- SetPlayerHealth(playerid,0);
- return 1;
- }
- #define SCMP SendClientMessage(playerid,
- if (strcmp("/Levels", cmdtext, true, 10) == 0)
- {
- SCMP 0xF4FFFFFF,"Level 1: [50 Score] \n Level 2: [110 Score]");
- SCMP 0xF4FFFFFF,"Level 3: [180 Score] \n Level 4: [260 Score]");
- SCMP 0xF4FFFFFF,"Level 5: [340 Score] \n Level 6: [450 Score]");
- SCMP 0xF4FFFFFF,"Level 7: [590 Score] \n Level 8: [730 Score]");
- SCMP 0xF4FFFFFF,"Level 9: [890 Score] \n Level 10: [1200 Score]");
- return 1;
- }
- if (strcmp("/Commands", cmdtext, true, 10) == 0)
- {
- SCMP 0x0660FF,"Commands:");
- SCMP 0xF4FFFFFF,"/Level [ID] -Shows the players level! ");
- SCMP 0xF4FFFFFF,"/Levels -Is a list of the scores for leveling!");
- SCMP 0xF4FFFFFF,"/Commands - Its a list of commands!");
- SCMP 0xF4FFFFFF,"/Kill - Kills yourself!");
- if(IsPlayerAdmin(playerid))
- {
- SCMP 0x0660FF,"Admin Commands:");
- SCMP 0xF414FFFF,"/LevelSet [playerid] [Level] -Sets a playes level!");
- SCMP 0xF414FFFF,"/Area51 - Starts area51! /Renegade - Starts renegade!");
- SCMP 0xF414FFFF,"/CopsScore [Score]- Changes the cops score on the score board!");
- SCMP 0xF414FFFF,"/GangScore [Score]- Changes the Gang's score on the score board!");
- SCMP 0xF414FFFF,"/TakeScore [playerid] [Score]- Takes the score off the player!");
- SCMP 0xF414FFFF,"/GiveScore [playerid] [Score]- Gives the player the score!");
- SCMP 0xF414FFFF,"/SetScore [playerid] [Score]- Sets the players score!");
- SCMP 0xF414FFFF,"/SpecialSpawn [playerid]- Gives the player special spawn privlages!");
- }
- return 1;
- }
- //------DCMD Commands
- dcmd(level, 5, cmdtext);
- dcmd(LevelSet, 8, cmdtext);
- dcmd(Area51, 6, cmdtext);
- dcmd(Renegade, 8, cmdtext);
- dcmd(CopsScore, 9, cmdtext);
- dcmd(GangScore, 9, cmdtext);
- dcmd(TakeScore, 9, cmdtext);
- dcmd(GiveScore, 9, cmdtext);
- dcmd(SetScore, 8, cmdtext);
- dcmd(SpecialSpawn, 12, cmdtext);
- return 0;
- }
- dcmd_level(playerid, params[])
- {
- new id, pname[24] ,string[256];
- if (sscanf(params, "d", id))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Level <playerid>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- GetPlayerName(id,pname,24);
- format(string, sizeof (string), "%s is level %d",pname,LVL[id]);
- SendClientMessage(playerid,0x0660FF,string);
- }
- return 1;
- }
- dcmd_Area51(playerid, params[]) //Starts Area51
- {
- #pragma unused params
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- new iRandom = random(5);
- GameTextForAll("~r~Area51!",5000,3);
- KillTimer(tm2);
- KillTimer(tm1);
- DisablePlayerCheckpoint(i);
- Checkpoint = CPS[iRandom][0] ,Checkpoint1 = CPS[iRandom][1], Checkpoint2 = CPS[iRandom][2];
- SetPlayerCheckpoint(i,Checkpoint,Checkpoint1,Checkpoint2,3);
- area51=1;
- }
- }
- return 1;
- }
- dcmd_Renegade(playerid, params[]) //Starts Renegade
- {
- #pragma unused params
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else
- {
- SetTimer("timer2",60000,false);
- renegade =1;
- GameTextForAll("RENEGADE!! (Double Points!)",5000,1);
- }
- return 1;
- }
- dcmd_SetScore(playerid, params[])
- {
- new score1,id,string[256],Pname[24];
- GetPlayerName(playerid,Pname,24);
- if (sscanf(params, "d,i", id,score1))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/SetScore <Playerid> <Score>\"");
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- SetPlayerScore(id,score1);
- format(string, sizeof (string), "%s has set your score to %d",Pname,score1);
- SendClientMessage(id,0x0660FF,string);
- }
- return 1;
- }
- dcmd_SpecialSpawn(playerid, params[])
- {
- new id,Pname[24],string[256];
- GetPlayerName(playerid,Pname,24);
- if (sscanf(params, "d", id))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/SpecialSpawn <Playerid>\"");
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- SpecialSpawn[id]=1;
- format(string, sizeof (string), "%s has given you special spawn privlages!",Pname);
- SendClientMessage(id,0x0660FF,string);
- }
- return 1;
- }
- dcmd_GiveScore(playerid, params[])
- {
- new score1,id,string[256],Pname[24];
- GetPlayerName(playerid,Pname,24);
- if (sscanf(params, "d,i", id,score1))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/GiveScore <Playerid> <Score>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else
- {
- SetPlayerScore(id,GetPlayerScore(id)+score1);
- format(string, sizeof (string), "%s has given you %i score",Pname,score1);
- SendClientMessage(id,0x0660FF,string);
- }
- return 1;
- }
- dcmd_TakeScore(playerid, params[])
- {
- new score1,id,string[256],Pname[24];
- GetPlayerName(playerid,Pname,24);
- if (sscanf(params, "d,i", id,score1))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/TakeScore <Playerid> <Score>\"");
- if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- SetPlayerScore(id,GetPlayerScore(id)-score1);
- format(string, sizeof (string), "%s has taken %s score off you!",Pname,score1);
- SendClientMessage(id,0x0660FF,string);
- }
- return 1;
- }
- dcmd_LevelSet(playerid, params[])
- {
- new id,LVL2 ,string[256],name[24],Pname[24];
- GetPlayerName(playerid,name,24);
- GetPlayerName(id,Pname,24);
- if (sscanf(params, "d,i", id,LVL2))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/LevelSet <playerid> <level>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (LVL2>10&&LVL2<0)
- return SendClientMessage(playerid, 0xFF0000AA, "Levels are between 0-10!");
- else if (LVL2==0)
- {
- LVL[id] =0;
- format(string, sizeof (string), "%s has set you to level 0",name);
- SetPlayerScore(id,0);
- SendClientMessage(id,0x0660FF,string);
- }
- else if (LVL2==1)
- {
- LVL[id] =1;
- format(string, sizeof (string), "%s has set you to level 1",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,50);
- }
- else if (LVL2==2)
- {
- LVL[id] =2;
- format(string, sizeof (string), "%s has set you to level 2",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,110);
- }
- else if (LVL2==3){
- LVL[id] =3;
- format(string, sizeof (string), "%s has set you to level 3",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,180);
- }
- else if (LVL2==4)
- {
- LVL[id] =4;
- format(string, sizeof (string), "%s has set you to level 4",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,260);
- }
- else if (LVL2==5)
- {
- LVL[id] =5;
- format(string, sizeof (string), "%s has set you to level 5",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,340);
- }
- else if (LVL2==6)
- {
- LVL[id] =6;
- format(string, sizeof (string), "%s has set you to level 6",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,450);
- }
- else if (LVL2==7)
- {
- LVL[id] =7;
- format(string, sizeof (string), "%s has set you to level 7",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,590);
- }
- else if (LVL2==8)
- {
- LVL[id] =8;
- format(string, sizeof (string), "%s has set you to level 8",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,730);
- }
- else if (LVL2==9)
- {
- LVL[id] =9;
- format(string, sizeof (string), "%s has set you to level 9",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,890);
- }
- else if (LVL2==10)
- {
- LVL[id] =10;
- format(string, sizeof (string), "%s has set you to level 10",name);
- SendClientMessage(id,0x0660FF,string);
- SetPlayerScore(id,1200);
- }
- return 1;
- }
- dcmd_CopsScore(playerid, params[])
- {
- new CopScore;
- if (sscanf(params, "i", CopScore))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/CopsScore <Score>\"");
- else if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (CopScore<0||CopScore>500)
- return SendClientMessage(playerid, 0xFF0000AA, "Please choose a score between 0 and 500!");
- else
- {
- Scop=CopScore;
- new string[5];
- valstr(string, Scop);
- TextDrawSetString(TextCp, string);
- }
- return 1;
- }
- dcmd_GangScore(playerid, params[])
- {
- new GangScore;
- if (sscanf(params, "i", GangScore))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/GangScore <Score>\"");
- else if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (GangScore<0||GangScore>500)
- return SendClientMessage(playerid, 0xFF0000AA, "Please choose a score between 0 and 500!");
- else
- {
- Sgangsta=GangScore;
- new string[5];
- valstr(string, Sgangsta);
- TextDrawSetString(TextGa, string);
- }
- return 1;
- }
- forward cops();
- public cops()
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- GameTextForAll("~b~Cops have won!",2500,3);
- SpawnPlayer(i);
- DisablePlayerCheckpoint(i);
- area51=0;
- KillTimer(tm2);
- KillTimer(tm1);
- //============
- if(gTeam[i]==TEAM_Cops)
- {
- SetPlayerScore(i, GetPlayerScore(i)+5);
- SendClientMessage(i,0x0660FF,"Everyone in team Cops has been given 5 points!");
- }
- Scop=50;
- Sgangsta=50;
- Area51G=0;
- Area51C=0;
- }
- return 1;
- }
- forward gangsta();
- public gangsta()
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- GameTextForAll("~g~Gangsta's have won!",2500,3);
- DisablePlayerCheckpoint(i);
- SpawnPlayer(i);
- area51=0;
- KillTimer(tm2);
- KillTimer(tm1);
- //============
- if(gTeam[i]==TEAM_Gangsta)
- {
- SetPlayerScore(i, GetPlayerScore(i)+5);
- SendClientMessage(i,0x0660FF,"Everyone in team Gangsta has been given 5 points!");
- }
- Scop=50;
- Sgangsta=50;
- Area51G=0;
- Area51C=0;
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- //------Cops!
- if (gTeam[playerid]==TEAM_Cops)
- {
- tm1=SetTimer("cops",120000,false);
- KillTimer(tm2);
- SendClientMessageToAll(0xFBFF0FF,"Cops are taking area 51!");
- }
- //------Gangsta's
- if (gTeam[playerid]==TEAM_Gangsta)
- {
- tm2=SetTimer("gangsta",120000,false);
- KillTimer(tm1);
- SendClientMessageToAll(0xFBFF0FF,"Gangsta's are taking area 51!");
- }
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- if (gTeam[playerid]==TEAM_Cops)
- {
- KillTimer(tm1);
- KillTimer(tm2);
- }
- if (gTeam[playerid]==TEAM_Gangsta)
- {
- KillTimer(tm1);
- KillTimer(tm2);
- }
- return 1;
- }
- //----------------------------------------------Sccanaf---------------------------------------------------
- stock sscanf(string[], format[], {Float,_}:...)
- {
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs();
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if (ch >= '0' && ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return 1;
- }
- }
- while ((ch = string[stringPos]) && ch != ' ');
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- ch,
- num = 0;
- while ((ch = string[stringPos++]))
- {
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- case ' ':
- {
- break;
- }
- default:
- {
- return 1;
- }
- }
- }
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new tmp[25];
- strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
- setarg(paramPos, 0, _:floatstr(tmp));
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != ' ')
- {
- setarg(paramPos, i++, ch);
- }
- if (!i) return 1;
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != ' ')
- {
- stringPos++;
- }
- while (string[stringPos] == ' ')
- {
- stringPos++;
- }
- paramPos++;
- }
- while (format[formatPos] == 'z') formatPos++;
- return format[formatPos];
- }
- //////////////////////////////////////////////////////////////////////|
- //-----------------------------END------------------------------------|
- //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement