Guest User

Firework script

a guest
Jun 2nd, 2013
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. // Firework filterscript by Sellize on SA-MP forums
  2. // Don't be a dick and keep the credits in here :)
  3. // Command is /firework
  4. #define FILTERSCRIPT
  5. #include <a_samp>
  6. new firework;
  7. public OnFilterScriptInit()
  8. {
  9. print("Firework script by Sellize loaded.");
  10. return 1;
  11. }
  12.  
  13. public OnFilterScriptExit()
  14. {
  15. return 1;
  16. }
  17. public OnPlayerCommandText(playerid, cmdtext[])
  18. {
  19. if (strcmp("/firework", cmdtext, true, 9) == 0)
  20. {
  21. if(!IsPlayerInAnyVehicle(playerid))
  22. {
  23. if(!IsObjectMoving(firework))
  24. {
  25. new Float:pX, Float:pY, Float:pZ;
  26. GetPlayerPos(playerid, pX, pY, pZ);
  27. firework = CreateObject(2918, pX, pY, pZ, 0.0, 0.0, 100.0);
  28. MoveObject(firework, pX, pY + 16, pZ + 50, 25.0);
  29. }
  30. else
  31. {
  32. SendClientMessage(playerid, -1, "{FF0000}** Please wait until your other firework is exploded **");
  33. }
  34. }
  35. else
  36. {
  37. SendClientMessage(playerid, -1, "{FF0000}** You can't launch firework from your car **");
  38. }
  39. return 1;
  40. }
  41. return 0;
  42. }
  43. public OnObjectMoved(objectid)
  44. {
  45. if(objectid == firework)
  46. {
  47. new Float:obX, Float:obY, Float:obZ;
  48. GetObjectPos(objectid, obX, obY, obZ);
  49. DestroyObject(firework);
  50. CreateExplosion(obX, obY, obZ, 0, 15.0);
  51. }
  52. return 1;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment