Z.l.X Posted November 18, 2012 Share Posted November 18, 2012 (edited) . Edited December 30, 2014 by Guest Link to comment
0 myonlake Posted November 18, 2012 Share Posted November 18, 2012 Your script has way too many timers, which can cause server to lag or clients to crash. I suggest no using timers at all, because I honestly can't see any idea why to use timers. Secondly, this is the wrong section to post your issues with scripts. Here is the section for script issues » Try the code below. Server-side local arte = createMarker(-2200.11, 2400.68, 4.97, "corona", 1, 255, 255, 255, 255) createBlipAttachedTo(arte, 25) outputChatBox("* Artefakt pojawia sie w okolicach miasteczka Bayside!", root, 244, 211, 27, false) addEventHandler("onMarkerHit", arte, function(hitElement, matchingDimension) if getElementType(hitElement) == "player" and matchingDimension then outputChatBox("* " .. getPlayerName(hitElement) .. " podnosi artefakt!", root, 244, 211, 27, false) attachElements(arte, hitElement) -- zdrowie, naprawa pojazdu setTimer( setElementHealth(hitElement, 1000) outputChatBox("* Artefakt ulecza Cie!", hitElement, 244, 211, 27, false) playSoundFrontEnd(hitElement, 45) end, 160000, 1, hitElement) -- kasa setTimer(function(hitElement) givePlayerMoney(hitElement, math.random(10000, 50000)) outputChatBox("* Artefakt dodaje Ci pieniedzy!", hitElement, 244, 211, 27, false) playSoundFrontEnd(hitElement, 45) end, 300000, 1, hitElement) -- armor setTimer(function(hitElement) setPedArmor(hitElement, 1000) outputChatBox("* Artefakt dodaje Ci armora!", hitElement, 244, 211, 27, false) playSoundFrontEnd(hitElement, 45) end, 360000, 1, hitElement) end end ) addEventHandler("onPlayerWasted", root, function(ammo, killer, weapon, bodypart, stelath) detachElements(arte, source) outputChatBox("* Artefakt zostal upuszczony!", root, 244, 211, 27, false) end ) Link to comment
0 Z.l.X Posted November 18, 2012 Author Share Posted November 18, 2012 Your script has way too many timers, which can cause server to lag or clients to crash. I suggest no using timers at all, because I honestly can't see any idea why to use timers. I will remember for the future as the number of timers. Artifact would have to give the money and armor to the owner from time to time, so I used the setTimer function. Secondly, this is the wrong section to post your issues with scripts. Here is the section for script issues » Very sorry ;X Anyway, thank you for helping. Link to comment
Question
Z.l.X
.
Edited by GuestLink to comment
3 answers to this question
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