camp.inc 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //Putting out camp fires
  2. CMD:putoutfire(playerid, params[]) {
  3. for(new i = 0; i < MAX_FIRES; i++) {
  4. if( IsValidFire(i) ) {
  5. if( ( GetFireOwner(i) == playerid ) && GetFireType(i) == FIRE_SMALL ) {
  6. new
  7. Float:fx, Float:fy, Float:fz;
  8. GetFirePos(i, fx, fy, fz);
  9. if(IsPlayerInRangeOfPoint(playerid, 3.0, fx, fy, fz)) {
  10. DestroyFire( i );
  11. new string[144];
  12. format( string, sizeof(string), "* %s fiddles with the fire and puts it out.", PlayerICName( playerid ) );
  13. ProxDetector( 30.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE );
  14. return 1;
  15. }
  16. }
  17. }
  18. }
  19. SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error:{FFFFFF} You're not by your fire, or haven't placed any.");
  20. return 1;
  21. }
  22. Hook:Camp_OnPlayerDisconnect(playerid) {
  23. for(new i = 0; i < MAX_FIRES; i++) //camp fire system
  24. {
  25. if(IsValidFire(i)) {
  26. if(GetFireOwner(i) == playerid) {
  27. DestroyFire(i);
  28. break;
  29. }
  30. }
  31. }
  32. return 1;
  33. }