GamerDeMTA Posted June 22, 2013 Share Posted June 22, 2013 WHat is The PRoblem? I'm getting crazy! Now the debugscript doesn't say nothing!!! and it DONT WORK `CLIENT function lz () outputChatBox("Take it", 255, 255, 0, true) end addEvent ("wii", true) addEventHandler ("wii", localPlayer, lz) servER ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",ma, function ( ) triggerClientEvent ("wii", source) end ) Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 why trigger? ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",ma, function ( player ) outputChatBox("Take it", player, 255, 255, 0, true) end ) Link to comment
PaiN^ Posted June 22, 2013 Share Posted June 22, 2013 The source of the event onMarkerHit is the marker that got hit, Ust the hitElement parameter @ 6ArHxiMr'3a[Z]eF : I think he just want to learn about triggering =) Link to comment
iMr.3a[Z]eF Posted June 22, 2013 Share Posted June 22, 2013 The source of the event onMarkerHit is the marker that got hit, Ust the hitElement parameter@ 6ArHxiMr'3a[Z]eF : I think he just want to learn about triggering =) so like this, right? ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",ma, function ( player ) if getElementType(player) == "player" then outputChatBox("Take it", player, 255, 255, 0, true) end end ) Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 D: The problem is yet this is the code (NOW, EDITED) ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",source,ma, function ( ) triggerClientEvent ("wii", source) end ) Help D: Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler ( "onMarkerHit", ma, function ( hitElement ) triggerClientEvent ( hitElement, "wii", hitElement ) end ) Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 it still doesn't work. PS: I pass the marker by car is that ImPortant?? ah and the debugscript /3 says it's #5 line (triggerClientEvent, argument 1 got nil) Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 ma = createMarker ( x, y, z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler ( "onMarkerHit", ma, function ( hitElement ) if ( getElementType ( hitElement ) == "player" ) then triggerClientEvent ( hitElement, "wii", hitElement ) end end ) Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 Now it says "expected string at argument 1, got nil" ( @ triggerClientEvent ) Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 Now it says "expected string at argument 1, got nil" ( @ triggerClientEvent ) It should work, are you sure that you're copying it? Link to comment
xXMADEXx Posted June 22, 2013 Share Posted June 22, 2013 Did you make it on the server side? or client? Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 You can see it's as server side in the first Post ^^^^^above and the client side too Link to comment
iPrestege Posted June 22, 2013 Share Posted June 22, 2013 WHat is The PRoblem? I'm getting crazy! Now the debugscript doesn't say nothing!!! and it DONT WORK`CLIENT function lz () outputChatBox("Take it", 255, 255, 0, true) end addEvent ("wii", true) addEventHandler ("wii", localPlayer, lz) servER ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",ma, function ( ) triggerClientEvent ("wii", source) end ) Client : function lz () outputChatBox("Take it", 255, 255, 0, true) end addEvent ("wii", true) addEventHandler ("wii", root, lz) Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 Root? Then when I hit the marker it will do it for all? Link to comment
xXMADEXx Posted June 22, 2013 Share Posted June 22, 2013 Client : function lz () outputChatBox("Take it", 255, 255, 0, true) end addEvent ("wii", true) addEventHandler ("wii", root, lz) + Server: ma = createMarker (x,y,z, "cylinder", 4, 0, 0, 255, 225 ) addEventHandler("onMarkerHit",ma, function ( p ) triggerClientEvent ( p, "wii", p) end ) Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 I tested it and it works perfect as it is. Link to comment
iPrestege Posted June 22, 2013 Share Posted June 22, 2013 No it's not you just trigger it for the hit element . Link to comment
GamerDeMTA Posted June 22, 2013 Author Share Posted June 22, 2013 My fault! I changed something and put HitElement instead hitElement. Thanks you all Castillo Prestege and Made Link to comment
Castillo Posted June 22, 2013 Share Posted June 22, 2013 That's what I though. You're welcome. 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