SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/05/2015, 03:24 PM   #11
DarkLouis
Big Clucker
 
DarkLouis's Avatar
 
Join Date: Jan 2014
Location: Italy
Posts: 153
Reputation: 9
Default Re: SA:MP Passenger shooting from car (By H) fix?

Your code will lag. Mine not.
DarkLouis is offline   Reply With Quote
Old 06/05/2015, 03:37 PM   #12
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,422
Reputation: 973
Default Re: SA:MP Passenger shooting from car (By H) fix?

Quote:
Originally Posted by DarkLouis View Post
Your code will lag. Mine not.
Your code doesn't do what he wants (not even close). Mine does.

Also, don't always assume that using OnPlayerUpdate equals lag. It's only checking a single variable. It will only lag if you have expensive code in there like loops and such.

If you (or anyone else) is interested in why I'm even using OPU, it's because the player doesn't update their state until the next OPU call. You have to check if they are still in the car (reset their drive-by) or whether they managed to get out (do nothing).

This bug only happens if you try to exit the vehicle at very slow speeds. Even if you aren't performing a drive-by, you still can't get out. Perhaps that should be fixed also.
MP2 is offline   Reply With Quote
Old 06/05/2015, 03:40 PM   #13
Riwerry
Huge Clucker
 
Join Date: Oct 2013
Posts: 416
Reputation: 3
Default Re: SA:MP Passenger shooting from car (By H) fix?

@MP2 Thank you gonna test it,...
Riwerry is offline   Reply With Quote
Old 06/05/2015, 03:45 PM   #14
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,422
Reputation: 973
Default Re: SA:MP Passenger shooting from car (By H) fix?

I made it in to an include for you: http://pastebin.com/5tgqXL1r

Put that in an .inc file and include it in your gamemode. You'll need y_hooks from YSI.

http://forum.sa-mp.com/showthread.php?t=570884
MP2 is offline   Reply With Quote
Old 06/05/2015, 04:02 PM   #15
Riwerry
Huge Clucker
 
Join Date: Oct 2013
Posts: 416
Reputation: 3
Default Re: SA:MP Passenger shooting from car (By H) fix?

@MP2 So the solution to unbug that is to set weapon to 0 and then set it back if I'm right?
Riwerry is offline   Reply With Quote
Old 06/05/2015, 04:15 PM   #16
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,422
Reputation: 973
Default Re: SA:MP Passenger shooting from car (By H) fix?

Quote:
Originally Posted by Riwerry View Post
@MP2 So the solution to unbug that is to set weapon to 0 and then set it back if I'm right?
Yes. You can remove the ApplyAnimation line actually, as the game does that anyway.

You still need the rest of my code though, to check if they stayed in the vehicle or not.
MP2 is offline   Reply With Quote
Old 06/05/2015, 04:18 PM   #17
Riwerry
Huge Clucker
 
Join Date: Oct 2013
Posts: 416
Reputation: 3
Default Re: SA:MP Passenger shooting from car (By H) fix?

Huh, now I don't know If I understand you and you understand me , becouse when I'm in vehicle as passenger I press H then I press F (enter) to get back to the vehicle, but I can't still do driveby until I reenter vehicle..

//EDIT Yeah, I got it to work. Gonna test it more (with players etc)
Riwerry 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
Help, Shooting from a car as passenger. Kenzix Scripting Help 5 18/03/2014 07:42 PM
Passenger help yancarlos4500 Scripting Help 2 22/07/2013 11:41 PM
Car Passenger does not TP with. Stefand Scripting Help 4 18/06/2013 08:45 AM
get passenger name? falor Help Archive 2 23/04/2010 03:14 PM


All times are GMT. The time now is 04:54 PM.


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