[Include] "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle.
#21

very good job, good for roleplay servers
Reply
#22

Cool, great job!
Reply
#23

Lovely work, it may get handy
Reply
#24

The fuck xD How ... nah whatevaa ! This is soo pro scripting ! +rep bro

EDIT: god damn it ... i can't give rep -.- I already give too much lol (that says vBulletin)
Reply
#25

awesome
2 questions:
1. what will happen if the player will look at 2 vehicles?
2. can you make the same but with objects? (mapped objects)
Reply
#26

Thanks Everybody! (:

@Unknownich: mlol xD

@Michael: Hehe Thanks! And It's alright bro.

Quote:
Originally Posted by xkirill
Посмотреть сообщение
awesome
2 questions:
1. what will happen if the player will look at 2 vehicles?
2. can you make the same but with objects? (mapped objects)
1. The closest vehicle is chosen.

2. Sure, I already had this in mind.
Only difficulty is that, there are different object sizes, to fix it for each and every object, it'll take some effort.
Reply
#27

Nice.
Reply
#28

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
Thanks Everybody! (:

@Unknownich: mlol xD

@Michael: Hehe Thanks! And It's alright bro.



1. The closest vehicle is chosen.

2. Sure, I already had this in mind.
Only difficulty is that, there are different object sizes, to fix it for each and every object, it'll take some effort.
yea but if the closest vehicle is 2 NRG's? (that have been spawned in the same pos and stuck in the same pos)
Reply
#29

Quote:
Originally Posted by xkirill
Посмотреть сообщение
yea but if the closest vehicle is 2 NRG's? (that have been spawned in the same pos and stuck in the same pos)
Will detect one NRG, the model is the same :P
Reply
#30

Quote:
Originally Posted by xkirill
Посмотреть сообщение
yea but if the closest vehicle is 2 NRG's? (that have been spawned in the same pos and stuck in the same pos)
In that case, it will select the vehicle with the lowest ID.
Reply
#31

Can't believe it
great job
Reply
#32

This is Cool Bro i Like it.
Reply
#33

Thanks everyone.

Uploaded the V2 with these changes:

Код:
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.
Reply
#34

Quote:
Originally Posted by Mean
Посмотреть сообщение
Epic release, +6 rep.
Thank you Mean

Quote:
Originally Posted by Lorenc_
Посмотреть сообщение
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..)
Reply
#35

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
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.
Reply
#36

Quote:
Originally Posted by iPLEOMAX
Посмотреть сообщение
- Removed "oldvehicle" parameter from the callback since it's useless.
Who said that? It's very useful instead. Please re-add it.
Reply
#37

Quote:
Originally Posted by Kar
Посмотреть сообщение
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
Посмотреть сообщение
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 )
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)