SA-MP Forums Archive
Locked vehicles - 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: Locked vehicles (/showthread.php?tid=581394)



Locked vehicles - aalbero99 - 12.07.2015

Hey, I've been trying to script a system which spawns locked vehicles, depending on their ID. I tried using SetVehicleParamsForPlayer in the callbacks OnVehicleStreamIn and OnVehicleStreamOut, but they still are unlocked. Anyone knows what's wrong?
Thanks!


Re : Locked vehicles - KillerDVX - 12.07.2015

Check this out : https://sampforum.blast.hk/showthread.php?tid=363742

It may helps.




Respuesta: Locked vehicles - aalbero99 - 12.07.2015

I understand the code and everything, but I'd like not to use GetPlayerVehicleID since the cars should be locked as soon as they spawn, without needing to check the player's seat or if they're inside a car or not. Oh and also without an ownership system, just spawn locked vehicles. Thanks!


Re : Locked vehicles - KillerDVX - 12.07.2015

So call this CallBack :

PHP код:
public OnVehicleSpawn(vehicleid)
{
    return 
1;




Respuesta: Re : Locked vehicles - aalbero99 - 12.07.2015

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
So call this CallBack :

PHP код:
public OnVehicleSpawn(vehicleid)
{
    return 
1;

So make the SetVehicleParamsForPlayer in this callback right?


Re: Respuesta: Re : Locked vehicles - Maximun - 12.07.2015

Quote:
Originally Posted by aalbero99
Посмотреть сообщение
So make the SetVehicleParamsForPlayer in this callback right?
exactly


Respuesta: Re: Respuesta: Re : Locked vehicles - aalbero99 - 12.07.2015

Quote:
Originally Posted by Maximun
Посмотреть сообщение
exactly
Done it, but I get an error saying that playerid is undefined, yet it's one of the needed parameters.


Re: Locked vehicles - Maximun - 12.07.2015

PHP код:
public OnVehicleSpawn(vehicleid

    for(new 
0MAX_PLAYERSi++)
    {
          
//use your script here with (playerid = i)
    
}
    return 
1

tries like that


Respuesta: Re: Locked vehicles - aalbero99 - 12.07.2015

Quote:
Originally Posted by Maximun
Посмотреть сообщение
PHP код:
public OnVehicleSpawn(vehicleid

    for(new 
0MAX_PLAYERSi++)
    {
          
//use your script here with (playerid = i)
    
}
    return 
1

tries like that
Nothing :/ also tried with SetVehicleParamsCarDoors, didn't work either.


Respuesta: Locked vehicles - aalbero99 - 12.07.2015

Does anyone know another way to do it?