1
0

putout.inc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. Everything related to putting out fires belongs here !
  3. */
  4. // Destroying
  5. CMD:destroyfire( playerid, params[] ) {
  6. if( PlayerInfo[playerid][pAdmin] >= 3 )
  7. {
  8. new fid;
  9. if( sscanf( params, "d", fid ) ) return SendClientMessage( playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /destroyfire [ID]" );
  10. if( !( 0 < fid < MAX_FIRES ) ) {
  11. return SendClientMessage( playerid, COLOR_GREY, "You have specified a fire ID out of range. Try again." );
  12. }
  13. DestroyFire( fid );
  14. SendClientMessage( playerid, COLOR_GREY, "The fire has been destroyed." );
  15. }
  16. return 1;
  17. }
  18. CMD:getfireid(playerid, params[]) {
  19. if(PlayerInfo[playerid][pAdmin] >= 3) {
  20. new fid = GetPlayerClosestFire(playerid);
  21. new string[30];
  22. format(string, sizeof(string), "The fireid is %d.", fid);
  23. SendClientMessage(playerid, COLOR_GREY, string);
  24. }
  25. return 1;
  26. }
  27. CMD:destroyallfires(playerid, params[]) {
  28. if(PlayerInfo[playerid][pAdmin] >= 3) {
  29. for(new i; i < GetFirePoolSize(); i++) {
  30. if(IsValidFire(i)) {
  31. DestroyFire(i);
  32. }
  33. }
  34. }
  35. return 1;
  36. }
  37. CMD:destroyfiresinarea(playerid, params[]) {
  38. if(PlayerInfo[playerid][pAdmin] >= 3) {
  39. new Float:radius;
  40. if(sscanf(params, "f", radius)) {
  41. return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /destroyfiresinarea [radius]");
  42. }
  43. for(new i; i < MAX_FIRES; i++) {
  44. if(!IsValidFire(i)) continue;
  45. new Float:fx, Float:fy, Float:fz;
  46. GetFirePos(i, fx, fy, fz);
  47. if(IsPlayerInRangeOfPoint(playerid, radius, fx, fy, fz)) {
  48. DestroyFire(i);
  49. }
  50. }
  51. SendClientMessage(playerid, COLOR_GREY, "You have destroyed all fires within the specified radius.");
  52. }
  53. return 1;
  54. }