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 ) To Visit Us Press Here: mtasa://5.9.206.180:22002
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 =) " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
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 ) To Visit Us Press Here: mtasa://5.9.206.180:22002
PaiN^ Posted June 22, 2013 Posted June 22, 2013 Yes " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
PaiN^ Posted June 22, 2013 Posted June 22, 2013 You're welcome " Keep Thinking Different . " - Steve Jops -------------------- Don't send me PMs asking for help, I Won't reply !
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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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 ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
xXMADEXx Posted June 22, 2013 Posted June 22, 2013 Did you make it on the server side? or client? The Ultimate Lua Tutorial! | MTA PHP SDK
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 ) The Ultimate Lua Tutorial! | MTA PHP SDK
Castillo Posted June 22, 2013 Posted June 22, 2013 I tested it and it works perfect as it is. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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
Castillo Posted June 22, 2013 Posted June 22, 2013 That's what I though. You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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