Jump to content

What is wrong?


DarkMaan

Recommended Posts

function startt () 
    srandomveh() 
end 
addEventHandler("onResourceStart", getResourceRootElement(), startt) 
function srandomveh () 
local zahlm = math.random (1, 3) 
local portstring = pos[tonumber(zahlm)] 
local mX = gettok ( portstring, 1, string.byte(',') ) 
local mY = gettok ( portstring, 2, string.byte(',') ) 
local mZ = gettok ( portstring, 3, string.byte(',') ) 
ramarker = createMarker (mX, mY, mZ, "checkpoint", 2.25, 255,0,0) 
            addEventHandler( "onMarkerHit", ramarker, newmarker) 
            addEventHandler( "onMarkerHit", ramarker, randomveh) 
end 
     
function newmarker () 
        destroyElement(ramarker) 
        srandomveh() 
end 
SO 
function randomveh (thePlayer) 
if getElementType(thePlayer)=="player" then 
        local veh = getPedOccupiedVehicle (thePlayer) 
        local zahlv = math.random (1, 111) 
        local x,y,z = getElementPosition (veh) 
        setElementModel (veh, cars[zahlv]) 
        local veh2 = getElementModel (veh) 
        setElementPosition (veh , x, y, z+0.25) 
        fixVehicle (veh) 
end  
end 

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...