Making Arrest system while wanted is in the car problem - 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: Making Arrest system while wanted is in the car problem (
/showthread.php?tid=652979)
Making Arrest system while wanted is in the car problem -
Jeamie - 23.04.2018
Actually, i'm try to do script that if a wanted (criminal) is in the car with a police, mean they are in the same vehicle,
and if the cop presses 2 button, the criminal should be arrested.
Kindly show me the code, thanks
Re: Making Arrest system while wanted is in the car problem -
Maxandmov - 23.04.2018
Kindly try and DIY it first; then, if you stumble across some problem - let us know and we'll assist you.
You can't learn to code if you don't code even such a simple thing yourself.
Re: Making Arrest system while wanted is in the car problem -
ItsRobinson - 23.04.2018
Use
OnPlayerKeyStateChange
To make a test for pressing 2 keys at the same time you can do something like this with your own keys:
Код:
if((newkeys & KEY_FIRE) && (newkeys & KEY_CROUCH))
{
//do something
}
There's plenty examples on the wiki.
Here's a list of all the
keys.
Like Maxandmov said, give it ago, if you get stuck, just ask.