Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- English:
- • NO Post this filterscript elsewhere SAMP and pose as the creator of the code. • • -> Code Created By d4rk$iD3 <-
- • CREDITS • -> d4rk$iD3: Development and idea of the code.
- • You can make your modified freely as long as you're respecting and keeping credit.
- • system details:
- a) 2 colors were made to messages on and off by command.
- b) the enumeration for the data to be stored is made.
- c) a timer that automatically updates, passing nine seconds was made all the holes created (you can change the timer to your taste) will be deleted.
- d) command on/off system was made.
- e) the condition of weapons that can open holes in objects in the OnPlayerWeaponShot function is made.
- f) a function of hole Created from bullets and another was made to clear all.
- IMPORTANT !!! READ CAREFULLY TO AVOID become a thief spaces ABSOLUTELY the Credit Theft or publication of This filterscript without my permission.
- Spanish:
- • NO Publicar este FILTERSCRIPT en otros foros de SA-MP y hacerse pasar por el creador del código.
- •
- • -> Código Creado Por D4Rk$iD3 <-
- •
- • CREDITOS:
- • -> D4Rk$iD3: Desarrollo e idea del código.
- • Puedes hacer Tu modificacion libremente siempre y cuándo estés respetando y manteniendo los créditos.
- •
- •
- • • • • • • • • • • • • • • • • • • • • • • •
- •
- • Detalles del sitema:
- • a) Se hicieron 2 colores para mensajes de activación y desactivación por comando.
- • b) Se hicieron las enumeraciones para los datos que serán almacenados.
- • c) Se hizo un timer que se actualiza automáticamente, al pasar 9 segundos se borrarán todos los orificios creados (Puedes cambiar el timer a tu gusto).
- • d) Se hizo el comando de activación/desactivación del sistema.
- • e) Se hizo la condición para las armas que podrán abrir orificios en objetos en la función OnPlayerWeaponShot.
- • f) Se hizo una función de Creado de Orificio de las balas y otra para Borrarlas todas.
- • • • • • • • • • • • • • • • • • • • • • • •
- • ¡¡¡ IMPORTANTE !!!
- • LEE ATENTAMENTE PARA NO VOLVERTE UN LADRÓN.
- •••••••••••••••••••••••••••
- • Prohibido •
- • ABSOLUTAMENTE •
- • el •
- • Robo •
- • de Créditos •
- • o la publicación •
- • de este FILTERSCRIPT •
- • sin MI AUTORIZACIÓN. •
- •••••••••••••••••••••••••••
- */
- #define FILTERSCRIPT
- #include <streamer>
- #if defined FILTERSCRIPT
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
- //Colores
- #define green 0x33FF33AA
- #define red 0xFF0000AA
- //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
- enum Datos
- {
- Creado,
- Objeto,
- Contador,
- Float:X1,
- Float:Y1,
- Float:Z1,
- };
- #define Maximos_Disparos (500)
- new DatosH[Maximos_Disparos][Datos], bullethole[MAX_PLAYERS], timer2;
- public OnFilterScriptInit()
- {
- timer2 = SetTimer("BorrarTodosLosAgujeros", 9000, 1);
- print("\n--------------------------------------");
- print(" BulletHole V1 Filterscript by D4Rk$iD3, Saludos PawnoScript!");
- print("--------------------------------------\n");
- for(new i; i < Maximos_Disparos; i++) { i = 0; return 1;}
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(timer2);
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- bullethole[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- bullethole[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- bullethole[playerid] = 0;
- GivePlayerWeapon(playerid,30,1000);
- GivePlayerWeapon(playerid,38,1000);
- GivePlayerWeapon(playerid,32,1000);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/bullethole", true) == 0) {
- if(bullethole[playerid] == 0)
- {
- bullethole[playerid] = 1;
- SendClientMessage(playerid, green, "[INFO]: Ahora se mostrarán los orificios de las balas al disparar a un objeto.");
- }
- else if(bullethole[playerid] == 1) {
- bullethole[playerid] = 0;
- SendClientMessage(playerid,red,"[INFO]: Ya no se mostrarán los orificios de las balas al disparar a un objeto.");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(bullethole[playerid] == 1) {
- if(hittype == 0 && fX != 0)
- {
- new Float: A, Float: rX, Float: rY;
- GetXYInFrontOfPlayer(playerid, rX, rY, 5.0);
- GetPlayerFacingAngle(playerid, A);
- CrearAgujero(fX, fY, fZ, rX, rY, A-90);
- }
- }
- return 1;
- }
- forward CrearAgujero(Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:Angle);
- public CrearAgujero(Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:Angle)
- {
- for(new i = 0; i < sizeof(DatosH); i++)
- {
- if(DatosH[i][Creado] == 0)
- {
- DatosH[i][Creado]=1;
- DatosH[i][X1]=x;
- DatosH[i][Y1]=y;
- DatosH[i][Z1]=z;
- DatosH[i][Objeto] = CreateObject(19185, x, y, z, rx, ry, Angle);
- DatosH[i][Contador] += 1;
- SetObjectMaterial(DatosH[i][Objeto], 0, 19341, "egg_texts", "easter_egg01", 0xFF000000);
- return 1;
- }
- }
- return 0;
- }
- forward BorrarTodosLosAgujeros();
- public BorrarTodosLosAgujeros()
- {
- for(new i = 0; i < sizeof(DatosH); i++)
- {
- if(DatosH[i][Creado] == 1)
- {
- DatosH[i][Creado]=0;
- DatosH[i][X1]=0.0;
- DatosH[i][Y1]=0.0;
- DatosH[i][Z1]=0.0;
- DatosH[i][Contador] = 0;
- DestroyObject(DatosH[i][Objeto]);
- }
- }
- return 0;
- }
- GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- GetPlayerFacingAngle(playerid, a);
- if (GetPlayerVehicleID(playerid))
- {
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- }
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement