Raised This Month: $ Target: $400
 0% 

Get Players Money at Disconnect throws error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-05-2013 , 12:04   Get Players Money at Disconnect throws error
Reply With Quote #1

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

Last edited by Kia; 05-05-2013 at 12:04.
Kia is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-05-2013 , 12:16   Re: Get Players Money at Disconnect throws error
Reply With Quote #2

They are gone already
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 05-05-2013 , 12:16   Re: Get Players Money at Disconnect throws error
Reply With Quote #3

Cache their money in the Money event instead if this doesn't work
Backstabnoob is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-05-2013 , 12:17   Re: Get Players Money at Disconnect throws error
Reply With Quote #4

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 View Post
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.
__________________

Last edited by Kia; 05-05-2013 at 12:18.
Kia is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 05-05-2013 , 13:45   Re: Get Players Money at Disconnect throws error
Reply With Quote #5

When player is disconnecting? , connor made a mistake
EpicMonkey is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-05-2013 , 13:48   Re: Get Players Money at Disconnect throws error
Reply With Quote #6

There is nothing wrong by doing it like Backstabnoob suggested.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-05-2013 , 14:51   AW: Get Players Money at Disconnect throws error
Reply With Quote #7

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?
__________________
Kia is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 05-05-2013 , 14:55   Re: AW: Get Players Money at Disconnect throws error
Reply With Quote #8

Quote:
Originally Posted by Kia View Post
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
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 05-05-2013 , 15:04   AW: Get Players Money at Disconnect throws error
Reply With Quote #9

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..."
__________________
Kia is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-05-2013 , 15:42   Re: AW: Get Players Money at Disconnect throws error
Reply With Quote #10

Quote:
Originally Posted by Kia View Post
Isn't there a message below my posts? "Send through Tapatalk..."
No there isn't.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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