roddydennvor Posted April 16, 2015 Share Posted April 16, 2015 hii there , i want to make this script work if the player have item id 49 , but how ... ? Here is the script function serviceVehicle(veh) if (veh) then local mechcost = 100000 if (getElementData(source,"faction")==16) then mechcost = mechcost / btrdiscountratio end if not exports.global:takeMoney(source, mechcost) then outputChatBox("Kamu tidak dapat membayar service ini.", source, 255, 0, 0) else local health = getElementHealth(veh) if (health <= 850) then health = health + 150 else health = 1000 end fixVehicle(veh) setElementHealth(veh, health) if not getElementData(veh, "Impounded") or getElementData(veh, "Impounded") == 0 then exports['anticheat-system']:changeProtectedElementDataEx(veh, "enginebroke", 0, false) if armoredCars[ getElementModel( veh ) ] then setVehicleDamageProof(veh, true) else setVehicleDamageProof(veh, false) end end exports.global:sendLocalMeAction(source, "memperbaiki kendaraan.") exports.logs:dbLog(source, 31, { veh }, "REPAIR QUICK-SERVICE") end else outputChatBox("Kamu harus berada di dalam kendaraan yang akan di perbaiki.", source, 255, 0, 0) end end addEvent("serviceVehicle", true) addEventHandler("serviceVehicle", getRootElement(), serviceVehicle) Link to comment
Ryancit2 Posted April 16, 2015 Share Posted April 16, 2015 What exactly you are stuck at? Plus, what is the 'source' of this event? Since it is a manually triggered Event, you should add the specific Element instead of source (at Line#5). Also, tell us /debugscript 3 output, if there is any bug. Link to comment
roddydennvor Posted April 16, 2015 Author Share Posted April 16, 2015 no no , i want to upgrade this script , so if i have item id 49 i can repair vehicles. i just try to add this : if not(exports.global:hasItem(thePlayer, 49)) then outputChatBox("You need a fishing rod to fish.", thePlayer, 255, 0, 0) ......... But nothing happend Link to comment
Ryancit2 Posted April 16, 2015 Share Posted April 16, 2015 Try this function: if getPedWeapon(thePlayer) == 49 then Link to comment
roddydennvor Posted April 16, 2015 Author Share Posted April 16, 2015 can i change "export" to "getPedWeapon for this case ? Link to comment
..:D&G:.. Posted April 16, 2015 Share Posted April 16, 2015 I smell a Valhalla leak.. Link to comment
Ryancit2 Posted April 17, 2015 Share Posted April 17, 2015 can i change "export" to "getPedWeapon for this case ? If export gives weapon, then follow accurate params and do it. 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