abdalbaset Posted April 16, 2014 Share Posted April 16, 2014 hello guys, i would like to ask how i can make function whene player hit marker he get money ? i made the marker's in server side * Link to comment
Karuzo Posted April 16, 2014 Share Posted April 16, 2014 onMarkerHit-- dont forget to ask for the source. givePlayerMoney outputChatBox -- for a message in the chatbox. Link to comment
cheez3d Posted April 16, 2014 Share Posted April 16, 2014 local x,y,z,amount = --[[x coordinate of marker]],--[[y coordinate of marker]],--[[z coordinate of marker]],--[[amount of money to give]] addEventHandler("onMarkerHit",createMarker(x,y,z),function(element,dimension) if getElementType(element) == "player" and dimension then givePlayerMoney(element,amount) end end) Link to comment
abdalbaset Posted April 16, 2014 Author Share Posted April 16, 2014 LS=createMarker ( 1949.4000244141,-2493.8999023438,13.199999809265, "cylinder", 1.5, 255, 255, 0, 170 ) function pil() LS2=createMarker (1811.5999755859,-2493.8000488281,13.199999809265, "cylinder", 1.5, 255, 255, 0, 170 ) end addEventHandler( "onMarkerHit", LS, pil ) function money() if isElementWithinMarker(theplayer,money) then givePlayerMoney (theplayer , 5000 ) outputChatBox(" you got 5000$,", thePlayer, 255, 0, 0) end end addEventHandler( "onMarkerHit", LS2, money ) the first function working fine but the 2nd not working |?| debug >>[00:22:12] WARNING: pilot-in-deve\pilots.lua:23: Bad argument @ 'addEventHan ' [Expected element at argument 2, got nil] Link to comment
abdalbaset Posted April 17, 2014 Author Share Posted April 17, 2014 What I have to do with it? 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