Jump to content

Point System


#Honda-R

Recommended Posts

Posted

Hey Scripters i need some little help :)

I need to add scoreboard collum Points

When player die hes got 1 point

when relog , rejoin server , loads points , could u help me ? :)

Posted

Do you expect us to make it for you?

You got to make it by yourself, we'll just give tips and help fixing errors. Use these functions:

addScoreboardColumn --this is an exported function from 'dxscoreboard'/'scoreboard', you got to use "call" function or "exports" table to call it 
setElementData 
getElementData 

And these events:

onPlayerWasted 
onPlayerLogin 
onPlayerJoin 

Posted
i don't think onPlayerJoin is needed. You need onPlayerQuit.

Use these function to save/load the points.

setAccountData 
getAccountData 
getPlayerAccount 

He wants when player rejoin server, not quit.

rejoin means (quit and join)

Simply all you need is save the points in the account when the player quit, and load it from the account when the player login.

There no need for onPlayerJoin unless you going make a system to save the player serial and its points in (xml, sql, mysql) then it going be a waste of time and effort.

Posted
i don't think onPlayerJoin is needed. You need onPlayerQuit.

Use these function to save/load the points.

setAccountData 
getAccountData 
getPlayerAccount 

He wants when player rejoin server, not quit.

rejoin means (quit and join)

Simply all you need is save the points in the account when the player quit, and load it from the account when the player login.

There no need for onPlayerJoin unless you going make a system to save the player serial and its points in (xml, sql, mysql) then it going be a waste of time and effort.

Oh my god. How do you think he'll load points when player join then?

Posted

rejoin means (quit and join)

Simply all you need is save the points in the account when the player quit, and load it from the account when the player login.

There no need for onPlayerJoin unless you going make a system to save the player serial and its points in (xml, sql, mysql) then it going be a waste of time and effort.

Oh my god. How do you think he'll load points when player join then?

you kidding me?

And these events:

onPlayerWasted 
onPlayerLogin [size=8]This event what for then?[/size] 
[strike]onPlayerJoin[/strike] 

Posted

rejoin means (quit and join)

Simply all you need is save the points in the account when the player quit, and load it from the account when the player login.

There no need for onPlayerJoin unless you going make a system to save the player serial and its points in (xml, sql, mysql) then it going be a waste of time and effort.

Oh my god. How do you think he'll load points when player join then?

you kidding me?

And these events:

onPlayerWasted 
onPlayerLogin [size=8]This event what for then?[/size] 
[strike]onPlayerJoin[/strike] 

That event is called when a player logs in, not join. Login and join are things very different.

Guest Guest4401
Posted
Oh my god. How do you think he'll load points when player join then?

It's not possible and does not have to be possible, if he is using MTA's default account system. When player joins, he is a guest, not logged in. How will you get his account data (points)?

So I guess TAPL is right, onPlayerLogin has to be used.

Posted
Oh my god. How do you think he'll load points when player join then?

It's not possible and does not have to be possible, if he is using MTA's default account system. When player joins, he is a guest, not logged in. How will you get his account data (points)?

So I guess TAPL is right, onPlayerLogin has to be used.

The OP didn't say he's using default account system but did say he wants to load the points when the player joins, so I just sent him the right event for that.

Posted

Ok, then use these functions:

addScoreboardColumn --note that this is an exported function from scoreboard 
setElementData 
getElementData 
setAccountData 
getAccountData 

getPlayerAccount won't be needed here since onPlayerLogin event already sends the account as an argument.

And use these events:

onPlayerWasted 
onPlayerLogout 
onPlayerLogin 

I think I didn't forget any.

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