Jump to content

sript bug pls somebody fix it


bandi94

Recommended Posts

i have this script its not my script every time when somebody get the hunter a text apear and add 1 point( win) to account and show it up on tab menu the problem is that if on server are more that 4-5 players in tab menu the points are showed up crazy. Only some players point are showed up or nothing only the empty coloum ( the text is showed up on thextbox onli the tab menu is buged or hae some problems) pls if somebody can fix it

  
call(getResourceFromName("scoreboard"),"addScoreboardColumn","Total Win's") 
  
function vehicleDetector(pickupID, pickupType, vehicleModel) 
if pickupType == "vehiclechange" and vehicleModel == 425 then 
if getPlayerAccount(source) and not isGuestAccount(getPlayerAccount(source)) then 
increaseAccountData(source) 
outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter and get +1 win!",getRootElement(),25,125,225, true) 
else 
outputChatBox("*HUNTER ALERT: "..getPlayerName(source).." has found the Hunter, but wasn't logged in, login or register!",getRootElement(),25,125,225, true) 
      end 
   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) 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...