[Ajuda] AttachObjectToVehicle - 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] AttachObjectToVehicle (
/showthread.php?tid=625707)
AttachObjectToVehicle -
B4dSh33p - 05.01.2017
Resolvido
Re: AttachObjectToVehicle -
AuhMaru - 05.01.2017
PHP код:
new objectNeon[MAX_PLAYERS];
CMD:neon(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, -1, "Vocк nгo estб dentro de um veнculo!");
objectNeon[GetPlayerVehicleID(playerid)] = CreateObject(18648, 0, 0, -1000, 0, 0, 0, 100);
AttachObjectToVehicle(objectNeon[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.824999, 0.000000, -0.524999, 0.000000, 0.000000, 0.000000);
return true;
}
//Comando para remover o objeto.
CMD:rneon(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, -1, "Vocк nгo estб dentro de um veнculo!");
DestroyObject(objectNeon[GetPlayerVehicleID(playerid)]);
return true;
}
//Se o veнculo fфr destruнdo irб remover o objeto.
public OnVehicleDeath(vehicleid, killerid)
{
DestroyObject(objectNeon[vehicleid]);
return true;
}
Coloque no comando de deletar veнculo do seu GM a funзгo:
Код:
DestroyObject(objectNeon[GetPlayerVehicleID(playerid)]);
Re: AttachObjectToVehicle -
B4dSh33p - 05.01.2017
Jб fiz dessa forma usando o
PHP код:
public OnVehicleDeath(vehicleid, killerid)
so que toda vez que o veiculo sai do servidor e volta um para ocupar o ID que saiu, o neon volta sozinho
Re: AttachObjectToVehicle -
HeisenGiromB - 05.01.2017
PHP код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
Atй msm fazendo na
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
Re: AttachObjectToVehicle -
B4dSh33p - 05.01.2017
Sim, e atй mesmo jб tentei destruir usando o
PHP код:
public OnVehicleSpawn(vehicleid)
Re: AttachObjectToVehicle -
didimk157 - 05.01.2017
Eu usei esse codigo aqui na mh gm e ta funcionando de boa mn
A unica coisa que aconteceu foi que so veio um neon