NotAvailable Posted July 19, 2010 Posted July 19, 2010 (edited) Ok, this is a rank system for my zombie server. 0 Errors, But when i kill 10 zombies i wont rank up? And the text what supposed to be on the scoreboard is not on the scoreboard. here is the code: addEvent("onZombieWasted") addEventHandler( "onZombieWasted", getRootElement(), function (killer) local player = getPlayerAccount ( killer ) local myRank = getAccountData(player,"rank") zombieKills = getAccountData(player, "zombieKills") if (zombieKills == "" or zombieKills == nil or zombieKills == false) then zombieKills = 0 end if (look == "" or look == nil or look == false) then look = 0 display = textCreateDisplay() textDisplayAddObserver (display,killer) kills = textCreateTextItem ("Kills: "..zombieKills,0.8,0.5,"medium",255,255,255,255,1.5) rank = textCreateTextItem ("Rank: "..myRank,0.8,0.53,"medium",255,255,255,255,1.5) textDisplayAddText (display,kills) textDisplayAddText (display,rank) elseif look == 0 then textItemSetText (kills,"Kills: "..zombieKills) textItemSetText (rank,"Rank: "..myRank) end givePlayerMoney (killer, 25); setAccountData (player,"zombieKills",zombieKills+1) if (getAccountData (player,"zombieKills") == 10) then setAccountData (player,"rank","Trainee") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Trainee!") outputChatBox ("Congratulations for your first rank! You get $500 as reward.",killer,0,255,0) givePlayerMoney (killer,500) elseif (getAccountData (player,"zombieKills") == 100) then setAccountData (player,"rank","Beginner") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Beginner!") outputChatBox ("Congratulations for your new rank! You get $1000 as reward.",killer,0,255,0) givePlayerMoney (killer,1000) elseif (getAccountData (player,"zombieKills") == 200) then setAccountData (player,"rank","Survivor") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Survivor!") outputChatBox ("Congratulations for your new rank! You get $2000 as reward.",killer,0,255,0) givePlayerMoney (killer,2000) elseif (getAccountData (player,"zombieKills") == 500) then setAccountData (player,"rank","Expert") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Expert!") outputChatBox ("Congratulations for your new rank! You get $5000 as reward.",killer,0,255,0) givePlayerMoney (killer,5000) elseif (getAccountData (player,"zombieKills") == 1000) then setAccountData (player,"rank","Assassin") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Assassin!") outputChatBox ("Congratulations for your new rank! You get $7000 as reward.",killer,0,255,0) givePlayerMoney (killer,7000) elseif (getAccountData (player,"zombieKills") == 5000) then setAccountData (player,"rank","Master") outputChatBox ("New rank! "..getPlayerName(killer).." Has been promoted to: Master!") outputChatBox ("Congratulations! You have reached the last rank! You win: 1 000 000 !",killer,0,255,0) givePlayerMoney (killer,1000000) end end ) Regards, Jesse Edited July 19, 2010 by Guest
50p Posted July 19, 2010 Posted July 19, 2010 Why? https://forum.multitheftauto.com/viewtop ... 91&t=27027 - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
NotAvailable Posted July 19, 2010 Author Posted July 19, 2010 Why?https://forum.multitheftauto.com/viewtop ... 91&t=27027 This good?
50p Posted July 19, 2010 Posted July 19, 2010 Why?https://forum.multitheftauto.com/viewtop ... 91&t=27027 This good? This is how you're supposed to ask for help. - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
NotAvailable Posted July 19, 2010 Author Posted July 19, 2010 Why?https://forum.multitheftauto.com/viewtop ... 91&t=27027 This good? This is how you're supposed to ask for help. Yh, sorry i was in a hurry
dzek (varez) Posted July 19, 2010 Posted July 19, 2010 boards are reading values from element data (setElementData) not from account data Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
NotAvailable Posted July 20, 2010 Author Posted July 20, 2010 boards are reading values from element data (setElementData) not from account data k thanks
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