Jump to content

Help


Hypnos

Recommended Posts

Nothing work, where I do wrong?

addEvent ("getBoat", true) 
addEventHandler ("getBoat", getRootElement(), 
function(car,para,id) 
if (getPlayerMoney(source) >= math.random(para)) then 
if not (getElementData (source, "hisBoat")) then 
takePlayerMoney(source,para) 
setAccountData (getPlayerAccount (source), "Up.BoatID", tonumber(id)) 
outputChatBox ( "Araba Satın Alındı : #ffffff"..car.."",source,255,90,90,true) 
else 
outputChatBox ( "Önce arabayı yoke et!",source,255,90,90,true) 
end 
else 
outputChatBox ( "#ff0000Paran Yetersiz",source,255,90,90,true)   
end 
end) 
  
vehicle = {} 
addEvent ("BoatUse", true) 
addEventHandler ("BoatUse", getRootElement(), 
function () 
if  not (isGuestAccount (getPlayerAccount (source))) and not (isPedInVehicle(source)) then 
local accountData = getAccountData (getPlayerAccount (source), "Up.BoatID") 
if (accountData) then 
BoatID = getAccountData (getPlayerAccount (source), "Up.BoatID") 
x,y,z = getElementPosition (source) 
vehicle = createVehicle (BoatID, x, y, z,0,0,90) 
warpPedIntoVehicle ( source, vehicle ) 
setElementData (source, "hisBoat", vehicle) 
end 
elseif (isPedInVehicle(player)) then 
end 
end) 

Link to comment
"is wrong" that's really not helpful, can you tell me what is the error?

My first guess is that "BoatID" is returning false/nil.

Only this.

HCx1zUH.png

Then the vehicle was not created successfully, are you totally sure that 'BoatID' is returning a vehicle model?

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