Advertisement
DraKiNs

[COD] Trancar e Destrancar Carro

Jun 26th, 2011
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.29 KB | None | 0 0
  1. static bool:CarrosTrancado[MAX_PLAYERS];
  2. if(!strcmp(cmdtext, "/trancar", true))
  3. {  
  4.     if(!IsPlayerInAnyVehicle(playerid)) return  SendClientMessage(playerid, 0x00F6F6AA, "Vc nao tem um carro!");
  5.     if(CarrosTrancado[playerid] == true)    return  SendClientMessage(playerid,0x00F6F6AA,"Seu carro agora esta trancado");
  6.  
  7.     new
  8.         iLoop = 0,
  9.         iVeh = GetPlayerVehicleID(playerid);
  10.  
  11.     for( ; iLoop  < MAX_PLAYERS; iLoop++)
  12.     {
  13.         if(iLoop  == playerid || !IsPlayerConnected(iLoop)) continue;
  14.         SetVehicleParamsForPlayer(iVeh,iLoop, 0, 1);       
  15.  
  16.     }
  17.     CarrosTrancado[playerid]  = true;
  18.     SendClientMessage(playerid, 0x00F6F6AA, "Carro Trancado!");
  19.     return true;
  20. }
  21.  
  22. if(!strcmp(cmdtext, "/destrancar", true))
  23. {  
  24.     if(!IsPlayerInAnyVehicle(playerid)) return  SendClientMessage(playerid, 0x00F6F6AA, "Vc nao tem um carro!");
  25.     if(CarrosTrancado[playerid] == false)   return  SendClientMessage(playerid,0x00F6F6AA,"Seu carro agora esta destrancado");
  26.  
  27.     new
  28.         iLoop = 0,
  29.         iVeh = GetPlayerVehicleID(playerid);
  30.  
  31.     for( ; iLoop  < MAX_PLAYERS; iLoop++)
  32.     {
  33.         if(iLoop  == playerid || !IsPlayerConnected(iLoop)) continue;
  34.         SetVehicleParamsForPlayer(iVeh,iLoop, 0, 0);   
  35.  
  36.     }
  37.     CarrosTrancado[playerid]  = false;
  38.     SendClientMessage(playerid, 0x00F6F6AA, "Carro destrancado!");
  39.     return true;
  40. }
  41. //By Andrew e DraKiNs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement