Jump to content

Help error with marker and blip


Recommended Posts

Hello, I'm doing a script for work as a bus driver and I've encountered a problem, I'm doing everything on the side of clienta and marker and blip dont show up

Script

local startbus = createMarker ( 2184.10229, -1451.73291, 25.55586 [, string "cylinder",1.0,254,239,0,255 ] ) 
local startbusblip = createBlip ( 2184.10229, -1451.73291, 25.55586 [, int icon = 46, int size = 2, int r = 255, int g = 0, int b = 0, int a = 255, int ordering = 0, float visibleDistance = 16383.0 ] ) 
function startjobbus() 
local bus = createVehicle ( 431, 2180.24292, -1460.47717, 25.53906 ) 
warpPedIntoVehicle ( getLocalPlayer, bus ) 
end 

addEventHandler( "onMarkerHit", startbus, startjobbus )

Meta

<meta> 
<info type="autobuspraca" version="1.0.0"></info> 
<script src="c.lua" type="client"></script> 
</meta> 

 

Link to comment

This is what you want

local startbus = createMarker ( 2184.10229, -1451.73291, 25.55586, "cylinder",1.0,254,239,0,255 ) 
if ( startbus ) then
    local startbusblip = createBlipAttachedTo ( startbus , 46, 2, 255, 0, 0, 255,  0, 16383) 
end

function startjobbus() 
    if ( not bus ) then
        bus = createVehicle ( 431, 2180.24292, -1460.47717, 25.53906 ) 
        if ( bus ) then
            warpPedIntoVehicle ( localPlayer, bus ) 
        end
    end
end 

addEventHandler( "onClientMarkerHit", startbus, startjobbus )

 

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