MrGTAmodsgerman Posted June 12, 2016 Share Posted June 12, 2016 Hey, How do i create a marker like in San Andreas and attach it to a vehicle? Thanks bhavinbhai2707 1 Link to comment Share on other sites More sharing options...
jedijosh920 Posted June 12, 2016 Share Posted June 12, 2016 World.DrawMarker MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 14, 2016 Share Posted June 14, 2016 Hey, How do i create a marker like in San Andreas and attach it to a vehicle? Thanks u can create a marker by world.drawmarker() n what do u mean by attach it??? but though m making guess u can just change it position to the entity's position for ex:- suppose u want to attach it with a car veh.position = car.position //veh is a marker i assumed to be its just like creating blips n make them follow(remember to stick it in a loop) MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 14, 2016 Author Share Posted June 14, 2016 Hey, How do i create a marker like in San Andreas and attach it to a vehicle? Thanks u can create a marker by world.drawmarker() n what do u mean by attach it??? but though m making guess u can just change it position to the entity's position for ex:- suppose u want to attach it with a car veh.position = car.position //veh is a marker i assumed to be its just like creating blips n make them follow(remember to stick it in a loop) Thanks, and i got a another question to the marker, is it possible to trigger something like OnMarkerHit? bhavinbhai2707 1 Link to comment Share on other sites More sharing options...
unknown modder Posted June 15, 2016 Share Posted June 15, 2016 Hey, How do i create a marker like in San Andreas and attach it to a vehicle? Thanks u can create a marker by world.drawmarker() n what do u mean by attach it??? but though m making guess u can just change it position to the entity's position for ex:- suppose u want to attach it with a carveh.position = car.position //veh is a marker i assumed to be its just like creating blips n make them follow(remember to stick it in a loop) Thanks, and i got a another question to the marker, is it possible to trigger something like OnMarkerHit?to trigger it you would need a per game check to see if a given ped is close enough to the marker MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 15, 2016 Share Posted June 15, 2016 Hey, How do i create a marker like in San Andreas and attach it to a vehicle? Thanks u can create a marker by world.drawmarker() n what do u mean by attach it??? but though m making guess u can just change it position to the entity's position for ex:- suppose u want to attach it with a car veh.position = car.position //veh is a marker i assumed to be its just like creating blips n make them follow(remember to stick it in a loop) Thanks, and i got a another question to the marker, is it possible to trigger something like OnMarkerHit?As said by the unknown modder. . .u have to check if the player is close enough to the marker to trigger it just like if(Game.player.character.position.distanceto(Marker) < 15)// Marker is coordinates of your marker { world.drawmarker(params); } alternative to this can be that u can set a bool to true in the above code just as if(same as above) { createmark = true; // now check in loop that if createmark is true then call drawmarker function } i hope this helps MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
unknown modder Posted June 15, 2016 Share Posted June 15, 2016 if(Game.player.character.position.distanceto(Marker) < 15)fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 15, 2016 Share Posted June 15, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max valuei heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
unknown modder Posted June 15, 2016 Share Posted June 15, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value i heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol Its not really especially important, but its generally a good habit to get into bhavinbhai2707 and MrGTAmodsgerman 2 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 15, 2016 Author Share Posted June 15, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value i heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol Its not really especially important, but its generally a good habit to get into Thanks but how does "DistanceToSquared" work? Does it do the same thing like distanceto(Marker) < 15)? Link to comment Share on other sites More sharing options...
unknown modder Posted June 15, 2016 Share Posted June 15, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value i heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol Its not really especially important, but its generally a good habit to get into Thanks but how does "DistanceToSquared" work? Does it do the same thing like distanceto(Marker) < 15)? pretty much, just make sure you square the distance you're measuring against Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 16, 2016 Share Posted June 16, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value i heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol Its not really especially important, but its generally a good habit to get into Thanks but how does "DistanceToSquared" work? Does it do the same thing like distanceto(Marker) < 15)?i am not sure but i m making a guess as i am in a tour n didn't bring my laptop lol. .i think unknown modder wants to say that just enter number which will be squared just like enter 4 to have 16 if u entered 4 it will check distance around 16f from marker coordinates. . .this method is pretty much same but it's more clean MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 16, 2016 Author Share Posted June 16, 2016 if(Game.player.character.position.distanceto(Marker) < 15) fsqrt is an expensive operation. If you're just checking if a position is close enough then it's better to use DistanceToSquared and use 225 as the max value i heard about this method before but i never tried it so i didn't mention it. . . . i will try it too lol Its not really especially important, but its generally a good habit to get into Thanks but how does "DistanceToSquared" work? Does it do the same thing like distanceto(Marker) < 15)?i am not sure but i m making a guess as i am in a tour n didn't bring my laptop lol. .i think unknown modder wants to say that just enter number which will be squared just like enter 4 to have 16 if u entered 4 it will check distance around 16f from marker coordinates. . .this method is pretty much same but it's more clean More cleans means more performence or not? Or better to hold the code in few lines? Link to comment Share on other sites More sharing options...
unknown modder Posted June 16, 2016 Share Posted June 16, 2016 More cleans means more performence or not? Or better to hold the code in few lines? The code runs slightly faster. though it would only be noticeable if there were lots of Calls for distanceTo made each tick MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 17, 2016 Author Share Posted June 17, 2016 (edited) More cleans means more performence or not? Or better to hold the code in few lines? The code runs slightly faster. though it would only be noticeable if there were lots of Calls for distanceTo made each tick I generally got a big FPS lost with .Net scripts, do you know a very calls clean way to do it? I want to detect if a player is on a special area behind the car with the marker. I mean if the player is there where the marker is. Edited June 17, 2016 by MrGTAmodsgerman bhavinbhai2707 1 Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 18, 2016 Share Posted June 18, 2016 More cleans means more performence or not? Or better to hold the code in few lines? The code runs slightly faster. though it would only be noticeable if there were lots of Calls for distanceTo made each tick I generally got a big FPS lost with .Net scripts, do you know a very calls clean way to do it? I want to detect if a player is on a special area behind the car with the marker. I mean if the player is there where the marker is.well for the position check u can do same as above just put it in if statement like this if(game.player.character.position.distanceto(Marker) < 2) { //u can do anything when player is on marker } i use the method i gave above. . . .and for fps lost maybe u coded something which is syntactically correct but facing any problem like too many overloads just check scripthookvdotnet.log file for any problem or just upload some part of code here so we can check it out i hope it helps u MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
MrGTAmodsgerman Posted June 19, 2016 Author Share Posted June 19, 2016 More cleans means more performence or not? Or better to hold the code in few lines? The code runs slightly faster. though it would only be noticeable if there were lots of Calls for distanceTo made each tick I generally got a big FPS lost with .Net scripts, do you know a very calls clean way to do it? I want to detect if a player is on a special area behind the car with the marker. I mean if the player is there where the marker is. well for the position check u can do same as above just put it in if statement like this if(game.player.character.position.distanceto(Marker) < 2) { //u can do anything when player is on marker } i use the method i gave above. . . .and for fps lost maybe u coded something which is syntactically correct but facing any problem like too many overloads just check scripthookvdotnet.log file for any problem or just upload some part of code here so we can check it out i hope it helps u Thank you, i was talk about the whole ScriptHook.Net! Scripts that use NativeUI brings me the most FPS lost, from 60 to 30! All about that can u read on my unclosed topic http://gtaforums.com/topic/839507-how-can-i-play-gta-v-with-mods-without-any-big-fps-lose-that-comes-from-script-mods/ Link to comment Share on other sites More sharing options...
bhavinbhai2707 Posted June 19, 2016 Share Posted June 19, 2016 More cleans means more performence or not? Or better to hold the code in few lines? The code runs slightly faster. though it would only be noticeable if there were lots of Calls for distanceTo made each tick I generally got a big FPS lost with .Net scripts, do you know a very calls clean way to do it? I want to detect if a player is on a special area behind the car with the marker. I mean if the player is there where the marker is.well for the position check u can do same as above just put it in if statement like thisif(game.player.character.position.distanceto(Marker) < 2) { //u can do anything when player is on marker } i use the method i gave above. . . .and for fps lost maybe u coded something which is syntactically correct but facing any problem like too many overloads just check scripthookvdotnet.log file for any problem or just upload some part of code here so we can check it out i hope it helps u Thank you, i was talk about the whole ScriptHook.Net! Scripts that use NativeUI brings me the most FPS lost, from 60 to 30! All about that can u read on my unclosed topic http://gtaforums.com/topic/839507-how-can-i-play-gta-v-with-mods-without-any-big-fps-lose-that-comes-from-script-mods/ohhh native ui u didn't mention it before. . .yess native ui brings mine fps down too its n global issue that's why i stopped using it. . .guadmaz is still looking for the solution maybe will get it soon. . . . MrGTAmodsgerman 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now