Advertisement
Guest User

Bloquear Veículo.

a guest
May 29th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. new BlockVeh[MAX_PLAYERS];
  2.  
  3. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  4. {
  5.     new VehModel = GetVehicleModel(vehicleid);
  6.     if(VehModel == 520 || VehModel == 425)
  7.     {
  8.         if(BlockVeh[playerid] == 1) // Caso ele esteja bloqueado para andar.
  9.         {
  10.             SendClientMessage(playerid, 0xFF0000FF, "Já deu o seu tempo de usar o Hydra.");
  11.             RemovePlayerFromVehicle(playerid);
  12.             SetTimerEx("LiberarVeh", 60000, false, "i", playerid); // Irá setar um tempo para ele usar novamente.
  13.         }
  14.         else // Caso ele não esteja bloqueado para andar.
  15.         {
  16.             SendClientMessage(playerid, -1, "Bem vindo a um Hydra/Hunter.");
  17.             SetTimerEx("BloquearVeh", 10000, false, "i", playerid); // Ele anda 10 segundos com o veículo e é removido.
  18.         }
  19.     }
  20.     return 1;
  21. }
  22.  
  23. forward BloquearVeh(playerid);
  24. public BloquearVeh(playerid)
  25. {
  26.     BlockVeh[playerid] = 1;
  27.     return 1;
  28. }
  29.  
  30. forward LiberarVeh(playerid);
  31. public LiberarVeh(playerid)
  32. {
  33.     BlockVeh[playerid] = 0;
  34.     return 1;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement