GamerDeMTA Posted June 22, 2013 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 )
iMr.3a[Z]eF Posted June 22, 2013 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 )
PaiN^ Posted June 22, 2013 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 =)
iMr.3a[Z]eF Posted June 22, 2013 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 )
GamerDeMTA Posted June 22, 2013 Author 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:
Castillo Posted June 22, 2013 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 )
GamerDeMTA Posted June 22, 2013 Author 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)
Castillo Posted June 22, 2013 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 )
GamerDeMTA Posted June 22, 2013 Author Posted June 22, 2013 Now it says "expected string at argument 1, got nil" ( @ triggerClientEvent )
Castillo Posted June 22, 2013 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?
GamerDeMTA Posted June 22, 2013 Author Posted June 22, 2013 You can see it's as server side in the first Post ^^^^^above and the client side too
iPrestege Posted June 22, 2013 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)
GamerDeMTA Posted June 22, 2013 Author Posted June 22, 2013 Root? Then when I hit the marker it will do it for all?
xXMADEXx Posted June 22, 2013 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 )
iPrestege Posted June 22, 2013 Posted June 22, 2013 No it's not you just trigger it for the hit element .
GamerDeMTA Posted June 22, 2013 Author Posted June 22, 2013 My fault! I changed something and put HitElement instead hitElement. Thanks you all Castillo Prestege and Made
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