Jump to content

getPedOccupiedVehicle not work


Viudes

Recommended Posts

why getPedOccupiedVehicle not work?

 

Quote

function onSavePress(thePlayer)

	Vehicle = getPedOccupiedVehicle (thePlayer)
	if Vehicle then
		
		row = guiGridListAddRow (grillist)
		 guiGridListSetItemText (grillist, row, column,getVehicleName ( Vehicle ), thePlayer, false, false )
	else
		outputChatBox("Ei toimi")
	
	end
end

 

 

Link to comment
6 minutes ago, 3laa33 said:

post the line where you call the function onSavePress

function onStart()
	window = guiCreateWindow(0.34, 0.10, 0.15, 0.40,"Save Vehicle",true)
	grillist = guiCreateGridList(0.01, 0.05, 1, 0.85, true, window)
	vehiclename = guiCreateEdit( 0.05, 0.91, 0.5, 0.06, "", true, window)
	save = guiCreateButton( 0.6, 0.9, 0.4, 0.3, "Save", true, window)
	column = guiGridListAddColumn(grillist, "Saved vehicles", 0.85 )
	guiSetVisible(window, false)
	
	addEventHandler( "onClientGUIClick",save, onSavePress)

 
end

 

Link to comment
function onSavePress()
	Vehicle = getPedOccupiedVehicle(localPlayer)
	if Vehicle then		
		row = guiGridListAddRow(grillist)
		guiGridListSetItemText(grillist, row, column,getVehicleName(Vehicle), false, false )
	else
		outputChatBox("Ei toimi")	
	end
end

"thePlayer" doesn't exist.

Edited by NeXuS™
Link to comment
6 minutes ago, NeXuS™ said:

function onSavePress()
	Vehicle = getPedOccupiedVehicle(localPlayer)
	if Vehicle then		
		row = guiGridListAddRow(grillist)
		guiGridListSetItemText(grillist, row, column,getVehicleName(Vehicle), false, false )
	else
		outputChatBox("Ei toimi")	
	end
end

"thePlayer" doesn't exist.

That not work.. Still error

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