swag_k_dog Posted January 1, 2017 Share Posted January 1, 2017 server: local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1, 255, 0, 0) function triggerTheEvent() triggerClientEvent("onTheDamnWindow", resourceRoot) end addEventHandler("onMarkerHit", missionMarker, triggerTheEvent) client: addEvent("onTheDamnWindow", true) addEventHandler("onTheDamnWindow", resourceRoot, function () missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas) guiLabelSetColor(missionName, 252, 226, 81) end ) when you hit the marker, the Label should be created. but it doesnt work grrrrrrr, why?? Link to comment
MR.S3D Posted January 1, 2017 Share Posted January 1, 2017 local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1, 255, 0, 0) function triggerTheEvent(hit) if source == missionMarker and getElementType(hit) == "player" then triggerClientEvent("onTheDamnWindow", hit) end end addEventHandler("onMarkerHit", resourceRoot, triggerTheEvent) Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 4 minutes ago, MR.S3D said: local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1, 255, 0, 0) function triggerTheEvent(hit) if source == missionMarker and getElementType(hit) == "player" then triggerClientEvent("onTheDamnWindow", hit) end end addEventHandler("onMarkerHit", resourceRoot, triggerTheEvent) sorry mate did not work :[ Link to comment
N3xT Posted January 1, 2017 Share Posted January 1, 2017 Try that local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1, 255, 0, 0) function triggerTheEvent(hit) if source == missionMarker and getElementType(hit) == "player" then triggerClientEvent(hit,"onTheDamnWindow", hit) end end addEventHandler("onMarkerHit", root, triggerTheEvent) Link to comment
MR.S3D Posted January 1, 2017 Share Posted January 1, 2017 Client addEvent("onTheDamnWindow", true) addEventHandler("onTheDamnWindow", root, function () if isElement(missionName) then destroyElement(missionName) end missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas or "default-bold-small") guiLabelSetColor(missionName, 252, 226, 81) end ) 1 Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 sadly, none of these work. can someone make a simple script that opens a window on marker hit ? I will change it to a label I just need a model.. god. Link to comment
N3xT Posted January 1, 2017 Share Posted January 1, 2017 any errors in debugscript 3 ? Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 1 minute ago, N3xT said: any errors in debugscript 3 ? no Link to comment
N3xT Posted January 1, 2017 Share Posted January 1, 2017 Client-Side addEvent("onTheDamnWindow", true) addEventHandler("onTheDamnWindow", root, function () missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas or "default-bold-small") guiLabelSetColor(missionName, 252, 226, 81) guiSetVisible(missionName, true) end ) Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 4 minutes ago, N3xT said: Client-Side addEvent("onTheDamnWindow", true) addEventHandler("onTheDamnWindow", root, function () missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas or "default-bold-small") guiLabelSetColor(missionName, 252, 226, 81) guiSetVisible(missionName, true) end ) still no.. I tried in 123234 ways. Link to comment
Miika Posted January 1, 2017 Share Posted January 1, 2017 (edited) You can track, where the error is just by adding something like outputChatBox("asd") in function. Example, add it on marker function and then hit the marker and if it outputs "asd" in chatbox, move the message to clientside function. if it outputs message in clientside function, then there's something wrong with your label. Edited January 1, 2017 by Miika822 Link to comment
MR.S3D Posted January 1, 2017 Share Posted January 1, 2017 (edited) ex: Server local marker = createMarker(2153, -1799, 12.5, "cylinder", 1, 255, 0, 0) addEventHandler("onMarkerHit", root, function(hit) if source == marker and getElementType(hit) == "player" then triggerClientEvent(hit,"testS3D", hit) end end ) Client addEvent("testS3D", true) addEventHandler("testS3D", root, function () Window = guiCreateWindow ( 0, 0, 0.5, 0.4, "Test", true ) end ) Edited January 1, 2017 by MR.S3D Link to comment
iPrestege Posted January 1, 2017 Share Posted January 1, 2017 I'm pretty sure that's you can't see the marker or something wrong because you didn't set the alpha in the marker for the color. You are missing that part in here : createMarker( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement( ) ] ) Maybe it's not causing the problem but you can try the following : In the server side : -- Server local missionMarker = createMarker ( 2153,-1799,12.5,'cylinder',1,255,255,0,255 ); addEventHandler ( 'onMarkerHit',missionMarker, function ( aPlayer ) if aPlayer and getElementType ( aPlayer ) == 'player' then triggerClientEvent ( aPlayer,'aRequestVisible',aPlayer ); end end ); Client : missionName = guiCreateLabel ( 0.64,0.85,0.38,0.13,'sweet buisness',true ); guiSetFont ( missionName,guiCreateFont ( ':freeroam_login/images/gtasanandreas.ttf',50 ) ); guiLabelSetColor ( missionName,252,226,81 ); guiSetVisible ( missionName,false ); outputChatBox ( 'Data in the client has been created' ); addEvent( 'aRequestVisible',true ); addEventHandler ( 'aRequestVisible',root, function ( ) if guiGetVisible ( missionName ) then return outputChatBox ( 'The missionName is already visible !' ) end; guiSetVisible ( missionName,true ); outputChatBox ( 'Data in the client has been request and triggred!' ); end ) @swag_k_dog Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 Just now, iPrestege said: I'm pretty sure that's you can't see the marker or something wrong because you didn't set the alpha in the marker for the color. You are missing that part in here : createMarker( float x, float y, float z [, string theType = "checkpoint", float size = 4.0, int r = 0, int g = 0, int b = 255, int a = 255, visibleTo = getRootElement( ) ] ) Maybe it's not causing the problem but you can try the following : In the server side : -- Server local missionMarker = createMarker ( 2153,-1799,12.5,'cylinder',1,255,255,0,255 ); addEventHandler ( 'onMarkerHit',missionMarker, function ( aPlayer ) if aPlayer and getElementType ( aPlayer ) == 'player' then triggerClientEvent ( aPlayer,'aRequestVisible',aPlayer ); end end ); Client : missionName = guiCreateLabel ( 0.64,0.85,0.38,0.13,'sweet buisness',true ); guiSetFont ( missionName,guiCreateFont ( ':freeroam_login/images/gtasanandreas.ttf',50 ) ); guiLabelSetColor ( missionName,252,226,81 ); guiSetVisible ( missionName,false ); outputChatBox ( 'Data in the client has been created' ); addEvent( 'aRequestVisible',true ); addEventHandler ( 'aRequestVisible',root, function ( ) if guiGetVisible ( missionName ) then return outputChatBox ( 'The missionName is already visible !' ) end; guiSetVisible ( missionName,true ); outputChatBox ( 'Data in the client has been request and triggred!' ); end ) @swag_k_dog when I enter the marker nothing happens Link to comment
iPrestege Posted January 1, 2017 Share Posted January 1, 2017 Is there any messages appear in the chat box? Please post your meta.xml file. 1 Link to comment
Miika Posted January 1, 2017 Share Posted January 1, 2017 (edited) @iPrestege Marker alpha is not needed argument, only required arguments are x, y and z check up the wiki page; if there's no alpha set, it's automatically 255. Edited January 1, 2017 by Miika822 1 Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 Just now, iPrestege said: Is there any messages appear in the chat box? Please post your meta.xml file. yes there is a message: Data in the client has been created. meta: <meta> <info author="square" name="mission" version="1.0" type="script"/> <script src="c_spawns.lua" type="client"/> <script src="s_spawns.lua" type="server"/> </meta> Link to comment
iPrestege Posted January 1, 2017 Share Posted January 1, 2017 Try to change the marker position some times it's about that or make the size bigger there's no message for the event in the chat box that it has been triggered? 1 Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 1 minute ago, iPrestege said: Try to change the marker position some times it's about that or make the size bigger there's no message for the event in the chat box that it has been triggered? no sir Link to comment
Miika Posted January 1, 2017 Share Posted January 1, 2017 local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1.1, 255, 0, 0, 100) function triggerTheEvent(hitElemet) if hitElement and getElementType(hitElement) == "Player" then triggerClientEvent(hitElement, "onTheDamnWindow", hitElement) end end addEventHandler("onMarkerHit", root, triggerTheEvent) addEvent("onTheDamnWindow", true) addEventHandler("onTheDamnWindow", resourceRoot, function () missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas) guiLabelSetColor(missionName, 252, 226, 81) end ) Link to comment
swag_k_dog Posted January 1, 2017 Author Share Posted January 1, 2017 3 hours ago, iPrestege said: Try to change the marker position some times it's about that or make the size bigger there's no message for the event in the chat box that it has been triggered? no sir okay motherf*ckers I finnaly did it: local missionMarker = createMarker(2153, -1799, 12.5, "cylinder", 1.1, 255, 0, 0, 100) local player = getLocalPlayer() function missionGui() missionName = guiCreateLabel(0.64, 0.85, 0.38, 0.13, "sweet buisness", true) local font0_gtasanandreas = guiCreateFont(":freeroam_login/images/gtasanandreas.ttf", 50) guiSetFont(missionName, font0_gtasanandreas) guiLabelSetColor(missionName, 252, 226, 81) end addEventHandler("onClientResourceStart", getRootElement(), missionGui) addEventHandler("onClientResourceStart", getRootElement(), function() guiSetVisible(missionName, false) end) function markerhit (player, missionMarker) guiSetVisible(missionName, true) end addEventHandler("onClientMarkerHit", missionMarker, markerhit) thanks for your help anyways @Miika822 @iPrestege @MR.S3D 1 Link to comment
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