SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 14/01/2012, 02:26 PM   #41
juraska
Huge Clucker
 
juraska's Avatar
 
Join Date: Apr 2011
Posts: 354
Reputation: 11
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Can't believe it
great job
juraska is offline   Reply With Quote
Old 14/01/2012, 06:49 PM   #42
THE_KING$5$
Huge Clucker
 
THE_KING$5$'s Avatar
 
Join Date: Aug 2011
Posts: 286
Reputation: 12
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

This is Cool Bro i Like it.
__________________
Looking for a MySQL Supported Host.
THE_KING$5$ is offline   Reply With Quote
Old 14/01/2012, 09:40 PM   #43
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: AE
Posts: 1,273
Reputation: 742
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Thanks everyone.

Uploaded the V2 with these changes:

Code:
Version 2.0:
- Optimized the code hence increased performance/efficiency.
- Now uses a collection of player's streamed vehicles to check for the 'lookat'. (Thanks to "Kar" for the idea ;))
- Removed "oldvehicle" parameter from the callback since it's useless.
- Added Float:distance parameter to the callback.
- Uses y_hook to hook with the default callbacks.
I made the actual version with foreach, but due to some problems, I had to make the loop system myself.
__________________
Goodbye SA-MP.
iPLEOMAX is offline   Reply With Quote
Old 14/01/2012, 09:46 PM   #44
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: AE
Posts: 1,273
Reputation: 742
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Quote:
Originally Posted by Mean View Post
Epic release, +6 rep.
Thank you Mean

Quote:
Originally Posted by Lorenc_ View Post
Would it bug if there were duplicates of a vehicle in a single pos? I'm on my tablet ATM, just asking.
It wouldn't I suppose. Instead it will select the vehicle according to it's index in the player's array variable.

(Edit: Eh, didn't mean to double post..)
__________________
Goodbye SA-MP.
iPLEOMAX is offline   Reply With Quote
Old 15/01/2012, 12:19 AM   #45
Kar
High-roller
 
Kar's Avatar
 
Join Date: May 2010
Location: Black Asylum
Posts: 3,158
Reputation: 511
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Quote:
Originally Posted by iPLEOMAX View Post
Thank you Mean



It wouldn't I suppose. Instead it will select the vehicle according to it's index in the player's array variable.

(Edit: Eh, didn't mean to double post..)
Exactly, and if you check it. Distance is also counted, because the first index should always be the closer vehicle... right? because of how vehicles are streamed.
Kar is offline   Reply With Quote
Old 15/01/2012, 04:34 PM   #46
TheArcher
High-roller
 
TheArcher's Avatar
 
Join Date: Dec 2009
Location: Home
Posts: 2,377
Reputation: 251
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Quote:
Originally Posted by iPLEOMAX View Post
- Removed "oldvehicle" parameter from the callback since it's useless.
Who said that? It's very useful instead. Please re-add it.
__________________
TheArcher is offline   Reply With Quote
Old 28/01/2012, 07:09 PM   #47
iPLEOMAX
High-roller
 
iPLEOMAX's Avatar
 
Join Date: Mar 2011
Location: AE
Posts: 1,273
Reputation: 742
Default Re: "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.

Quote:
Originally Posted by Kar View Post
Exactly, and if you check it. Distance is also counted, because the first index should always be the closer vehicle... right? because of how vehicles are streamed.
Yep.

Quote:
Originally Posted by TheArcher View Post
Who said that? It's very useful instead. Please re-add it.
If you make a new variable for each player, you can store the current vehicle then use it as an old vehicleid on lookat change. (I hope you understand what i mean )
__________________
Goodbye SA-MP.
iPLEOMAX 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
"Slight homing", make a missile "Slightly!" home a vehicle. Donya Help Archive 4 11/06/2011 10:20 PM
Is player talks, use OnePlayAnim(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,0); Ihsan_Cingisiz Help Archive 5 30/05/2010 04:26 PM
Admin script requires "ReturnUser", "strtok" and "IsNumeric" Rubennnnn Help Archive 1 02/12/2009 07:08 PM
"Bots", "AI", "NPCs"... Computer-controlled pedestrians and traffic! ssflsnoob General 2 23/11/2008 07:06 PM


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


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