roddydennvor Posted April 16, 2015 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)
Ryancit2 Posted April 16, 2015 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. [Resource] Advance Voice Messaging system with 120+ languages support! [Resource] Information markers with ingame management + editable permissions! [Resource] Live weather telling app! [Resource] Send Emails from game! [HELP?] Ask Pakistani's, have fun %3C3
roddydennvor Posted April 16, 2015 Author 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
Ryancit2 Posted April 16, 2015 Posted April 16, 2015 Try this function: if getPedWeapon(thePlayer) == 49 then [Resource] Advance Voice Messaging system with 120+ languages support! [Resource] Information markers with ingame management + editable permissions! [Resource] Live weather telling app! [Resource] Send Emails from game! [HELP?] Ask Pakistani's, have fun %3C3
roddydennvor Posted April 16, 2015 Author Posted April 16, 2015 can i change "export" to "getPedWeapon for this case ?
..:D&G:.. Posted April 16, 2015 Posted April 16, 2015 I smell a Valhalla leak.. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Ryancit2 Posted April 17, 2015 Posted April 17, 2015 can i change "export" to "getPedWeapon for this case ? If export gives weapon, then follow accurate params and do it. [Resource] Advance Voice Messaging system with 120+ languages support! [Resource] Information markers with ingame management + editable permissions! [Resource] Live weather telling app! [Resource] Send Emails from game! [HELP?] Ask Pakistani's, have fun %3C3
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