Newbie Posted May 4, 2014 Share Posted May 4, 2014 addEvent("onMapStarting", true) addEventHandler("onMapStarting", getRootElement(), function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "Hunter", false) end end) function someoneReachedHunter(number, sort, model) for index, account in ipairs ( getAccounts ( ) ) do if getAccountPlayer ( account ) then if (model == 425) then if (getElementData(source, "Hunter") == false ) then outputChatBox ( "#000000* #ffffff " ..getPlayerName(source).." Got hunter! $#11dd111000", getRootElement(), 255, 255, 255, true ) setAccountData( account,"Hunters",tonumber( getAccountData( account,"Hunters" ) or 0 )+1 ) setAccountData( account,"Cash",tonumber( getAccountData( account,"Cash" ) or 0 )+1000 ) setAccountData( account,"EXP",tonumber( getAccountData( account,"EXP" ) or 0 )+5 ) setElementData(source,"Hunter",true) end end end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) I Got some bugs.. Lets say we are playing 2 in the server. And if both gots hunters, data sets only to one player.. What's wrong ? Link to comment
.:HyPeX:. Posted May 4, 2014 Share Posted May 4, 2014 You should try doing some debugging yourself, changing stuff and watching what happens. Link to comment
.:HyPeX:. Posted May 4, 2014 Share Posted May 4, 2014 no errors .. Did you read correctly what i said? https://wiki.multitheftauto.com/wiki/Debugging Link to comment
Newbie Posted May 4, 2014 Author Share Posted May 4, 2014 Oh my good. Yes i did. /debugscript 3 .. Link to comment
.:HyPeX:. Posted May 4, 2014 Share Posted May 4, 2014 Oh my good. Yes i did./debugscript 3 .. ....... Debugging doesnt mean actually just debugscript 3, it means testing out WHY it happens by editing the lines that do it. Link to comment
Arnold-1 Posted May 4, 2014 Share Posted May 4, 2014 name the getAccount table, like accounts = getAccounts then use accounts. 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