AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client Disconnect (ID) (https://forums.alliedmods.net/showthread.php?t=143629)

Tonda 11-22-2010 07:31

Client Disconnect (ID)
 
Hi, i have server and if you are join, you will have 5 points. You can buy items for this points. But if you reconnect, you will have 5 points again and this is bad.

So i try edited and script do this:

Code:

public client_disconnect( id ) {
        check_disconnect[ id ] = 1;

and

Code:

public client_putinserver( id )
{       
        if (check_disconnect[id])
        {
        points[id] = get_pcvar_num(points_disconnect);       
        }
        return PLUGIN_CONTINUE;
}

So after this if client disconnect and he come again, he have 0 points (points_disconnect). All works fine but ... If do reconnect one player on the server, all players on the server have 0 points for reconnect. Why ? I defined ID and only this player ID obtained points_disconnect. Help me ...

ConnorMcLeod 11-22-2010 07:35

Re: Client Disconnect (ID)
 
You have to work with steamid, players indexes are shared.

Tonda 11-22-2010 08:09

Re: Client Disconnect (ID)
 
Quote:

Originally Posted by ConnorMcLeod (Post 1354351)
You have to work with steamid, players indexes are shared.

Thx for you reply and what you mean, what is the better way for this problem?

bibu 11-22-2010 11:58

Re: Client Disconnect (ID)
 
Quote:

Originally Posted by Tonda (Post 1354366)
Thx for you reply and what you mean, what is the better way for this problem?

Saving the points with nvault/fvault, sqlite.

Emp` 11-22-2010 13:40

Re: Client Disconnect (ID)
 
Working with a Trie would be better.

ConnorMcLeod 11-22-2010 13:41

Re: Client Disconnect (ID)
 
I wish TrisSetArray have been fixed :'(

Exolent[jNr] 11-22-2010 14:03

Re: Client Disconnect (ID)
 
Quote:

Originally Posted by ConnorMcLeod (Post 1354556)
I wish TrisSetArray have been fixed :'(

I thought it was in developer builds?

ConnorMcLeod 11-22-2010 15:15

Re: Client Disconnect (ID)
 
No, though diff has been posted for a long time now.

fysiks 11-22-2010 23:31

Re: Client Disconnect (ID)
 
Quote:

Originally Posted by Exolent[jNr] (Post 1354570)
I thought it was in developer builds?

I posted the diff but nobody has pushed it. I posted a documentation diff but hasn't been pushed. I asked Bail about pushing some (mainly my doc diff) but was interupted at home and he wasn't on when I got back :(.

EDIT: They have a review+ from Bail though :)

abdul-rehman 11-23-2010 05:31

Re: Client Disconnect (ID)
 
What are tries btw ??
Are they like CellArrays ??


All times are GMT -4. The time now is 11:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.