anti-car stealing.
#1

Hi people.I need that thing,if any player sit in any vehicle and other player wanna to drop player from vehicle,he get stopped and will get message "Please don't steal a car".
Reply
#2

You can request a script here.
Reply
#3

You can try using this function. Otherwise, try searching for what you need.
Reply
#4

You can try to use Player States.

More to read about them:
https://sampwiki.blast.hk/wiki/GetPlayerState

For example: (this goes under OnPlayerStateChange callback)

pawn Код:
if(GetPlayerState(playerid) == 5)
{
  // execute your code
}
Number 5 stands for the state "Player enters vehicle as driver".
More to read about them in the link above.
Reply
#5

Yes,i try to do with getplayerstate but it worst.Maybe you can help my how it have be started?
Reply
#6

Quote:
Originally Posted by Hipflop
Посмотреть сообщение
You can try to use Player States.

More to read about them:
https://sampwiki.blast.hk/wiki/GetPlayerState
It would be much faster using the function I mentioned, "SetVehicleParamsForPlayer()."
Reply
#7

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
It would be much faster using the function I mentioned, "SetVehicleParamsForPlayer()."
I don't think so, because then you have to loop through all the cars that are spawned. It only slowers the script.
Reply
#8

First of all, you need to check if there is someone in the car you want to enter.
If that is true, you need to send a message with the "Don't steal a car" or something like that.

If it is false, you just enter the vehicle.
Reply
#9

Quote:
Originally Posted by Hipflop
Посмотреть сообщение
I don't think so, because then you have to loop through all the cars that are spawned. It only slowers the script.
You could always use "foreach" by "******" for the loop. It would be a lot more accurate compared to relying on a player state to do this.
Reply
#10

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You could always use "foreach" by "******" for the loop. It would be a lot more accurate compared to relying on a player state to do this.
There you are right, but I don't think he will understand that.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)