bandi94 Posted June 26, 2011 Share Posted June 26, 2011 i have this script not completli made by me its loading on my server i start it i don't get errors but the script don't do anithing scoreboard colum or writ the text in chatbox antihing if somebodi can make it work i ask him nicely to help me thx for everybody script function vehicleDetector(pickupID, pickupType, vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then increaseAccountData(source) outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter and get +1 win!",getRootElement(),25,125,225, true) end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),vehicleDetector) function increaseAccountData(player) if not player then return end local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return end local accountData = getAccountData(account,"hunterPoints") if not accountData then setAccountData(account,"hunterPoints",1) else setAccountData(account,"hunterPoints",tonumber(AccountData)+1) end end function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","Total Win's") end function updateScoreboardTotal Win's() local point = getAccountData(account,"hunterPoints") setElementData(localPlayer,"Total Win's",tonumber(point)) end setTimer(updateScoreboardTotal Win's,1000,0) meta <meta> <script src="addpoint.lua" type="server"/> </meta> Link to comment
Castillo Posted June 26, 2011 Share Posted June 26, 2011 (edited) Look, this is a total mess, and also, you are saying "I made this" when actually I did, it's not cool to steal someone's credits. call(getResourceFromName("scoreboard"),"addScoreboardColumn","Total Win's") function vehicleDetector(pickupID, pickupType, vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then increaseAccountData(source) outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter and get +1 win!",getRootElement(),25,125,225, true) end end addEventHandler("onPlayerPickUpRacePickup",getRootElement(),vehicleDetector) function increaseAccountData(player) if not player then return end local account = getPlayerAccount(player) if not account or isGuestAccount(account) then return end local accountData = getAccountData(account,"hunterPoints") if not accountData then setAccountData(account,"hunterPoints",1) else setAccountData(account,"hunterPoints",tonumber(accountData)+1) end end function updateScoreboardTotalWins() for i,v in pairs(getElementsByType("player")) do local account = getPlayerAccount(v) if not account or isGuestAccount(account) then return end local point = getAccountData(account,"hunterPoints") setElementData(v,"Total Win's",tonumber(point)) end end setTimer(updateScoreboardTotalWins,2000,0) Edited June 26, 2011 by Guest Link to comment
bandi94 Posted June 26, 2011 Author Share Posted June 26, 2011 omg this is first thing what i writ " i have this script not completli made by me " = you make it 90% and i 10% Link to comment
bandi94 Posted June 26, 2011 Author Share Posted June 26, 2011 stil not working not write get hunter .. and not make the column for scoreboard Link to comment
Castillo Posted June 26, 2011 Share Posted June 26, 2011 First, don't double post, and second, copy the code again, I forgot to add a 'end'. Link to comment
bandi94 Posted June 26, 2011 Author Share Posted June 26, 2011 ok thex now is working but only once for every player when a player get the hunter writ hunter allert ....... and aded 1 point in soceboard but when same player get again the hunter another map no more write and no more point aded Link to comment
gokalpfirat Posted June 26, 2011 Share Posted June 26, 2011 I think that castillo script that if you are not login your total wins are always 1 but if you are login your total wins are +1 when you reach hunter. Link to comment
bandi94 Posted June 26, 2011 Author Share Posted June 26, 2011 i don't log out and the wins are not +1 and the hunter alert player reached hunter he get +1 point don't apear i try to disconnect for server re connect login apear on thotal wins 1 and after if i get hunter not get 2 and the text don't apear and if you are not loget in the toatl win is blank noting apear Link to comment
gokalpfirat Posted June 26, 2011 Share Posted June 26, 2011 Use debugscript and say what error message you got? Link to comment
Castillo Posted June 26, 2011 Share Posted June 26, 2011 Copy again the code, I did a mistake, used "AccountData" but it was "accountData", typos. Link to comment
bandi94 Posted June 26, 2011 Author Share Posted June 26, 2011 thx now is working fine 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