Remove vehicle - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Remove vehicle (
/showthread.php?tid=368864)
Remove vehicle -
Ratchet_xD - 14.08.2012
Hi all. This is pickup which spawn car , but I want that the car was removed after disconnect player of server. Can anyone help me ? Thanks.
static vehicle[MAX_PLAYERS];
GetPlayerPos(playerid,X,Y,Z);
DestroyVehicle(vehicle[playerid]);
vehicle[playerid] = CreateVehicle(411,1473.2228,1812.3469,10.8125,0,ra ndom(126),random(126),-1);
PutPlayerInVehicle(playerid,vehicle[playerid], 0);
Re: Remove vehicle -
Jefff - 14.08.2012
put on top of gamemode
new vehicle[MAX_PLAYERS];
remove
static vehicle[MAX_PLAYERS];
and in OnPlayerDisconnect
if(vehicle[playerid]) DestroyVehicle(vehicle[playerid]);
vehicle[playerid] = 0;
Re: Remove vehicle -
[BOPE]Seu._.Madruga - 14.08.2012
pawn Код:
/*-- no inicio do gm --*/
new veiculo[MAX_PLAYERS];
/*aonde voce for por sua funзгo coloque assim*/
veiculo[playerid] = CreateVehicle(411,1473.2228,1812.3469,10.8125,0,random(126),random(126),-1);
PutPlayerInVehicle(playerid, veнculo[playerid], 0);
/*-- na public OnPlayerDisconnect(playerid, reason) --*/
DestroyVehicle(veiculo[playerid]);
Um exemplo mais simples:
pawn Код:
#include <a_samp>
new veiculo[MAX_PLAYERS];
/*aonde voce for por sua funзгo coloque assim*/
veiculo[playerid] = CreateVehicle(411,1473.2228,1812.3469,10.8125,0,random(126),random(126),-1);
PutPlayerInVehicle(playerid, veнculo[playerid], 0);
public OnPlayerDisconnect(playerid, reason)
{
DestroyVehicle(veiculo[playerid]);
}
Ajudei ? da reputaзгo ae
Код:
Meus Projetos
¤ GameModes ¤
Brasil City Virtual 0.3e ---- 78 % Completed
»» Forum: BcvGames.forumbrasil.net
»» Site: Gta Lokidoido
»» Servidor: [0.3e] • Brasil City Virtual • [RPG v1.0]
»» Equipe: Murilo / dPlaYer / Malakas / Bruno_. e Emerson_.
»» Ajudei ? da reputaзгo ae: Dar Reputaзгo
Re: Remove vehicle -
Ratchet_xD - 14.08.2012
Quote:
Originally Posted by Jefff
put on top of gamemode
new vehicle[MAX_PLAYERS];
remove
static vehicle[MAX_PLAYERS];
and in OnPlayerDisconnect
if(vehicle[playerid]) DestroyVehicle(vehicle[playerid]);
vehicle[playerid] = 0;
|
Thanks a lot.