Jump to content

job :(


mars

Recommended Posts

hey guys,

i was trying to make a bus job right now :lol:

i'm kinda addicted to scripting :oops:

but i made this in like, idk, 1 min? :roll::lol:

but it doesn't work :x

function startbus (thePlayer, command )
     veh = getPedOccupiedVehicle ( thePlayer )
	if (veh == 431) then
		my = createMarker ( -2196, 324, 34, "cylinder", 3, 255, 255, 0, 70 )
		setElementVisibleTo ( my, getRootElement(), true )
		setElementVisibleTo ( my, thePlayer, true )
		outputChatBox ( "#FF0000[bus Companie] #00FF00get to the first station, dont get too late!", thePlayer, 255, 255, 255, true )
	end
end
addCommandHandler("startbus", startbus)
addEventHandler("startbus", getRootElement(), startbus)

if i enter a vehicle, (bus) and i type /startbus , it should make a marker and say [bus Companie] go to the first station, dont get to late!

but 1, the marker doesn't show up ^^''

and you can guess, 2. he doesn't say crap xD

Link to comment
hey guys,

i was trying to make a bus job right now :lol:

i'm kinda addicted to scripting :oops:

but i made this in like, idk, 1 min? :roll::lol:

but it doesn't work :x

function startbus (thePlayer, command )
     veh = getPedOccupiedVehicle ( thePlayer )
	if (veh == 431) then
		my = createMarker ( -2196, 324, 34, "cylinder", 3, 255, 255, 0, 70 )
		setElementVisibleTo ( my, getRootElement(), true )
		setElementVisibleTo ( my, thePlayer, true )
		outputChatBox ( "#FF0000[bus Companie] #00FF00get to the first station, dont get too late!", thePlayer, 255, 255, 255, true )
	end
end
addCommandHandler("startbus", startbus)
addEventHandler("startbus", getRootElement(), startbus)

if i enter a vehicle, (bus) and i type /startbus , it should make a marker and say [bus Companie] go to the first station, dont get to late!

but 1, the marker doesn't show up ^^''

and you can guess, 2. he doesn't say crap xD

1. you need a command, so delete addEventHandler ;)

2. my is wrong, it cant like that;)

What you say right now is: only the marker can see the marker, and: the marker can see you.

use this:

function startbus (thePlayer, command )
	veh = getPedOccupiedVehicle ( thePlayer )
	if (veh == 431) then
		my = createMarker ( -2196, 324, 34, "cylinder", 3, 255, 255, 0, 70, thePlayer )
		outputChatBox ( "#FF0000[bus Companie] #00FF00get to the first station, dont get too late!", thePlayer, 255, 255, 255, true )
	end
end
addCommandHandler("startbus", startbus)

Link to comment
function startbus (thePlayer, command )
     veh = getPedOccupiedVehicle ( thePlayer )
if (veh == 431) then
        my = createMarker ( -2196.12, 324.12, 34.12, "cylinder", 2.5, 255, 255, 0, 255, thePlayer )
outputChatBox ( "#FF0000[bus Companie] #00FF00get to the first station, dont get too late!", thePlayer, 255, 255, 255)
end
end
addCommandHandler("startbus", startbus)

Should Work.

Link to comment
Should Work.

Eh, no.

Let me quote what DarkDragon said what the problem was:

the problem in this code is that a vehicle element will never be equal to a number/integer. use getElementModel to get the vehicle model id

Therefore, this should do the trick:

function startbus (thePlayer, command )
     veh = getPedOccupiedVehicle ( thePlayer )
if (getElementModel(veh) == 431) then -- Here's the fix dragon suggested
        my = createMarker ( -2196.12, 324.12, 34.12, "cylinder", 2.5, 255, 255, 0, 255, thePlayer )
outputChatBox ( "#FF0000[bus Company] #00FF00Get to the first station, don't get too late!", thePlayer, 255, 255, 255) -- Company is with a Y, and don't should have an '
end
end
addCommandHandler("startbus", startbus)

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