Advertisement
garfield

[COD]: Comando para Criar um carro por pessoa.

Jun 25th, 2015
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.15 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. new
  5.     MeuCarro[ MAX_PLAYERS ]
  6. ;
  7.  
  8. public OnPlayerConnect(playerid){
  9.  
  10.     MeuCarro[playerid] = -1;
  11.     return true;
  12. }
  13.  
  14.  
  15. CMD:cv(playerid, params[]){
  16.  
  17.  
  18.     static
  19.         _vehicle
  20.     ;
  21.      
  22.     _vehicle = strval(params);
  23.      
  24.      
  25.     if(isnull(params) || (_vehicle > 600) || (_vehicle < 400))
  26.         return SendClientMessage(playerid, -1, " | ERRO | Digite: /cv [id-do-caro]");
  27.          
  28.     if(~MeuCarro[playerid]) DestroyVehicle(MeuCarro[playerid]);
  29.          
  30.     static
  31.         Float:x,
  32.         Float:y,
  33.         Float:z,
  34.         vw,int
  35.     ;
  36.      
  37.     // Coletando dados
  38.     GetPlayerPos(playerid, x, y, z);
  39.     vw = GetPlayerVirtualWorld(playerid);
  40.     int = GetPlayerInterior(playerid);
  41.      
  42.     // Setando dados
  43.     MeuCarro[playerid] = CreateVehicle(_vehicle, x,y,z, 0, -1, -1, 0);
  44.     PutPlayerInVehicle(playerid, MeuCarro[playerid], 0);
  45.  
  46.      LinkVehicleToInterior(MeuCarro[playerid],  int);
  47.     SetVehicleVirtualWorld(MeuCarro[playerid], vw);
  48.      
  49.      
  50.     SendClientMessage(playerid, -1, "Você criou um veiculo com sucesso!");
  51.     return true;
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement