[Question] How to get rid of spawned vehicles -
[AXS]Bryce - 22.03.2010
hey its me once more again! lol
i was just wondering if theres a command where you can get rid of all the spawned vehicles in the server since its rly annoying when u just have cars and crap lying around .. especially at the race starts .. oohh so many of them.
thanks, Bryce
Re: [Question] How to get rid of spawned vehicles -
bobby4life - 22.03.2010
i really dont no aye
Re: [Question] How to get rid of spawned vehicles -
bobby4life - 22.03.2010
i dont no its hard
Re: [Question] How to get rid of spawned vehicles -
FujiNNN - 22.03.2010
Quote:
Originally Posted by bobby4life
i dont no its hard
|
dude.. its not an IRC channel do NOT spam here!
and for your request:
you can use
GetPlayerVehicleID(playerid);
IsPlayerInAnyVehicle(playerid);
DestroyVehicle(VEHICLEID);
Re: [Question] How to get rid of spawned vehicles -
[AXS]Bryce - 22.03.2010
yeh im kinda nooby so i dno waht rly to do here...
if i use this does it mean that it will only destroy the vehicle if someones in it?
Re: [Question] How to get rid of spawned vehicles -
FujiNNN - 22.03.2010
try using those:
pawn Код:
if(strcmp(cmd, "/vehid", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new strid = GetPlayerVehicleID(playerid);
format(string, sizeof(string), "Vehicle ID: %d",strid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
return 1;
}
--> THIS WILL GET YOU THE ID OF THE VEHICLE YOU ARE SITTING IN RIGHT NOW.
pawn Код:
if(strcmp(cmd, "/reloadvehicles", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(IsVehicleOccupied(i) == 0)
{
SetVehicleToRespawn(i);
}
}
SendClientMessage(playerid, COLOR_RED, "* All vehicles have been reloaded.");
}
return 1;
}
--> THIS ONE TO RELOAD (ALL) OF YOUR VEHICLES ON YOU GAMESERVER.
pawn Код:
[url=http://wiki.sa-mp.com/wiki/DestroyVehicle]https://sampwiki.blast.hk/wiki/DestroyVehicle[/url]
Re: [Question] How to get rid of spawned vehicles -
Torran - 22.03.2010
Quote:
Originally Posted by FujiNNN
pawn Код:
[url=http://wiki.sa-mp.com/wiki/DestroyVehicle]https://sampwiki.blast.hk/wiki/DestroyVehicle[/url]
|
Fail lol
https://sampwiki.blast.hk/wiki/DestroyVehicle
Re: [Question] How to get rid of spawned vehicles -
[AXS]Bryce - 22.03.2010
on the second one i get an error message saying,
"error 017: undefined symbol "IsVehicleOccupied""
so thats a bit of a doosie
Re: [Question] How to get rid of spawned vehicles -
[AXS]Bryce - 22.03.2010
hey i just had an idea! lol
mabe i could use 'onplayerexitvehicle' so when the player exits the vehicle it gets destroyed?? is there a way to do that?
Re: [Question] How to get rid of spawned vehicles -
[AXS]Bryce - 22.03.2010
oh sweet i made my own script! lol its pretty simple though
i just put this under "onplayerexitveh"
Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
thanks for the help FujiNNN!