how to make not usefull vehicle?
#1

hi i need to make an not sitible ant not movetlib vehicle, so no one can enter it or push it in to onother place, the question is how?
Reply
#2

you can do it with this:
Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0,0,0,1,0,0,0);
You can add custom stock to lock some vehicles under OnGameModeInit
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
you can do it with this:
Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 0,0,0,1,0,0,0);
You can add custom stock to lock some vehicles under OnGameModeInit
That is insufficient in fact almost any method is since a cheater could just go inside anyways.
Reply
#4

he can then make a timer to check if somebody is in any locked vehicle. I got something like that scripted for my faction vehicles
Reply
#5

I did manage to make such thing, but then the player couldnt get OUT of his car anymore.
Each time the player pressed the vehicle enter/exit button the script checked if he was allowed to exit.
Im sure it can be done in reverse somehow
Reply
#6

pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(tacka1 || tacka2 || tacka3 || tacka, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(tacka1 || tacka2 || tacka3 || tacka, 0,0,0,1,0,0,0);
not working, i need to know how to make it not move
Reply
#7

Quote:
Originally Posted by ancezas
Посмотреть сообщение
pawn Код:
new engine, lights, alarm, doors, bonnet, boot, objective;
    GetVehicleParamsEx(tacka1 || tacka2 || tacka3 || tacka, engine, lights, alarm, doors, bonnet, boot, objective);
    SetVehicleParamsEx(tacka1 || tacka2 || tacka3 || tacka, 0,0,0,1,0,0,0);
not working, i need to know how to make it not move
You can't "lock it in place", if that's what you mean. Try checking every X time if the vehicle is still in the position it's supposed to be and reset it to the correct position if it's not.

As for the vehicle not being enterable by other players. You can lock the doors & check if the player is the car owner under OnPlayerEnterVehicle()
Reply
#8

Quote:
Originally Posted by Sinner
Посмотреть сообщение
You can't "lock it in place", if that's what you mean. Try checking every X time if the vehicle is still in the position it's supposed to be and reset it to the correct position if it's not.

As for the vehicle not being enterable by other players. You can lock the doors & check if the player is the car owner under OnPlayerEnterVehicle()
and how do i need to check the poisition? i know whit timer, but how do check is car pos in place?
Reply
#9

https://sampwiki.blast.hk/wiki/OnUnoccupiedVehicleUpdate
how about this? how do i not use it for every vehicle?
Reply
#10

Quote:
Originally Posted by ancezas
Посмотреть сообщение
and how do i need to check the poisition? i know whit timer, but how do check is car pos in place?
Store the vehicle ID somewhere when you create it. Then use GetVehiclePos()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)