SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/10/2019, 12:50 PM   #1
Vizi10
Huge Clucker
 
Join Date: May 2017
Location: Iran
Posts: 215
Reputation: 7
Default prevent respawn specific vehicle

When i respawn all vehicles in gamemode with cmd the filterscript vehicles respawned.
How to prevent?

pawn Code:
public OnVehicleSpawn(vehicleid)
{
    for(new v; v < sizeof(EventVehicles); v++)
    {
        if(vehicleid == EventVehicles[v])
        {

        }
    }
    return 1;
}
Vizi10 is offline   Reply With Quote
Old 19/10/2019, 02:42 PM   #2
NoteND
Big Clucker
 
Join Date: May 2016
Posts: 187
Reputation: 3
Default Re: prevent respawn specific vehicle

Well, if you use this

Code:
CreateVehicle
you can set second to last parameter to "-1". This will prevent vehicle from respawning.

Read here: https://wiki.sa-mp.com/wiki/CreateVehicle
NoteND is online now   Reply With Quote
Old 19/10/2019, 03:44 PM   #3
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,441
Reputation: 1620
Default Re: prevent respawn specific vehicle

If the gamemode sends a reloadfs command using the command, and all vehicles are destroyed again in the FS (OnFSExit) and then created again (OnFSInit) they will be recreated and thus spawned.
You could either use the gvar plugin to set a variable to check if it is the first spawn of those vehicles, or add this variable in a file or mysql db.

Note that filterscripts are loaded before the gamemode (assuming they are loaded with server.cfg)
Kwarde is offline   Reply With Quote
Old 19/10/2019, 05:17 PM   #4
Vizi10
Huge Clucker
 
Join Date: May 2017
Location: Iran
Posts: 215
Reputation: 7
Default Re: prevent respawn specific vehicle

Thanks.
Vizi10 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent vehicles respawn SDraw Scripting Help 2 06/06/2013 05:15 PM
If you want to enter a specific vehicle ID, you need a specific skin davelord Scripting Help 9 07/08/2012 02:09 AM
Prevent respawn & Spectate Amator Help Archive 2 31/10/2010 10:32 AM
How can i spawn a specific player in a specific vehicle ? AlbanianGuy Help Archive 8 16/01/2010 08:31 AM


All times are GMT. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.