igthomas Posted February 21, 2012 Share Posted February 21, 2012 Here's a scripts that I've done but the problem is that markers show up but nothing happens Could someone please explain my fault? function rvb() marker_red = createMarker(-840.5, 502, 1357.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1) marker_blue = createMarker(-840.5, 495.60000610352, 1357.1999511719, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1) end addEventHandler ("onResourceStart",resourceRoot,rvb) function rvbstart(thePlayer, hitElement) if source == marker_red then setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0) elseif source == marker_blue then setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0) end end addEventHandler ("onMarkerHit",getRootElement(),rvbstart) Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 "SantaB" type="script" name="RvB" description="RvB" /> Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 Hmm,your interior is 1 right? Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 Yes because it's the place where the marker is and I see the marker Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 Try this debug. local marker_red = createMarker(-840.5, 502, 1357.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1357.1999511719, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) outputChatBox 'Debug:markers' function rvbstart( thePlayer, hitElement ) outputChatBox 'Debug:hit' if source == marker_red then setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_red' elseif source == marker_blue then setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_blue' end end addEventHandler ( "onMarkerHit",root,rvbstart ) Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 Strange when I touch the marker (cylinder) it doesn't say Debug:hit Link to comment
denny199 Posted February 21, 2012 Share Posted February 21, 2012 mayby it doesn't see the marker? u could try to make 2 functions for red and blue addEventHandler ( "onMarkerHit",marker_red,redstart ) addEventHandler ( "onMarkerHit",marker_blue,bluestart ) it's a other alternative Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 Tried and same problem local marker_red = createMarker(-840.5, 502, 1357.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1357.1999511719, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) function redstart( thePlayer, hitElement ) if source == marker_red then setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) end end addEventHandler ( "onMarkerHit",marker_red,redstart ) function bluestart( thePlayer, hitElement ) if source == marker_blue then setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) end end addEventHandler ( "onMarkerHit",marker_blue,bluestart ) Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 As another option to marker higher. Just add to the axis of z + 1 and check again. If the marker below the player's position, the event will not be called. local marker_red = createMarker(-840.5, 502, 1358.1999511719, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1358.1999511719, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) outputChatBox 'Debug:markers' function rvbstart( thePlayer, hitElement ) outputChatBox 'Debug:hit' if source == marker_red then setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_red' elseif source == marker_blue then setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) outputChatBox 'Debug:warped --> marker_blue' end end addEventHandler ( "onMarkerHit",root,rvbstart ) Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 Added and same problem I think I'm not lucky Link to comment
Kenix Posted February 21, 2012 Share Posted February 21, 2012 I tested it. I think you need report in bug tracker. And you can also create colshape and attach events to him. Link to comment
igthomas Posted February 21, 2012 Author Share Posted February 21, 2012 Never tried colshape gonna learn it Link to comment
LooooP Posted February 21, 2012 Share Posted February 21, 2012 "SantaB" type="script" name="RvB" description="RvB" /> Not sure, but afaik you should specify if it's server-side or client-side, then it must be like this: "SantaB" type="script" name="RvB" description="RvB" /> Link to comment
drk Posted February 21, 2012 Share Posted February 21, 2012 "SantaB" type="script" name="RvB" description="RvB" /> Not sure, but afaik you should specify if it's server-side or client-side, then it must be like this: "SantaB" type="script" name="RvB" description="RvB" /> It's server-side. You don't need to specify the type ( if you don't specify then it will be server-side type ). Link to comment
Kenix Posted February 22, 2012 Share Posted February 22, 2012 Yes it is. Server side type will be defaulted. Link to comment
igthomas Posted February 22, 2012 Author Share Posted February 22, 2012 haha Guys it worked the problem was that yesterday I was testing it with editor (Full Test) so it didn't warp me but today I've started play(resource) and tried the marker and it warped me anyways thanks guys to be so cool and helping me, I really appreciated your helps oh and last problem why do I get this error in console : WARNING: (SantaB)RvB\teleports.lua:10: Bad 'team' pointer @ 'setTeamColor'(1) local marker_red = createMarker(-840.5, 502, 1357.3, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1357.3, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) function rvbstart( thePlayer, hitElement ) outputChatBox 'Debug:hit' if source == marker_red then setTeamColor ( thePlayer, 255, 0, 0 ) setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) setElementDimension ( thePlayer, 10 ) elseif source == marker_blue then setTeamColor ( thePlayer, 0, 0, 255 ) setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) setElementDimension ( thePlayer, 10 ) end end addEventHandler ( "onMarkerHit",root,rvbstart ) Link to comment
drk Posted February 22, 2012 Share Posted February 22, 2012 haha Guys it worked the problem was that yesterday I was testing it with editor (Full Test) so it didn't warp me but today I've started play(resource) and tried the marker and it warped me anyways thanks guys to be so cool and helping me, I really appreciated your helpsoh and last problem why do I get this error in console : WARNING: (SantaB)RvB\teleports.lua:10: Bad 'team' pointer @ 'setTeamColor'(1) local marker_red = createMarker(-840.5, 502, 1357.3, "cylinder", 3 , 255, 0, 0, 255 ) setElementInterior ( marker_red, 1 ) local marker_blue = createMarker(-840.5, 495.60000610352, 1357.3, "cylinder", 3, 0, 0, 255, 255 ) setElementInterior ( marker_blue, 1 ) function rvbstart( thePlayer, hitElement ) outputChatBox 'Debug:hit' if source == marker_red then setTeamColor ( thePlayer, 255, 0, 0 ) setElementPosition ( thePlayer, 697.5, -2677.8000488281, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) setElementDimension ( thePlayer, 10 ) elseif source == marker_blue then setTeamColor ( thePlayer, 0, 0, 255 ) setElementPosition ( thePlayer, 534.70001220703, -2694.1000976563, 8.8000001907349, true ) setElementInterior ( thePlayer, 0 ) setElementDimension ( thePlayer, 10 ) end end addEventHandler ( "onMarkerHit",root,rvbstart ) setTeamColor first argument isn't player element, but the team variable. Link to comment
igthomas Posted February 22, 2012 Author Share Posted February 22, 2012 so that means there no way only to change the player color name unless he does #.....? Link to comment
drk Posted February 22, 2012 Share Posted February 22, 2012 I think you can't change the player nick color... Link to comment
Kenix Posted February 22, 2012 Share Posted February 22, 2012 You mean nametag color? https://wiki.multitheftauto.com/wiki/Set ... metagColor 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