About Vehciles
#1

Hello there i am trying to code a sting command.

I have made it so it can slow the driver down but is there a way of stop the vehcile from moving but allowing the person who was sting to exit the car. i know there is a command TogglePlayerControllable but that dont allow the person to exit the vehicle. any one that could recommend a place on wiki or some code would be most greatful.

thanks a lot.
Reply
#2

You could use TogglePlayerControllable-function like you already did and check for ENTER key under OnPlayerKeyStateChange - so if player is in the vehicle and if he presses the ENTER key then just use RemovePlayerFromVehicle-function.
Reply
#3

thank u your a life saver.
Reply
#4

sorry for double but how to u say if they press enter only.

i know its some think like

public OnPlayerKeyStateChange(playerid, "ENTER")

"ENTER" is me gessing.
Reply
#5

Here u go there are lot of keys
https://sampwiki.blast.hk/wiki/GetPlayerKeys
Reply
#6

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#7

Quote:
Originally Posted by SnW
Here u go there are lot of keys
https://sampwiki.blast.hk/wiki/GetPlayerKeys
No need for GetPlayerKeys-function, OnPlayerKeyStateChange-callback has ability to check for new keys and old keys.
Reply
#8

well i have done it dice7 way easier code i think. proble wrong but is the ACTION key f or is it mouseclick1?
Reply
#9

Quote:
Originally Posted by crazydc
well i have done it dice7 way easier code i think. proble wrong but is the ACTION key f or is it mouseclick1?
Код:
KEY_ACTION
1
~k~~PED_ANSWER_PHONE~
~k~~VEHICLE_FIREWEAPON~-
Reply
#10

ok i what key is it for "f" leaveing and entering car??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)