Dzemous Posted August 10, 2017 Share Posted August 10, 2017 Hi, I will doing job, but I always have got problem with arguments in trigger I read Elements Tree on wiki, but I still do not know what this is about When player hit marker then s-side must create vehicle. C-side StartJobM = createMarker (-165.35049, 1059.69141, 18.74219, 'cylinder', 1.0, 22, 38, 199, 255) function StartJob (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then outputChatBox ("You can't hit marker when u are in vehicle!") cancelEvent () if getElementType(hitPlayer) == getlocalPlayer then triggerServerEvent ("poj", localPlayer ) outputChatBox ("Created vehicle!") end end end addEventHandler ("onClientMarkerHit", StartJobM, StartJob) StartJobM = createMarker (-165.35049, 1059.69141, 18.74219, 'cylinder', 1.0, 22, 38, 199, 255) function StartJob (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then outputChatBox ("You can't hit marker when u are in vehicle!") cancelEvent () if getElementType(hitPlayer) == getlocalPlayer then triggerServerEvent ("poj", localPlayer ) outputChatBox ("Created vehicle!") end end end addEventHandler ("onClientMarkerHit", StartJobM, StartJob) S-side: function VehicleC() lcvehi = createVehicle (422, -158.49141, 1051.20691, 19.75892) end addEvent("poj") addEventHandler("poj", getRootElement(), VehicleC) Please, explain me how i Can triggering Link to comment
NeXuS™ Posted August 10, 2017 Share Posted August 10, 2017 Do you know that you can move the whole script on server-side? Link to comment
Dzemous Posted August 10, 2017 Author Share Posted August 10, 2017 Yes, I know. I prefer to do it on c-side ; p At least I learn how trigger. I don't know what i must using in argument with element (2) Link to comment
NeXuS™ Posted August 10, 2017 Share Posted August 10, 2017 (edited) StartJobM = createMarker (-165.35049, 1059.69141, 18.74219, 'cylinder', 1.0, 22, 38, 199, 255) function StartJob (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then outputChatBox ("You can't hit marker when u are in vehicle!") elseif hitPlayer == localPlayer then triggerServerEvent("poj", localPlayer) outputChatBox("Created vehicle!") end end addEventHandler("onClientMarkerHit", StartJobM, StartJob) Next time, look at your code, it was totally wrong in all matter. Edited August 10, 2017 by NeXuS™ 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