Hello ,
I Want Create Medic Job , What The Error In Code ?
local Table = { };
local CI = 543
addEvent ("job",true)
addEventHandler ("job",root,
function ()
table.insert ( source , Table )
local Car[source] = createVechial ( CI , x , y , z )
warpPedIntoVechial ( player , Car[source] )
local Marker1[source] = createMarker ( x , y , z , "cylinder" , 2 , 255 , 0 , 0 , source )
setElementData ( Car[source] , "private" , true )
local Ped[source] = createPed ( 99 , x , y , z )
setElementVisibleTo ( Ped[source] , root, false )
setElementVisibleTo ( Ped[source] , source , true )
end
)
addEventHandler ("onMarkerHit",root,
function (player)
if getElementType ( player ) == "player" and not isPedInVechial ( player ) then
if source == Marker1[source] then
Time = setTimer (function()
setPedAnimation ( player .... etc )
end , 30000 , 1 )
destroyElement ( Marker1[source] )
destroyElement ( Ped[source] )
killTimer ( Time )
local Marker2[source] = createMarker ( x , y , z , "cylinder" , 2 , 255 , 0 , 0 , 250 , player )
local Ped2[source] = createPed ( 99 , x , y , z )
createBlipAttachedTo ( 30 , Marker2[source] )
setElementVisibleTo ( Ped2[source] , root, false )
setElementVisibleTo ( Ped2[source] , source , true )
elseif source == Marker2[source] then
Time2 = setTimer (function()
setPedAnimation ( player .... etc )
end , 30000 , 1 )
destroyElement ( Marker2[source] )
destroyElement ( Ped2[source] )
killTimer ( Time2 )
givePlayerMoney ( player , 2500 )
table.remove ( player , Table );
end
end
)