Hypnos Posted February 5, 2015 Share Posted February 5, 2015 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
Castillo Posted February 5, 2015 Share Posted February 5, 2015 Do you have errors in the debugscript? Link to comment
Hypnos Posted February 5, 2015 Author Share Posted February 5, 2015 Do you have errors in the debugscript? line 27 is wrong and vehicle not created. Link to comment
Castillo Posted February 5, 2015 Share Posted February 5, 2015 "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. Link to comment
Hypnos Posted February 6, 2015 Author Share Posted February 6, 2015 "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. Link to comment
Tomas Posted February 6, 2015 Share Posted February 6, 2015 "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. Then the vehicle was not created successfully, are you totally sure that 'BoatID' is returning a vehicle model? Link to comment
Hypnos Posted February 6, 2015 Author Share Posted February 6, 2015 Thanks, It solved. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now