SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/03/2014, 07:25 PM   #1
Kenzix
Little Clucker
 
Join Date: Mar 2014
Posts: 16
Reputation: 0
Default Help, Shooting from a car as passenger.

Title says it all..

How do i enable it?
Kenzix is offline   Reply With Quote
Old 18/03/2014, 07:33 PM   #2
Zhao
Beta Tester
 
Zhao's Avatar
 
Join Date: Feb 2012
Posts: 80
Reputation: 20
Default Re: Help, Shooting from a car as passenger.

It should be possible by default, but I'm assuming you're using a script that you didn't write yourself, in which case you will have to locate where it is being prevented. It's likely that it's being prevented with the function SetPlayerArmedWeapon somewhere so try looking for that.
Zhao is offline   Reply With Quote
Old 18/03/2014, 07:35 PM   #3
Zeppo
Big Clucker
 
Join Date: Mar 2014
Posts: 70
Reputation: 4
Default Re: Help, Shooting from a car as passenger.

Look for
Code:
SetPlayerArmedWeapon(playerid, 0);
in your OnPlayerEnterVehicle or something like that.
Zeppo is offline   Reply With Quote
Old 18/03/2014, 07:38 PM   #4
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,416
Reputation: 973
Default Re: Help, Shooting from a car as passenger.

Quote:
Originally Posted by Zeppo View Post
Look for
Code:
SetPlayerArmedWeapon(playerid, 0);
in your OnPlayerEnterVehicle or something like that.
OPEV is called BEFORE a player enters a vehicle, so it won't be there.
MP2 is offline   Reply With Quote
Old 18/03/2014, 07:39 PM   #5
Kenzix
Little Clucker
 
Join Date: Mar 2014
Posts: 16
Reputation: 0
Default Re: Help, Shooting from a car as passenger.

Okay, so i got this

Quote:
if(newstate == PLAYER_STATE_PASSENGER)
{
SetPlayerArmedWeapon(playerid,0);
}
if(newstate == PLAYER_STATE_PASSENGER)
{
if(newstate == PLAYER_STATE_PASSENGER)
{
new gun,tmp;
GetPlayerWeaponData(playerid,4,gun,tmp);
#pragma unused tmp
if(gun)SetPlayerArmedWeapon(playerid,gun);
else SetPlayerArmedWeapon(playerid,0);
}
What to change?
Kenzix is offline   Reply With Quote
Old 18/03/2014, 07:42 PM   #6
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,416
Reputation: 973
Default Re: Help, Shooting from a car as passenger.

Well first of all learn to indent your code.

Secondly, we have told you. Remove the SetPlayerArmedWeapon line.
MP2 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passenger Bug GuyYahood1 Bug Reports 12 30/03/2014 12:19 PM
Passenger NPC? Ash. Scripting Help 5 09/09/2013 10:35 AM
Car Passenger does not TP with. Stefand Scripting Help 4 18/06/2013 08:45 AM
Get passenger? ajwar Help Archive 1 08/01/2011 04:56 PM
get passenger name? falor Help Archive 2 23/04/2010 03:14 PM


All times are GMT. The time now is 05:29 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.