Posts: 305
Threads: 52
Joined: Mar 2012
Reputation:
0
Hi all, I want to know how a player change their weapon slot. Example, when a player change his Deagle to MP5, the server will detect and it will AttachObjectToPlayer. So the Deagle will be on his Mag Pouch. Plus, I want to know if someone presses G and get into a vehicle, and Press H. I want it to shoot it with Deagle, but everytime I enter the vehicle, the only weapon that is available to shoot is MP5. Please Help me.... I just want to know whats the function for that.
Posts: 3,085
Threads: 37
Joined: Nov 2012
Reputation:
0
If you're insisting on using the Deagle when driving, it's not possible. However if you mean passenger, you will need to use the OnPlayerEnterVehicle and check if ispassenger is set to 1, or use the OnPlayerStateChange function and detect whether the newstate is PLAYER_STATE_PASSENGER, then set their weapon accordingly if they have one.
Posts: 505
Threads: 26
Joined: Jan 2013
Reputation:
0
Try to enter vehicle with Deagle,then it will show that you have a dealge in a current moment,so you can press H.
Or just add GivePlayerWeapon(playerid, 24 , 9999); OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
Like when you gonna enter any vehicle as passanger,you will get infinite deagle.