Advertisement
Guest User

Untitled

a guest
Nov 17th, 2013
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. CMD:plantbomb(playerid, params[])
  2. {
  3. if (GetPVarInt(playerid, "Bomb") == 0)
  4. {
  5. SendClientMessage(playerid, -1, "{CC0000}Error: {FFFFFF}You do not have a {CC0000}bomb!");
  6. return 1;
  7. }
  8. -> if (GetPVarInt(playerid, "Plant") == 1)
  9. {
  10. SendClientMessage(playerid, -1, "{CC0000}Error: {FFFFFF}You need to wait before {CC0000}planting again!");
  11. return 1;
  12. }
  13.  
  14. new Float:fpX, Float:fpY, Float:fpZ, szString[124];
  15. GetPlayerPos(playerid, fpX, fpY, fpZ);
  16. fBombX = fpX;
  17. fBombY = fpY;
  18. fBombZ = fpZ-1.5;
  19. SetTimer("Explode", BombTimer * 1000, 0);
  20. SetTimerEx("ResetPlant", 20 * 60 * 1000, false, "i", playerid);
  21. SetPVarInt(playerid, "Bomb", 0);
  22. SetPVarInt(playerid, "Plant", 1);
  23. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
  24. iPlanter = playerid;
  25. format(szString, 124, "{FFFFFF}You have planted a bomb in your location and it will explode in {CC0000}%d seconds", BombTimer);
  26. SendClientMessage(playerid, -1, szString);
  27. #if Realism == 1
  28. {
  29. CreateObject(1252, fpX, fpY, fpZ-1.4, 0, 0, 0); // 'fpZ-1.4' may be inaccurate. Be aware.
  30. Timer = SetTimer("Beep", 4000, 1);
  31. }
  32. #endif
  33. return 1;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement