Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new RHINO[2], OBJETO[46], SNIPER[5], bool:EventoOn, bool:FoiEvento[MAX_PLAYERS], TeamSNP, TeamRUN, pTeamSNP, pTeamRUN;
- new Float:PosTeamSNP[3][4] =
- {
- {1567.7367,-2549.5454,70.3809,91.8311}, // posicao dos atiradores de leite
- {1567.0582,-2542.9116,70.3809,89.3244}, // posicao dos atiradores de leite
- {1568.1614,-2535.1489,70.3809,87.4444} // posicao dos atiradores de leite
- };
- new Float:PosTeamRUN[3][4] =
- {
- {1509.1761,-2581.9883,61.5809,1.2766}, // posicao dos pernalonga
- {1509.1761,-2581.9883,61.5809,1.2766}, // posicao dos pernalonga
- {1509.1761,-2581.9883,61.5809,1.2766} // posicao dos pernalonga
- };
- forward EventoAberto();
- forward RespawnWeapon();
- public OnFilterScriptInit()
- {
- print("\n|==================================|");
- print("|==== SNIPERS vs CORREDORES ====|");
- print("|===== by iJoao ======|");
- print("|==================================|\n");
- CarregarSNPxRUN();
- EventoOn = true;
- for(new i; i < MAX_PLAYERS; i++) FoiEvento[i] = false;
- pTeamSNP = 0;
- pTeamRUN = 0;
- SetTimer("EventoAberto", 5000, false);
- SetTimer("RespawnWeapon", 5000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- EventoOn = false;
- pTeamSNP = 0;
- pTeamRUN = 0;
- for(new i; i < MAX_PLAYERS; i++) FoiEvento[i] = false;
- for(new ID; ID != sizeof(RHINO); ID++) DestroyVehicle(RHINO[ID]);
- for(new OBJ; OBJ < sizeof(OBJETO); OBJ++) DestroyObject(OBJETO[OBJ]);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/iniciar", true))
- {
- if(IsPlayerAdmin(playerid))
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(FoiEvento[i] == true)
- {
- TogglePlayerControllable(i, true);
- GameTextForPlayer(i, "~g~evento iniciado", 5000, 1);
- }
- }
- }
- return 1;
- }
- if(!strcmp(cmdtext, "/irevento", true))
- {
- if(EventoOn == false) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Nenhum evento está ativo no momento!");
- if(FoiEvento[playerid] == true) return SendClientMessage(playerid, 0xFF0000AA, "[ERRO]: Você já está participando de um evento!");
- if(pTeamSNP == pTeamRUN) //Se Corredores = numero de snipers > ENTRA COMO SNIPER
- {
- new pRandom = random(sizeof(PosTeamSNP));
- SetPlayerPos(playerid, PosTeamSNP[pRandom][0], PosTeamSNP[pRandom][1], PosTeamSNP[pRandom][2]);
- SetPlayerFacingAngle(playerid, PosTeamSNP[pRandom][3]);
- SetPlayerVirtualWorld(playerid, 333);
- SetPlayerTeam(playerid, TeamSNP);
- pTeamSNP++;
- FoiEvento[playerid] = true;
- TogglePlayerControllable(playerid, false);
- return 1;
- }
- if(pTeamSNP < pTeamRUN) //Se Corredores é maior que numero de snipers > ENTRA COMO SNIPER
- {
- new pRandom = random(sizeof(PosTeamSNP));
- SetPlayerPos(playerid, PosTeamSNP[pRandom][0], PosTeamSNP[pRandom][1], PosTeamSNP[pRandom][2]);
- SetPlayerFacingAngle(playerid, PosTeamSNP[pRandom][3]);
- SetPlayerVirtualWorld(playerid, 333);
- SetPlayerTeam(playerid, TeamSNP);
- pTeamSNP++;
- FoiEvento[playerid] = true;
- TogglePlayerControllable(playerid, false);
- return 1;
- }
- if(pTeamSNP > pTeamRUN) //Se Tiver menos corredores que snipers > ENTRA COMO CORREDOR
- {
- new pRandom = random(sizeof(PosTeamRUN));
- SetPlayerPos(playerid, PosTeamRUN[pRandom][0], PosTeamRUN[pRandom][1], PosTeamRUN[pRandom][2]);
- SetPlayerFacingAngle(playerid, PosTeamRUN[pRandom][3]);
- SetPlayerVirtualWorld(playerid, 333);
- SetPlayerTeam(playerid, TeamRUN);
- pTeamRUN++;
- FoiEvento[playerid] = true;
- TogglePlayerControllable(playerid, false);
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == SNIPER[0]) {GivePlayerWeapon(playerid, 34, 5);}
- if(pickupid == SNIPER[1]) {GivePlayerWeapon(playerid, 34, 5);}
- if(pickupid == SNIPER[2]) {GivePlayerWeapon(playerid, 34, 5);}
- if(pickupid == SNIPER[3]) {GivePlayerWeapon(playerid, 34, 5);}
- if(pickupid == SNIPER[4]) {GivePlayerWeapon(playerid, 34, 5);}
- return 1;
- }
- public RespawnWeapon()
- {
- SNIPER[0] = CreatePickup(358,2,1572.104248,-2533.082031,70.380889, 333);
- SNIPER[1] = CreatePickup(358,2,1572.360351,-2537.915283,70.380889, 333);
- SNIPER[2] = CreatePickup(358,2,1572.140747,-2541.718750,70.380889, 333);
- SNIPER[3] = CreatePickup(358,2,1572.158081,-2545.733154,70.380889, 333);
- SNIPER[4] = CreatePickup(358,2,1572.395996,-2550.756347,70.380889, 333);
- return 1;
- }
- public EventoAberto()
- {
- GameTextForAll("~g~evento disponivel ~b~use ~r~/irevento", 5000, 1);
- return 1;
- }
- stock CarregarSNPxRUN()
- {
- OBJETO[0] = CreateObject(3585, 1509.1, -2557.8999, 60.8, 0, 0, 270, 333);
- OBJETO[1] = CreateObject(3378, 1565.8, -2541.5, 68.2, 0, 0, 0, 333);
- OBJETO[2] = CreateObject(3378, 1571.5, -2541.3999, 68.2, 0, 0, 0, 333);
- OBJETO[3] = CreateObject(3378, 1508.7, -2573.2, 59.4, 0, 0, 0, 333);
- OBJETO[4] = CreateObject(3378, 1512.4, -2573.1001, 60.7, 0, 90, 180, 333);
- OBJETO[5] = CreateObject(18244, 1510.7, -2559.2, 63.7, 89.512, 180.001, 90.487, 333);
- OBJETO[6] = CreateObject(3585, 1508.9, -2553.3, 63.3, 0, 0, 0, 333);
- OBJETO[7] = CreateObject(3585, 1509.2, -2548.3999, 60.8, 0, 0, 270, 333);
- OBJETO[8] = CreateObject(3571, 1509.2, -2540.8999, 63.8, 0, 0, 90, 333);
- OBJETO[9] = CreateObject(18244, 1510.8, -2542.8, 65.7, 89.511, 180, 90.483, 333);
- OBJETO[10] = CreateObject(3571, 1509.2, -2534.1001, 63.8, 0, 0, 90, 333);
- OBJETO[11] = CreateObject(3571, 1509.2, -2523.6001, 63.8, 0, 0, 90, 333);
- OBJETO[12] = CreateObject(18244, 1510.8, -2527.5, 66.4, 89.506, 179.995, 90.478, 333);
- OBJETO[13] = CreateObject(18244, 1510.8, -2521.6001, 66.4, 89.506, 179.995, 90.478, 333);
- OBJETO[14] = CreateObject(3571, 1509.2, -2517, 65.5, 0, 0, 90, 333);
- OBJETO[15] = CreateObject(3585, 1511.6, -2517.1001, 67.8, 0, 0, 270, 333);
- OBJETO[16] = CreateObject(3571, 1516.2, -2516.8999, 65.5, 0, 0, 0, 333);
- OBJETO[17] = CreateObject(3571, 1522.5, -2516.8999, 65.5, 0, 0, 0, 333);
- OBJETO[18] = CreateObject(3571, 1526.6, -2516.3, 68, 0, 0, 90, 333);
- OBJETO[19] = CreateObject(18244, 1510.7, -2533, 67.9, 89.506, 179.995, 90.478, 333);
- OBJETO[20] = CreateObject(647, 1515.4, -2518.6001, 68.4, 0, 0, 0, 333);
- OBJETO[21] = CreateObject(647, 1516.6, -2519, 68.4, 0, 0, 0, 333);
- OBJETO[22] = CreateObject(3571, 1524.1, -2512.8, 65.5, 0, 0, 90, 333);
- OBJETO[23] = CreateObject(3571, 1525.7, -2508.3, 65.5, 0, 0, 90, 333);
- OBJETO[24] = CreateObject(3571, 1526.6, -2508.5, 68, 0, 0, 90, 333);
- OBJETO[25] = CreateObject(3571, 1524.5, -2500.6001, 68, 0, 0, 90, 333);
- OBJETO[26] = CreateObject(18244, 1525.9, -2505.1001, 69.1, 0, 270, 358.967, 333);
- OBJETO[27] = CreateObject(3571, 1524.5, -2495.3, 68, 0, 0, 90, 333);
- OBJETO[28] = CreateObject(3585, 1527, -2492.3999, 70.3, 0, 0, 270, 333);
- OBJETO[29] = CreateObject(3585, 1527, -2497.2, 70.3, 0, 0, 270, 333);
- OBJETO[30] = CreateObject(3571, 1529.9, -2492.5, 68, 0, 0, 0, 333);
- OBJETO[31] = CreateObject(647, 1529.2, -2496.8999, 70.4, 0, 0, 0, 333);
- OBJETO[32] = CreateObject(647, 1529.3, -2497.6001, 70.4, 0, 0, 0, 333);
- OBJETO[33] = CreateObject(647, 1529.1, -2492.7, 70.4, 0, 0, 0, 333);
- OBJETO[34] = CreateObject(647, 1529.1, -2492.2, 70.4, 0, 0, 0, 333);
- OBJETO[35] = CreateObject(3571, 1537.2, -2492.5, 68, 0, 0, 0, 333);
- OBJETO[36] = CreateObject(3571, 1544.8, -2491, 70, 0, 0, 20, 333);
- OBJETO[37] = CreateObject(3378, 1568.3, -2496.3, 71.9, 0, 0, 90, 333);
- OBJETO[38] = CreateObject(3378, 1568.2, -2487.3999, 69.2, 0, 0, 90, 333);
- OBJETO[39] = CreateObject(3378, 1568.1, -2491.8, 70.7, 0, 30, 90, 333);
- OBJETO[40] = CreateObject(3378, 1568.3, -2481.8999, 69.2, 0, 0, 90, 333);
- OBJETO[41] = CreateObject(3378, 1568.3, -2476.3999, 69.2, 0, 0, 90, 333);
- OBJETO[42] = CreateObject(3378, 1568.2, -2501.8, 71.9, 0, 0, 90, 333);
- OBJETO[43] = CreateObject(3571, 1550.4, -2487, 70, 0, 0, 51.995, 333);
- OBJETO[44] = CreateObject(3571, 1554.8, -2482.6001, 70, 0, 0, 33.993, 333);
- OBJETO[45] = CreateObject(18244, 1540.9, -2493.8, 71.7, 89.5, 179.995, 12.473, 333);
- RHINO[0] = AddStaticVehicle(432,1574.5818,-2482.9419,71.3882,179.7443,43,60000); // rhino 1
- RHINO[1] = AddStaticVehicle(432,1566.6100,-2482.9294,71.3882,179.9532,43,60000); // rhino 2
- for(new ID; ID != sizeof(RHINO); ID++) SetVehicleVirtualWorld(RHINO[ID], 333), SetVehicleHealth(RHINO[ID], 10000);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement