Guest User

[PAWN] Trancar e destrancar

a guest
May 27th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1.     static bool:CarrosTrancado[MAX_PLAYERS];
  2.  
  3.     if(!strcmp(cmdtext, "/trancar", true))
  4.  
  5.     {      
  6.  
  7.             if(!IsPlayerInAnyVehicle(playerid))     return  SendClientMessage(playerid, 0x00F6F6AA, "Vc nao tem um carro!");
  8.  
  9.             if(CarrosTrancado[playerid] == true)    return  SendClientMessage(playerid,0x00F6F6AA,"Seu carro agora esta trancado");
  10.  
  11.             new
  12.  
  13.                     iLoop = 0,
  14.  
  15.                     iVeh = GetPlayerVehicleID(playerid);
  16.  
  17.             for( ; iLoop  < MAX_PLAYERS; iLoop++)
  18.  
  19.             {
  20.  
  21.                     if(iLoop  == playerid || !IsPlayerConnected(iLoop)) continue;
  22.  
  23.                     SetVehicleParamsForPlayer(iVeh,iLoop, 0, 1);          
  24.  
  25.             }
  26.  
  27.             CarrosTrancado[playerid]  = true;
  28.  
  29.             SendClientMessage(playerid, 0x00F6F6AA, "Carro Trancado!");
  30.  
  31.             return true;
  32.  
  33.     }
  34.  
  35.     if(!strcmp(cmdtext, "/destrancar", true))
  36.  
  37.     {      
  38.  
  39.             if(!IsPlayerInAnyVehicle(playerid))     return  SendClientMessage(playerid, 0x00F6F6AA, "Vc nao tem um carro!");
  40.  
  41.             if(CarrosTrancado[playerid] == false)   return  SendClientMessage(playerid,0x00F6F6AA,"Seu carro agora esta destrancado");
  42.  
  43.             new
  44.  
  45.                     iLoop = 0,
  46.  
  47.                     iVeh = GetPlayerVehicleID(playerid);
  48.  
  49.             for( ; iLoop  < MAX_PLAYERS; iLoop++)
  50.  
  51.             {
  52.  
  53.                     if(iLoop  == playerid || !IsPlayerConnected(iLoop)) continue;
  54.  
  55.                     SetVehicleParamsForPlayer(iVeh,iLoop, 0, 0);  
  56.  
  57.             }
  58.  
  59.             CarrosTrancado[playerid]  = false;
  60.  
  61.             SendClientMessage(playerid, 0x00F6F6AA, "Carro destrancado!");
  62.  
  63.             return true;
  64.  
  65.     }
  66.  
  67.     //By Andrew e DraKiNs
Advertisement
Add Comment
Please, Sign In to add comment