Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- new armas_Jugador[11];
- new balas_Jugador[11];
- new jugador_Probando[MAX_PLAYERS] = 0;
- new botella_1[MAX_PLAYERS],
- botella_2[MAX_PLAYERS],
- botella_3[MAX_PLAYERS];
- new bool:cabina_1,
- bool:cabina_2,
- bool:cabina_3,
- bool:cabina_4,
- bool:cabina_5,
- bool:cabina_6,
- bool:cabina_7,
- bool:cabina_8;
- new Float:antigua_X,
- Float:antigua_Y,
- Float:antigua_Z;
- new finalizar_Temporizador[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("--------------------------------------------");
- print("MALIBU RP — FILTERSCRIPTS: Licencia de armas");
- print("--------------------------------------------");
- return 1;
- }
- CMD:ingresar(playerid)
- {
- jugador_Probando[playerid] ++;
- if(!cabina_1) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_2) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_3) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_4) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_5) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_6) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_7) return Prueba(playerid);
- jugador_Probando[playerid] ++;
- if(!cabina_8) return Prueba(playerid);
- SendClientMessage(playerid, 0xFF9900AA, "No hay cabinas disponibles.");
- return 1;
- }
- CMD:obtener(playerid, params[])
- {
- if(jugador_Probando[playerid] != 0) return SendClientMessage(playerid, 0xAA3333AA, "Ya estás realizando la prueba.");
- ShowPlayerDialog(playerid, 9393, DIALOG_STYLE_LIST, "LICENCIAS: Tipos", "ARMAS CORTAS ---> 5.000$\nARMAS LARGAS ---> 10.000$\nARMAS DE GUERRA ---> 25.000$", "ELEGIR", "SALIR");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 9393:
- {
- if(!response) return SendClientMessage(playerid, 0xAA3333AA, "Cancelaste el pedido de licencias de armas.");
- cmd_ingresar(playerid);
- if(jugador_Probando[playerid] != 0)
- {
- GetPlayerPos(playerid, antigua_X, antigua_Y, antigua_Z);
- SendClientMessage(playerid, 0xFFFF00AA, "Si poseías armas de cualquier tipo no se perderán.");
- for(new n=0; n < 11; n++)
- GetPlayerWeaponData(playerid, n, armas_Jugador[n], balas_Jugador[n]);
- ResetPlayerWeapons(playerid);
- switch(listitem)
- {
- case 0: GivePlayerWeapon(playerid, 24, 21);
- case 1: GivePlayerWeapon(playerid, 31, 0);
- case 2: GivePlayerWeapon(playerid, 34, 0);
- }
- }
- }
- }
- return 0;
- }
- stock Prueba(playerid)
- {
- switch(jugador_Probando[playerid])
- {
- case 1:
- {
- SetPlayerPos(playerid, 289.1989, -24.8682, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 289.2146, -16.7223, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 2:
- {
- SetPlayerPos(playerid, 290.7776, -24.8567, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 290.6228, -19.1884, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 3:
- {
- SetPlayerPos(playerid, 292.3026, -24.9495, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 292.1184, -19.6917, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 4:
- {
- SetPlayerPos(playerid, 293.7717, -24.8446, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 293.5976, -18.7449, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 5:
- {
- SetPlayerPos(playerid, 295.2268, -24.8296, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 295.2769, -18.7415, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 6:
- {
- SetPlayerPos(playerid, 296.7524, -24.9396, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 296.6048, -18.7656, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 7:
- {
- SetPlayerPos(playerid, 298.1832, -24.9380, 1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 298.1743, -18.8578, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- case 8:
- {
- SetPlayerPos(playerid, 299.7302,-24.8314,1001.5156);
- cabina_1 = true;
- botella_1[playerid] = CreatePlayerObject(playerid, 1486, 299.5618, -18.9453, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- // 0 = NINGUNO // 1 = JUGADOR // 2 = VEHICULO // 3 = OBJETO // 4 = OBJETO DE JUGADOR
- if(hittype == 3)
- {
- if(hitid == botella_1[playerid])
- {
- switch(jugador_Probando[playerid])
- {
- case 1:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 289.2492, -10.3258, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 2:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 290.6862, -13.3795, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 3:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 292.0101, -12.8967, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 4:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 293.6076, -14.2964, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 5:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 295.1604, -15.4115, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 6:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 296.6415, -14.7793, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 7:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 298.0888, -14.8412, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- case 8:
- {
- botella_2[playerid] = CreatePlayerObject(playerid, 1486, 299.6508, -15.1073, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- }
- }
- PlayerPlaySound(playerid, 1135, 0.0, 0.0, 0.0);
- }
- if(hitid == botella_2[playerid])
- {
- switch(jugador_Probando[playerid])
- {
- case 1:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 289.3059, -6.7397, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 2:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 290.7001, -6.7313, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 3:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 292.0823, -6.2462, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 4:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 293.6309, -7.5916, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 5:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 295.2759, -7.9520, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 6:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 296.6320, -8.6086, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 7:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 298.1366, -9.5024, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- case 8:
- {
- botella_3[playerid] = CreatePlayerObject(playerid, 1486, 299.5042, -7.9370, 1001.5156, 0.0, 0.0, 0.0, 100.00);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- }
- }
- PlayerPlaySound(playerid, 1135, 0.0, 0.0, 0.0);
- }
- if(hitid == botella_3[playerid])
- {
- PlayerPlaySound(playerid, 17802, 0.0, 0.0, 0.0);
- DestroyPlayerObject(playerid, botella_3[playerid]);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- botella_1[playerid] = 0;
- botella_2[playerid] = 0;
- botella_3[playerid] = 0;
- finalizar_Temporizador[playerid] = SetTimerEx("FinalizarPrueba", 3000, 0, "d", playerid);
- GameTextForPlayer(playerid, "~b~Finalizado: ~g~APROBADO", 3000, 6);
- }
- }
- return 1;
- }
- forward FinalizarPrueba(playerid);
- public FinalizarPrueba(playerid)
- {
- ResetPlayerWeapons(playerid);
- for(new n=0; n < 11; n++)
- GivePlayerWeapon(playerid, armas_Jugador[n], balas_Jugador[n])
- SetPlayerPos(playerid, antigua_X, antigua_Y, antigua_Z);
- switch(jugador_Probando[playerid])
- {
- case 1: cabina_1 = false;
- case 2: cabina_2 = false;
- case 3: cabina_3 = false;
- case 4: cabina_4 = false;
- case 5: cabina_5 = false;
- case 6: cabina_6 = false;
- case 7: cabina_7 = false;
- case 8: cabina_8 = false;
- }
- jugador_Probando[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(jugador_Probando[playerid] != 0)
- {
- switch(jugador_Probando[playerid])
- {
- case 1: cabina_1 = false;
- case 2: cabina_2 = false;
- case 3: cabina_3 = false;
- case 4: cabina_4 = false;
- case 5: cabina_5 = false;
- case 6: cabina_6 = false;
- case 7: cabina_7 = false;
- case 8: cabina_8 = false;
- }
- jugador_Probando[playerid] = 0;
- KillTimer(finalizar_Temporizador[playerid]);
- DestroyPlayerObject(playerid, botella_3[playerid]);
- DestroyPlayerObject(playerid, botella_2[playerid]);
- DestroyPlayerObject(playerid, botella_1[playerid]);
- botella_1[playerid] = 0;
- botella_2[playerid] = 0;
- botella_3[playerid] = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement