Jump to content

race points


Recommended Posts

Posted

hi all,

i wanna make a script that you get Race points

but it's not work can you help me?

Greeting Maarten123

Script:

function addPoints(playerSource)
local playeraccount = getPlayerAccount ( source )
local points = getPlayerAccount ( source, "Points" ) + 3
setAccountData ( playeraccount, "Points", points )
outputChatBox("will it work?", player, 222, 0, 0, true)
end
addCommandHandler("add",addPoints)

Posted
function addPoints(playerSource)
local playeraccount = getPlayerAccount ( playerSource )
local points = getPlayerAccount ( playerSource, "Points" ) + 3
setAccountData ( playeraccount, "Points", points )
outputChatBox("will it work?", playerSource, 222, 0, 0, true)
end
addCommandHandler("add",addPoints)

but didn't work :(

Posted
did you just forget to copy it or did you remove the end of the function and the command handler? line 3 should be getAccountData (the player account should go there), you maybe need to use tonumber to turn the string which getAccountDataReturns to a number

is this wat you mean?Not work i don't understand :P

function addPoints(playerSource)
local playeraccount = getPlayerAccount ( playerSource )
local points = getPlayerAccount ( playerSource, "Points" ) + 3
setAccountData ( playeraccount, "Points", tonumber(points) )
outputChatBox("work?", playerSource, 222, 0, 0, true)
end
addCommandHandler("add",addPoints)

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