DiogoB

[Pawn](Des)Trancar veículos

Feb 19th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.27 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. static
  5.     v,
  6.     x,
  7.     y,
  8.     bool: cT[MAX_PLAYERS];
  9.  
  10. CMD:trancar(playerid, params[])
  11. {
  12.     if(!IsPlayerInAnyVehicle(playerid))
  13.         return SendClientMessage(playerid, -1, "Sem carro!");
  14.  
  15.     if(cT[playerid] == true)
  16.         return SendClientMessage(playerid, -1, "Carro já está trancado!");
  17.  
  18.     v = GetPlayerVehicleID(playerid);
  19.     x = 0;
  20.     y = GetMaxPlayers();
  21.  
  22.     for( ; x != y; x++)
  23.     {
  24.         if(x == playerid)
  25.         {
  26.             if(!IsPlayerConnected(x))
  27.                 continue
  28.  
  29.             SetVehicleParamsForPlayer(v, x, 0, 1);
  30.  
  31.         }
  32.     }
  33.     cT[playerid] = true;
  34.  
  35.     return true;
  36. }
  37.  
  38.  
  39. CMD:destrancar(playerid, params[])
  40. {
  41.     if(!IsPlayerInAnyVehicle(playerid))
  42.         return SendClientMessage(playerid, -1, "Sem carro!");
  43.    
  44.     if(cT[playerid] == false)
  45.         return SendClientMessage(playerid, -1, "Carro já está destrancado!");
  46.  
  47.     v = GetPlayerVehicleID(playerid);
  48.     x = 0;
  49.     y = GetMaxPlayers();
  50.    
  51.     for( ; x != y; x++)
  52.     {
  53.         if(x == playerid)
  54.         {
  55.             if(!IsPlayerConnected(x))
  56.                 continue;
  57.    
  58.             SetVehicleParamsForPlayer(v, x, 0, 0);
  59.         }
  60.     }
  61.     cT[playerid] = false;
  62.  
  63.     return true;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment