Ghostman Posted July 16, 2011 Share Posted July 16, 2011 Hi I'm in trouble I managed to get exp for zombies in my server. But the problem is that it only has no levels. If someone can get me a script levels, please. like this: Link to comment
Twisted Posted July 16, 2011 Share Posted July 16, 2011 This is taken from another server can't remember the name Link to comment
Ghostman Posted July 16, 2011 Author Share Posted July 16, 2011 Yeah it's from another server called: Zombie HELL PARTY | GTA-MP.lt 1.0.5 82.135.228.238:22003 Link to comment
Try Posted July 16, 2011 Share Posted July 16, 2011 Ghostman I have a level system I had A zombie Sever I think it will work let me post the code: The script its from castillo then i only add the code for get exp local rootElement = getRootElement() levels = {} levels[0] = {"Test 0", "10"} levels[1] = {"Test 1", "20"} levels[2] = {"Test 2", "100"} levels[3] = {"Test 3", "150"} levels[4] = {"Test 4", "200"} function ResourceStart () executeSQLCreateTable("levels", "accountname STRING, level INT") end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), ResourceStart) function addPlayer() local account = getPlayerAccount(source) local playername = getPlayerName(source) CheckPlayer = executeSQLSelect ( "levels", "accountname", "accountname = '" .. getAccountName(account) .. "'" ) if ( type( CheckPlayer ) == "table" and #CheckPlayer == 0 ) or not CheckPlayer then executeSQLInsert ( "levels", "'".. getAccountName(account) .."','0'" ) end end addEventHandler("onPlayerLogin",rootElement,addPlayer) addEventHandler( "onElementDataChange", rootElement, function () if getElementType(source) == "player" then local acc = getPlayerAccount(source) local accountname = getAccountName(acc) local playername = getPlayerName(source) local data = getElementData(source,"exp") local sqldata = executeSQLSelect ( "levels", "level","accountname = '" .. accountname .. "'") lvl = sqldata[1]["level"] if tostring(data) == tostring(levels[lvl][2]) then outputChatBox("*Level system: congratulations ".. playername .." you're now a ".. levels[lvl][1] .."!",getRootElement(),0,255,0) local textDis = textCreateDisplay () local item = textCreateTextItem( "LEVEL UP! YOU'RE NOW LEVEL ".. tostring(sqldata[1]["level"]), 0.5, 0.4, 2, 0, 255, 0, 255, 4, "center", "center" ) textDisplayAddText ( textDis, item ) textDisplayAddObserver ( textDis, source ) setTimer ( textDestroyTextItem, 5000, 1, item ) setTimer ( textDestroyDisplay, 5000, 1, textDis ) sql = tonumber(sqldata[1]["level"]) + 1 executeSQLUpdate("levels", "level = '".. sql .."'", "accountname = '".. accountname .."'") end end end) function rewardOnWasted ( killer ) local exp = getElementData(killer,"exp") if exp then setElementData(killer,"exp",tonumber(getElementData(killer,"exp"))+5) outputChatBox("Experience gained +5! total ".. tonumber(exp)+5,killer,0,255,0) else setElementData(killer,"exp",5) end end addEvent("onZombieWasted",true) addEventHandler ( "onZombieWasted", getRootElement(), rewardOnWasted ) If u need put for give money ask me! And this is Server Side Link to comment
Ghostman Posted July 16, 2011 Author Share Posted July 16, 2011 thanks it's worked. much thanks, much much thanks. i known how to put money. thanks and ip from you server is? Link to comment
Try Posted July 16, 2011 Share Posted July 16, 2011 Hahaha Np Your Welcome! And I HAD a server My server is closed now Link to comment
Twisted Posted July 16, 2011 Share Posted July 16, 2011 Try, please do not help people that are willing to steal scripts from other servers. Link to comment
Try Posted July 16, 2011 Share Posted July 16, 2011 LoL what happen with you my love?! Don't talk here go to msn This is a off topic now Link to comment
||~zZz~|| Posted December 29, 2017 Share Posted December 29, 2017 Guys who is programer for a zombie server i need one plz 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