Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////
- // Firework //
- // By: Petricko //
- /////////////////////////////////////
- #include <a_samp>
- forward Plamen(playerid);
- forward Lansiranje();
- forward Pucanje1();
- forward Pucanje2();
- forward StvaranjeBoja();
- forward KrajVatrometa();
- forward KrajVatrometa1();
- forward Pucanje3();
- #define TrajanjeVatrometa 20000
- #define TrajanjeVatrometa1 20000
- new raketa, jtpack, dim, KrajPucanja, Crvena, Crvena1, Bela, Bela1, Boja, Kutija, KrajPucanja1;
- public OnFilterScriptInit()
- {
- jtpack = CreateObject(18699, 0, 0,-100.0, 0.00, 0.00, 0.00);
- dim = CreateObject(18707, 0, 0,-100.0, 0.00, 0.00, 0.00);
- print("\n----------------------------");
- print(" Firework");
- print(" By: Petricko");
- print("LOAD");
- print("----------------------------\n");
- return 1;
- }
- stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- new Float:a;
- GetPlayerPos(playerid, x, y, a);
- if (IsPlayerInAnyVehicle(playerid))
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- else
- GetPlayerFacingAngle(playerid, a);
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- return a;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/fireworks", cmdtext, true, 10) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new Float: px, Float:py, Float:pz;
- GetPlayerPos(playerid, px, py, pz);
- GetXYInFrontOfPlayer(playerid, px, py, 2);
- raketa = CreateObject(2238, px+2, py, pz-0.5, 0.00, 0.00, 0.00);
- SendClientMessage(playerid, 0xFF0000FF, "Firework start...");
- SetTimer("Plamen",3000,0);
- SetWorldTime(00);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[EROR]{FFFFFF}You are not admin!");
- return 1;
- }
- }
- if (strcmp("/fireworks1", cmdtext, true, 10) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new Float: px, Float:py, Float:pz;
- GetPlayerPos(playerid, px, py, pz);
- GetXYInFrontOfPlayer(playerid, px, py, 2);
- Kutija = CreateObject(3013, px+2, py, pz-0.5, 0.00, 0.00, 0.00);
- SendClientMessage(playerid, 0xFF0000FF, "Firework start...");
- SetTimer("StvaranjeBoja",3000,0);
- SetWorldTime(00);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[EROR]{FFFFFF}You are not admin!");
- return 1;
- }
- }
- return 0;
- }
- public Plamen(playerid)
- {
- AttachObjectToObject(jtpack, raketa, 0.0, 0.0, -2.05, 0.0, 0.0, 0.0, 1);
- SetTimer("Lansiranje",3000,0);
- return 1;
- }
- public Lansiranje()
- {
- new Float:ox, Float:oy, Float:oz;
- GetObjectPos(raketa, ox, oy, oz);
- AttachObjectToObject(dim, raketa, 0.0, 0.0, -2.05, 0.0, 0.0, 0.0, 1);
- DestroyObject(jtpack);
- SetTimer("Pucanje1",3125,0);
- MoveObject(raketa, ox, oy, oz+25, 8.00);
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerInRangeOfPoint(i, 50.0 ,ox, oy, oz-25))
- {
- PlayAudioStreamForPlayer(i,"http://k003.kiwi6.com/hotlink/48v50pdgu9/1.mp3");
- }
- }
- return 1;
- }
- public Pucanje1()
- {
- new rx = random(15), ry = random(15), rz = random(15),
- Float:ox, Float:oy, Float:oz;
- GetObjectPos(raketa, ox, oy, oz);
- DestroyObject(dim);
- CreateObject(18668, ox+rx, oy+ry, oz-rz, 0.00, 0.00, 0.00);//Crvena boja
- CreateObject(18668, ox-rx, oy-ry, oz-rz, 0.00, 0.00, 0.00);//Crvena boja
- CreateObject(18685, ox+rx, oy+ry, oz+rz, 0.00, 0.00, 0.00);//Explozija
- CreateObject(18685, ox-rx, oy-ry, oz+rz, 0.00, 0.00, 0.00);//Explozija
- Pucanje2();
- KrajPucanja = SetTimer("Pucanje1",300,0);
- SetTimer("KrajVatrometa",TrajanjeVatrometa,0);
- return 1;
- }
- public Pucanje2()
- {
- new rx = random(15), ry = random(15), rz = random(15),
- Float:ox, Float:oy, Float:oz;
- GetObjectPos(raketa, ox, oy, oz);
- DestroyObject(Crvena);
- DestroyObject(Crvena1);
- DestroyObject(Bela);
- DestroyObject(Bela1);
- Crvena = CreateObject(1213, ox+rx, oy+ry, oz-rz, 0.00, 0.00, 0.00);//trep
- Crvena1 = CreateObject(1213, ox-rx, oy-ry, oz-rz, 0.00, 0.00, 0.00);//trep
- Bela = CreateObject(354, ox+rx, oy+ry, oz-rz, 0.00, 0.00, 0.00);//trep
- Bela1 = CreateObject(354, ox-rx, oy-ry, oz-rz, 0.00, 0.00, 0.00);//trep
- return 1;
- }
- public KrajVatrometa()
- {
- KillTimer(KrajPucanja);
- DestroyObject(raketa);
- DestroyObject(Crvena);
- DestroyObject(Crvena1);
- DestroyObject(Bela);
- DestroyObject(Bela1);
- return 1;
- }
- public StvaranjeBoja()
- {
- new Rand;
- new Float:ox, Float:oy, Float:oz;
- Rand = random(6);
- GetObjectPos(Kutija, ox, oy, oz);
- DestroyObject(Boja);
- //DestroyObject(P[5]);
- switch(Rand)
- {
- case 1:
- {
- Boja = CreateObject(19281, ox, oy, oz, 0.00, 0.00, 0.00);//Bela
- }
- case 2:
- {
- Boja = CreateObject(19282, ox, oy, oz, 0.00, 0.00, 0.00);//Crvena
- }
- case 3:
- {
- Boja = CreateObject(19283, ox, oy, oz, 0.00, 0.00, 0.00);//Zelena
- }
- case 4:
- {
- Boja = CreateObject(19284, ox, oy, oz, 0.00, 0.00, 0.00);//Plava
- }
- }
- new rx = random(10), ry = random(10), rz = random(7);
- MoveObject(Boja, ox+rx, oy+ry, oz+25+rz, 25.00);
- KrajPucanja1 = SetTimer("Pucanje3",1000,0);
- SetTimer("KrajVatrometa1",TrajanjeVatrometa1,0);
- return 1;
- }
- public Pucanje3()
- {
- new Float:ox, Float:oy, Float:oz;
- GetObjectPos(Boja, ox, oy, oz);
- CreateObject(18685, ox, oy, oz, 0.00, 0.00, 0.00);//Explozija
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- PlayerPlaySound(i, 1159, ox, oy, oz-25);
- }
- SetTimer("StvaranjeBoja",300,0);
- return 1;
- }
- public KrajVatrometa1()
- {
- KillTimer(KrajPucanja1);
- DestroyObject(Boja);
- DestroyObject(Kutija);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement