Advertisement
nandoy

Untitled

Apr 4th, 2015
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.14 KB | None | 0 0
  1. //OnGameModeInit
  2. SetTimer("UpdateCotocos", 700, 1);
  3. forward UpdateCotocos();
  4. public UpdateCotocos()
  5. {
  6.     for(new I = 0; I < MAX_PLAYERS; I++)
  7.         if(IsPlayerConnected(I) && Player[I][pLogged] && !IsPlayerNPC(I))
  8.             ApplyUpdate(playerid);
  9.     return 1;
  10. }
  11.  
  12. ApplyUpdate(playerid);
  13. public ApplyUpdate(playerid)
  14. {
  15.     if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  16.     {
  17.         for(new i = 0; i < sizeof(SpikeInfo); ++i)
  18.         {
  19.             if(IsPlayerInRangeOfPoint(playerid, 3.0, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
  20.             {
  21.                 if(SpikeInfo[i][sCreated] == 1)
  22.                 {
  23.                     static panels, doors, lights, tires;
  24.                     new carid = GetPlayerVehicleID(playerid);
  25.                     GetVehicleDamageStatus(carid, panels, doors, lights, tires);
  26.                     tires = encode_tires(1, 1, 1, 1);
  27.                     UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
  28.                 }
  29.             }
  30.         }
  31.     }
  32.     new Float:hv;
  33.     GetVehicleHealth(GetPlayerVehicleID(playerid), hv);
  34.  
  35.     if(IsPlayerInAnyVehicle(playerid) && hv < 300.0)
  36.         return SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  37.  
  38.     if(Player[playerid][pInArena] && Arena[Jogadores] < 2 && Arena[EventoIniciado])
  39.     {
  40.         GivePlayerMoney(playerid, VALOR_INGRESSO*6),
  41.             _cesair_arena(playerid),
  42.                 ResetPlayerWeapons(playerid);
  43.  
  44.         Arena[EventoIniciado] = true;
  45.         Arena[a_Status] = false;
  46.         Arena[a_Arrecadado] = 0;
  47.         Arena[a_Contagem] = 0;
  48.  
  49.         each(Players->new i)
  50.             if(Player[i][pInArena])
  51.                 SpawnPlayer(i), Player[i][pInArena] = false;
  52.     }
  53.  
  54.     if(GetPVarInt(playerid, "ac_iveh"))
  55.     {
  56.         if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetPVarInt(playerid, "ac_id") != GetPlayerVehicleID(playerid))
  57.             PunirSpam(playerid);
  58.     }
  59.  
  60.     if(GetPlayerScore(playerid) < 2 && EntrouDM[playerid] == false && Player[playerid][pXOneGun] == false)
  61.         ResetPlayerWeapons(playerid);
  62.  
  63.     new Float:h, Float:a;
  64.     GetPlayerHealth(playerid, h);
  65.     GetPlayerArmour(playerid, a);
  66.     if(GetPlayerWeapon(playerid) == 41 && EntrouDM[playerid] == false && Player[playerid][pXOneGun] == false)
  67.         if(!Player[playerid][pVip] && !Player[playerid][pAdmin] && !IsPM(playerid, 1) && !Player[playerid][pInArena] && !Player[playerid][pTrafN])
  68.             Kick(playerid);
  69.  
  70.     if(EntrouDM[playerid] == false && Player[playerid][pXOneGun] == false)
  71.     {
  72.         switch(GetPlayerWeapon(playerid))
  73.         {
  74.             case 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 8, 9, 16, 26, 27, 35, 36, 37, 38, 39, 40, 42, 44, 45:
  75.                 if(!Player[playerid][pAdmin] && !IsPM(playerid, 1) && !Player[playerid][pInArena] && !Player[playerid][pTrafN] && !Player[playerid][CityVip])
  76.                     Kick(playerid);
  77.         }
  78.     }
  79.     if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  80.     {
  81.         new Float:vec[3];
  82.         GetPlayerCameraFrontVector(playerid, vec[0], vec[1], vec[2]);
  83.         new bool:possible_crasher = false;
  84.         for (new i = 0; !possible_crasher && i < sizeof(vec); i++)
  85.             if (floatabs(vec[i]) > 10.0)
  86.                 possible_crasher = true;
  87.  
  88.         if (possible_crasher)
  89.             Kick(playerid);
  90.     }
  91.     return 1;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement