addEventHandler ("onClientGUIClick",root,
function ()
if source == Button then
triggerServerEvent ("JoinJob",localPlayer)
end
end
)
addEvent ("CreateMarker",true)
addEventHandler ("CreateMarker",root,
function ()
Marker = createMarker ( x , y , z , "cylinder" , 2 , 255 , 0 , 255 , 255 )
Blip = createBlipAttachedTo ( Marker , 38 )
outputChatBox ( " اذهب الى العلامة للاكمال المهمة " )
end
)
addEventHandler ("onClientMarkerHit",root,
function ()
if getElementType ( localPlayer ) == "vehicle" and isPedInVehicle ( localPlayer ) then
if source == Marker then
triggerServerEvent ( "GivePlayerMoney", localPlayer )
destroyElement ( Marker )
destroyElement ( Blip )
end
end
end
)
Car = {}
addEvent("JoinJob",true)
addEventHandler("JoinJob",root,
function()
Car[source] = createVehicle( 595 , x , y , z )
warpPedIntoVehicle( source , Car[source] )
triggerClientEvent ( source , "CreateMarker" , source )
end
)
addEvent ("GivePlayerMoney",true)
addEventHandler ("GivePlayerMoney",root,
function ()
givePlayerMoney ( source , 5000 )
outputChatBox (" لقد انهيت المهمة وحصلت على 5000 " , source )
destroyElement ( Car[source] )
Car[source] = nil
end
)