Guest User

Untitled

a guest
Jan 17th, 2011
551
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.21 KB | None | 0 0
  1. //Começo do GM
  2.  
  3. forward PlayerToPoint( Float:radi, playerid, Float:x, Float:y, Float:z)   ;
  4. new Veiculo,Comeco,TmrVeiculo;
  5. new PlayerAperto[MAX_PLAYERS];
  6. forward Fogo();
  7.  
  8. //OnGameModeInit
  9.  
  10.  
  11. Veiculo=CreateVehicle(411,-1558.9570,1184.3970,6.9030,149.9782,0,0,5000000);
  12.  
  13. //OnPlayerKeyStateChange
  14.  
  15.  
  16. if(newkeys==KEY_FIRE)
  17. {
  18.     if(PlayerToPoint(10.0, playerid,-1558.9570,1184.3970,6.9030))
  19.     {
  20.         if(GetPlayerWeapon(playerid) == 42 )
  21.         {
  22.                         if(GetPlayerSkin(playerid) == 278)
  23.                         {
  24.                 PlayerAperto[playerid]++;
  25.                 if(PlayerAperto[playerid] >= 5)
  26.                 {
  27.                     PlayerAperto[playerid]=0;
  28.                     Comeco=2;
  29.                 }
  30.                 }
  31.            }
  32.        }
  33. }
  34.  
  35.  
  36. //OnPlayerCommandText
  37.  
  38. if(!strcmp(cmdtext, "/incendio", true))
  39. {
  40. if(IsPlayerAdmin(playerid))
  41. {
  42.         SendClientMessage(playerid,0xFFFF00AA,"Você criou um Incêndio");
  43.         Comeco=0,TmrVeiculo=0,Fogo();
  44.         for(new i;i<50;i++) if(GetPlayerSkin(playerid) == 278)
  45.         {
  46.  
  47.             SendClientMessage(i,0xFF0000AA,"Um incêndio se inciou, vá até o checkpoint em seu mapa para apagá-lo! Vocês tem 10 minutos para chegar!");
  48.             SetPlayerRaceCheckpoint(i,1,-1558.9570,1184.3970,6.9030,0.0,0.0,0.0,10);
  49.         }
  50.     }
  51.     return 1;
  52. }
  53.  
  54. //Final do Game Mode
  55.  
  56. public Fogo(){
  57.     TmrVeiculo++;
  58.     if(TmrVeiculo>=3){
  59.         switch(Comeco){
  60.             case 0: SetVehicleHealth(Veiculo,20.0),Comeco=1,TmrVeiculo=0;
  61.             case 1: SetVehicleHealth(Veiculo,1000.0),Comeco=0,TmrVeiculo=2;
  62.             case 2: SetVehicleHealth(Veiculo,1000.0),Comeco=3;
  63.         }
  64.     }
  65.     SetTimer("Fogo",1000,false);
  66.     return 0;
  67. }
  68.  
  69. public PlayerToPoint( Float:radi, playerid, Float:x, Float:y, Float:z)
  70. {
  71.     if ( IsPlayerConnected( playerid)  )
  72.     {
  73.         new Float:oldposx, Float:oldposy, Float:oldposz ;
  74.         new Float:tempposx, Float:tempposy, Float:tempposz ;
  75.         GetPlayerPos( playerid, oldposx, oldposy, oldposz)   ;
  76.         tempposx = ( oldposx -x)   ;
  77.         tempposy = ( oldposy -y)   ;
  78.         tempposz = ( oldposz -z)   ;
  79.         //printf( "DEBUG: X:%f Y:%f Z:%f",posx,posy,posz)   ;
  80.         if ( ( ( tempposx < radi)   && ( tempposx > -radi)  )   && ( ( tempposy < radi)   && ( tempposy > -radi)  )   && ( ( tempposz < radi)   && ( tempposz > -radi)  )  )
  81.         {
  82.             return 1 ;
  83.         }
  84.     }
  85.     return 0 ;
  86. }
  87.  
  88.  
  89. // By [FeK]Knife
  90. // [FeK]Squad
Advertisement
Add Comment
Please, Sign In to add comment