Jump to content

Recommended Posts

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
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 by NeXuS™
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...