Jump to content

scripting help


bandi94

Recommended Posts

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

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 by Guest
Link to comment

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

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

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...