Jump to content

scripting help


bandi94

Recommended Posts

Posted

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> 

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted (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 by Guest

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

omg this is first thing what i writ " i have this script not completli made by me " = you make it 90% and i 10%

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

stil not working not write get hunter .. and not make the column for scoreboard

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

First, don't double post, and second, copy the code again, I forgot to add a 'end'.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

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

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

Copy again the code, I did a mistake, used "AccountData" but it was "accountData", typos.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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