SA-MP Forums Archive
[AJUDA]Sistema De Destruir Carro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [AJUDA]Sistema De Destruir Carro (/showthread.php?tid=252980)



[AJUDA]Sistema De Destruir Carro - ReDKiiL - 04.05.2011

Bom Gente Um Arrumei Um FS De Fazer Carro.
Mais Da Para Cria Um Monte De Carro e Fica Enchendo o Mapa De Carros Sem Precisгo.
Tem Como Adicionar Um Cуdigo Nesse Fs Para Destruir Os Carro Que Nгo Forem Usados Tipo o Player Pego Um Carro
Depois Pegou Outro. Dae o Que Ele Pegou Anterior Sumir.

Ajuda Ai Galera Vlw


Re: [AJUDA]Sistema De Destruir Carro - Macintosh - 04.05.2011

Use a funзгo DestroyVehicle

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
 new veiculo;
 veiculo = GetPlayerVehicleID(playerid);
 DestroyVehicle(veiculo);
 return 1;
}



Re: [AJUDA]Sistema De Destruir Carro - Ricop522 - 04.05.2011

PHP код:
public OnPlayerExitVehicle(playeridvehicleid)
{
    
DestroyVehicle(GetPlayerVehicleID(playerid));
    return 
1;




Re: [AJUDA]Sistema De Destruir Carro - Shadoww5 - 04.05.2011

Й so vocк mudar o final do codigo para criar carros:

Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawn_delay)

respawn_delay	The delay until the car is respawned without a driver in seconds.
Fonte: https://sampwiki.blast.hk/wiki/CreateVehicle

Logo se vocк colocar 60 segundos na ultima parte deste codigo, quando o carro estiver sem ninguem por 1 minuto ele serб respawnado (o carro) automaticamente.


Re: [AJUDA]Sistema De Destruir Carro - Chefгo - 04.05.2011

Quote:
Originally Posted by Shickcard
Посмотреть сообщение
Use a funзгo DestroyVehicle

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
 new veiculo;
 veiculo = GetPlayerVehicleID(playerid);
 DestroyVehicle(veiculo);
 return 1;
}
euri muito dessa!


Re: [AJUDA]Sistema De Destruir Carro - Eriick_OwnZ - 04.05.2011

Quote:
Originally Posted by Chefгo
Посмотреть сообщение
euri muito dessa!
Quote:
Originally Posted by Shickcard
Посмотреть сообщение
Use a funзгo DestroyVehicle

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
 new veiculo;
 veiculo = GetPlayerVehicleID(playerid);
 DestroyVehicle(veiculo);
 return 1;
}
LOL ? KKKK
player quando sair do carro destroir?
tensгo


Re: [AJUDA]Sistema De Destruir Carro - [BEP]AcerPilot - 04.05.2011

Quote:
Originally Posted by Eriick_OwnZ
Посмотреть сообщение
LOL ? KKKK
player quando sair do carro destroir?
tensгo
Na verdade й porque ele fez uma variбvel pra pegar o ID do veнculo quando o ID jб estб evidente na public, й o parвmetro vehicleid, ficaria:

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid) { DestroyVehicle(vehicleid); return 1; }



Re: [AJUDA]Sistema De Destruir Carro - [R] ousenber [K] - 04.05.2011

cara tem isso do fs de test_cmds.pwn que vem na pasta de FS original da SAMP la tem o de cria e de destruir so tem q saber o numerro do carro isso vc acha no Codigos uteis q achei um comando la assim!


Re: [AJUDA]Sistema De Destruir Carro - Macintosh - 04.05.2011

Peguei no Wiki SA-MP nem cheguei a analisar o cуdigo ;x

https://sampwiki.blast.hk/wiki/DestroyVehicle

Cуdigo Original
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
     //First the script gets the vehicle id of the current car and then destroys it when typing /destroyveh
     if(strcmp(cmdtext, "/destroyveh", true) == 0)
     {
          new currentveh;
          currentveh = GetPlayerVehicleID(playerid);
          DestroyVehicle(currentveh);
          return 1;
     }
 
     return 0;
}



Re: [AJUDA]Sistema De Destruir Carro - Shadoww5 - 04.05.2011

Caso vocк queira que o carro seja destruнdo, use o codigo do [BEP]AcerPilot, mas se vocк quiser que ele seja respawnado, use o meu codigo.