VenomOG Posted September 22, 2018 Share Posted September 22, 2018 Hey so i have a Andromada script, i want when player enters andromada it creates cuboid and attach cuboid to the plane and if player in cuboid and hit a marker give players money in the marker CODE: function loadAndro() a = createVehicle(592, 309.95739746094, 1824.1492919922, 18.640625) setElementData(a, "fuel", 100) setTimer(fixVehicle, 2000, 1, a) end loadAndro() addEventHandler("onVehicleEnter", root, function (p, s) if source == a and s == 0 then cuboid = createMarker ( 0, 0,0, "cylinder",50, 255, 255, 255,0 ) triggerClientEvent(p, "complete",p) exports.ISGMessages:sendClientMessage("Andromada: mission has been started deliver it to SF",p,0,255,0) attachElements ( cuboid ,source, 0, 0,-2 ) marker = createMarker(-1243.03, -191.14, 13.14,"cylinder",5,255,0,255,255,getRootElement()) end end) setTimer(function () if not isElement(a) then loadAndro() end if isElementInWater(a) then destroyElement(a) end end, 5000, 0) function exit(root) triggerClientEvent("close",root) end addEventHandler("onElementDestroy", a, loadAndro) addEventHandler("onVehicleExplode", a, loadAndro) addEventHandler("onVehicleExit", a, exit) function markerhit(thePlayer) if (getTeamName(getPlayerTeam(localPlayer)) == "Gangster") then triggerClientEvent(thePlayer, "complete",thePlayer) exports.ISGMessages:sendClientMessage("Andromada: protect the mother ship until it reaches SF",root,255,0,255) end end addEventHandler("onMarkerHit",cuboid,markerhit) function sfmarkerhit(theM) triggerClientEvent(source,"complete2",source) exports.ISGMessages:sendClientMessage("Andromada: mission sucess",source,0,255,0) givePlayerMoney(root,50000) end addEventHandler("onMarkerHit",marker,sfmarkerhit) The bug is it dosnt create cuboid and when it did it dosnt attach to the ship Link to comment
Z4Zy Posted September 22, 2018 Share Posted September 22, 2018 any debug error presents ? Link to comment
VenomOG Posted September 22, 2018 Author Share Posted September 22, 2018 49 minutes ago, DeadthStrock said: any debug error presents ? None. Link to comment
Z4Zy Posted September 22, 2018 Share Posted September 22, 2018 To create the cuboid and attach it, source must equals to the "a" and s must be "0". make sure they are right ! Link to comment
VenomOG Posted September 22, 2018 Author Share Posted September 22, 2018 2 minutes ago, DeadthStrock said: To create the cuboid and attach it, source must equals to the "a" and s must be "0". make sure they are right ! if source == a and s == 0 then Link to comment
Z4Zy Posted September 22, 2018 Share Posted September 22, 2018 put "else" on that "if" statement. so that the lines from 10 to 18 looks like below, addEventHandler("onVehicleEnter", root, function (p, s) if source == a and s == 0 then cuboid = createMarker ( 0, 0,0, "cylinder",50, 255, 255, 255,0 ) triggerClientEvent(p, "complete",p) exports.ISGMessages:sendClientMessage("Andromada: mission has been started deliver it to SF",p,0,255,0) attachElements ( cuboid ,source, 0, 0,-2 ) marker = createMarker(-1243.03, -191.14, 13.14,"cylinder",5,255,0,255,255,getRootElement()) else outputChatBox("Error Is Here !",p) end end) 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