AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get Players Money at Disconnect throws error (https://forums.alliedmods.net/showthread.php?t=215258)

Kia 05-05-2013 12:04

Get Players Money at Disconnect throws error
 
Hello everybody,

I have a little problem here, I wan't to save the players money into a Variable when he's disconnecting using this code :

PHP Code:

public client_disconnect(id)
{
    
g_iMoney[id] = cs_get_user_money(id// Error Line
    
save_user_money(id)    


But sometimes I get this in my log and players saved money gets 0 :

Quote:

L 05/05/2013 - 17:45:58: [CSTRIKE] Invalid player 5
L 05/05/2013 - 17:45:58: [AMXX] Run time error 10: native error (native "cs_get_user_money")
Anyone knows how to fix that? I'd say "if(is_user_connected(id))", but I think I can't check that on disconnect.

Greets,
Kia.

YamiKaitou 05-05-2013 12:16

Re: Get Players Money at Disconnect throws error
 
They are gone already

Backstabnoob 05-05-2013 12:16

Re: Get Players Money at Disconnect throws error
 
Cache their money in the Money event instead if this doesn't work

Kia 05-05-2013 12:17

Re: Get Players Money at Disconnect throws error
 
But why this only happens to a few players and not to all?
And how to fix it, or which alternative exists?

Quote:

Originally Posted by ConnorMcLeod (Post 1941553)
You forgot to close the vault at map end, gonna makes problems.
Also, you save load money lot of time when it is useless, you should only save when game is restarting and when player is disconnecting

To meet this requirement I need to save at d/c.

EpicMonkey 05-05-2013 13:45

Re: Get Players Money at Disconnect throws error
 
When player is disconnecting? , connor made a mistake :3

bibu 05-05-2013 13:48

Re: Get Players Money at Disconnect throws error
 
There is nothing wrong by doing it like Backstabnoob suggested.

Kia 05-05-2013 14:51

AW: Get Players Money at Disconnect throws error
 
The strange thing is, that when you say it's wrong, it wouldn't work foe anyone, but only 3-4 players experience this problem.

What is money event?

bibu 05-05-2013 14:55

Re: AW: Get Players Money at Disconnect throws error
 
Quote:

Originally Posted by Kia (Post 1946447)
What is money event?

This links can help you:

https://forums.alliedmods.net/showthread.php?t=134462

https://forums.alliedmods.net/showthread.php?t=134274

Kia 05-05-2013 15:04

AW: Get Players Money at Disconnect throws error
 
I know the Search Function, but as I am online via Tapatalk and the app crashes using search, I asked here.
Isn't there a message below my posts? "Send through Tapatalk..."

wickedd 05-05-2013 15:42

Re: AW: Get Players Money at Disconnect throws error
 
Quote:

Originally Posted by Kia (Post 1946455)
Isn't there a message below my posts? "Send through Tapatalk..."

No there isn't.


All times are GMT -4. The time now is 10:52.

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