SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 24/05/2015, 11:23 AM   #1
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,353
Reputation: 296
Default Detect Driving on the wrong side of the road

Summary:
In February I made a video proving that you can detect which side of the road someone is driving on, here is the files I created for it.
http://www.*******.com/watch?v=IUE6NCxJLww

Files:
filterscript, requires zcmd and incognito's streamer
http://pastebin.com/LTJVqbc2

and the more important include
https://paste.ee/r/XdzSF
gone through a few sites, hopefully this ones good!

Description:
obviously reading through the code, it was not created for performance, it was rushed and made just for a video proving that it is possible.
reading over the filterscript you can see how the include is used and how to create more things based off it like detection for driving off the road, or create a driving test or something more creative.

it can be a little complicated to read through, basically there are nodes and navi nodes
nodes are just points on the roads that the ai follow so they don't drive off the road.
in the include they are in the format:

Code:
enum NodeInfo
{
	Float:nodeX,
	Float:nodeY,
	Float:nodeZ,
	link1ID,
	navi1ID,
	link2ID,
	navi2ID,
	link3ID,
	navi3ID,
	link4ID,
	navi4ID,
};
so there's the x y z which should be obvious, then there's the link1ID which is the link 1 ID number (or index) and the navi 1 index.
the link1ID refers to an index in the NodeInfo and refers to node connected to it
the navi1ID refers to an index in NaviInfo and is the navi in between the current node and link1ID
if a node does not have a connecting node then it'll be -1, same for navi links

I only extracted the following information from the data for the navi nodes:
Code:
enum NaviInfo
{
	from,
	to,
	leftLanes,
	rightLanes,
};
and here's a visual of the combined information

the navi nodes aren't really needed and are just holding data, in the picture L stands for left lanes and R stands for...

Conclusion:
There should be enough stuff for someone to do something better with this data, also some of the data is incorrect like nodes having 0 connections but most of the data is there and you could probably just fix it up as you use it.

I will also not be offering much in the way of support for using this.

this explains it in the data format you can find in your gta directory and whats possible to extract from those files:
http://gta.wikia.com/Paths_%28GTA_SA%29

Last edited by cessil; 22/05/2016 at 07:00 AM.
cessil is offline   Reply With Quote
Old 24/05/2015, 11:28 AM   #2
ZaBraNjeNi
Huge Clucker
 
ZaBraNjeNi's Avatar
 
Join Date: Apr 2014
Location: Serbia, Valjevo
Posts: 261
Reputation: 35
Default Re: Detect Driving on the wrong side of the road

Nice cessil, very useful.
__________________
Game Hosting

INSTANT ACTIVATION | San Andreas Multiplayer, Counter Strike 1.6, Minecraft

I need to eat, donate a one REP to me!

ZaBraNjeNi is offline   Reply With Quote
Old 24/05/2015, 11:34 AM   #3
PT
Godfather
 
PT's Avatar
 
Join Date: Nov 2012
Location: Portugal
Posts: 7,179
Reputation: 780
Default Re: Detect Driving on the wrong side of the road

Pretty cool Nice work!
PT is offline   Reply With Quote
Old 24/05/2015, 11:40 AM   #4
Neutralneu
Big Clucker
 
Join Date: Oct 2012
Location: Russia
Posts: 70
Reputation: 41
Default Re: Detect Driving on the wrong side of the road

Great!
Neutralneu is offline   Reply With Quote
Old 24/05/2015, 11:53 AM   #5
SiraBots
Big Clucker
 
SiraBots's Avatar
 
Join Date: Jun 2012
Posts: 85
Reputation: 10
Default Re: Detect Driving on the wrong side of the road

Thanks for the share.
SiraBots is offline   Reply With Quote
Old 24/05/2015, 12:23 PM   #6
SpikY_
High-roller
 
SpikY_'s Avatar
 
Join Date: Jul 2014
Posts: 1,246
Reputation: 128
Default Re: Detect Driving on the wrong side of the road

Good one.
__________________
-
SpikY_ is offline   Reply With Quote
Old 24/05/2015, 12:35 PM   #7
AIped
Gangsta
 
AIped's Avatar
 
Join Date: Feb 2011
Location: Netherlands
Posts: 619
Reputation: 46
Default Re: Detect Driving on the wrong side of the road

Cessil do you know how to connect just the ped nodes ?
I made textlabels that show all ped nodes with the id, linked id position and such but for the looks of how they are
placed in compared with vehicles..its a mess.
__________________
Want some traffic?

http://forum.sa-mp.com/showthread.php?t=587634
AIped is offline   Reply With Quote
Old 24/05/2015, 01:21 PM   #8
cessil
High-roller
 
cessil's Avatar
 
Join Date: Apr 2009
Posts: 1,353
Reputation: 296
Default Re: Detect Driving on the wrong side of the road

Quote:
Originally Posted by AIped View Post
Cessil do you know how to connect just the ped nodes ?
I made textlabels that show all ped nodes with the id, linked id position and such but for the looks of how they are
placed in compared with vehicles..its a mess.
I'd guess they are connected the same way as vehicles are, which are also a mess
cessil is offline   Reply With Quote
Old 24/05/2015, 03:47 PM   #9
iWhite
Big Clucker
 
Join Date: May 2012
Posts: 176
Reputation: 18
Default Re: Detect Driving on the wrong side of the road

What's difference between your script and this:

http://forum.sa-mp.com/showthread.php?t=550986

?
iWhite is offline   Reply With Quote
Old 24/05/2015, 04:13 PM   #10
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,856
Reputation: 1292
Default Re: Detect Driving on the wrong side of the road

What is this? No player textdraws?

Code:
new Text:sideCheck[MAX_PLAYERS] = {Text:INVALID_TEXT_DRAW, ...};
Pottus 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| Wrong side of the Tracks The God Scripting Help 3 25/08/2014 09:52 AM
[HELP] The tram is driving on the wrong street side! Pasa Scripting Help 2 02/01/2013 06:19 PM
[BUG]NPC Tram driving the wrong way. rbN. Help Archive 1 30/11/2010 07:35 PM


All times are GMT. The time now is 12:42 AM.


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