Advertisement
Guest User

veh bomb

a guest
Jul 30th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. CMD:pcb(playerid, params[])
  2. {
  3. if(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
  4. {
  5. if(PlayerInfo[playerid][pC4] == 0)
  6. {
  7. if(PlayerInfo[playerid][pBombs] != 0)
  8. {
  9. new carid = GetPlayerVehicleID(playerid);
  10. new closestcar = GetClosestCar(playerid, carid);
  11. if(IsPlayerInRangeOfVehicle(playerid, closestcar, 4.0))
  12. {
  13. if(VehicleBomb{closestcar} == 1)
  14. {
  15. SendClientMessage(playerid, COLOR_GRAD2, "There is already a C4 on the vehicle engine!");
  16. return 1;
  17. }
  18. VehicleBomb{closestcar} = 1;
  19. PlacedVehicleBomb[playerid] = closestcar;
  20. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  21. ApplyAnimation(playerid,"BOMBER","BOM_Plant",4.0,0,0,0,0,0);
  22. SendClientMessage(playerid, COLOR_GREEN, "You have placed C4 on the vehicle engine, /pickupbomb to remove it.");
  23. PlayerInfo[playerid][pC4] = 1;
  24. PlayerInfo[playerid][pBombs]--;
  25. PlayerInfo[playerid][pC4Used] = 2;
  26. }
  27. else
  28. {
  29. SendClientMessage(playerid, COLOR_GRAD2, "You're not close enough to any vehicle!");
  30. return 1;
  31. }
  32. }
  33. else
  34. {
  35. SendClientMessage(playerid, COLOR_GRAD2, "You do not have C4!");
  36. return 1;
  37. }
  38. }
  39. else
  40. {
  41. SendClientMessage(playerid, COLOR_GRAD2, " You can only deploy 1 C4 at a time ! ");
  42. return 1;
  43. }
  44. }
  45. else
  46. {
  47. SendClientMessage(playerid, COLOR_GRAD2, "You're not a member of the International Contract Agency ! ");
  48. }
  49. return 1;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement