LucasViniciusLV

[CODE]: AntiCrash - @ThunderGamesBR

Aug 21st, 2013
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.59 KB | None | 0 0
  1. #include a_samp
  2.  
  3. //Author: Armando Alves (DoDo)
  4.  
  5. new VeiculoBugado[MAX_VEHICLES];
  6.  
  7. stock VerificarVeiculoCrashado(playerid, id)
  8. {
  9.     if(!VeiculoBugado[id])
  10.     {
  11.         VeiculoBugado[id] = id;
  12.         new Float:Pos[3];
  13.         for(new i; i<MAX_PLAYERS; i++)
  14.         {
  15.             if(IsPlayerConnected(i))
  16.             {
  17.                 GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  18.                 if(GetPlayerVehicleID(i) == VeiculoBugado[id])
  19.                 {
  20.                     if(Pos[0] >= 999999.875000 || Pos[1] >= 10000000.000000 || Pos[2] >= 1410065408.000000)
  21.                     {
  22.                         CrashadoVeiculo(i);
  23.                     }
  24.                     else
  25.                     {
  26.                         CrashouVeiculo(i);
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.         VeiculoBugado[id] = -1;
  32.     }
  33. }
  34.  
  35. stock CrashadoVeiculo(i)
  36. {
  37.     GameTextForPlayer(i, "Retornando a tela inicial", 10000, 5);
  38.     SetPlayerPos(i, 0.0, 0.0, 0.0);
  39.     SpawnPlayer(i);
  40. }
  41.  
  42. stock CrashouVeiculo(i)
  43. {
  44.     Ban(i);
  45. }
  46. public OnPlayerUpdate(playerid)
  47. {
  48.     new Float:pos[3];
  49.     GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  50.     if(pos[0] >= 10000000.000000 || pos[1] >= 10000000.000000 || pos[2] >= 1410065408.000000)
  51.     {
  52.         if(IsPlayerInAnyVehicle(playerid))
  53.         {
  54.             VerificarVeiculoCrashado(playerid, GetPlayerVehicleID(playerid));
  55.         }
  56.         GameTextForPlayer(playerid, "Retornando a tela inicial", 10000, 5);
  57.         SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  58.         SpawnPlayer(playerid);
  59.     }
  60.     return 0x01;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment