View Single Post
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-01-2013 , 05:12   Re: Donations
Reply With Quote #7

Quote:
Originally Posted by hornet View Post
Code:
public client_connect( id ) g_bDonateUsed[ id ] = false; public CSBase_PlayerPost_Spawn( id ) g_bDonateUsed[ id ] = false; public client_disconnect( id ) g_bDonateUsed[ id ] = false;
Right there you've got 3 forwards doing the same thing. Ham_Spawn is called once when player connects so that would be the only one you need.

In some cases you send info in menu_additem() but you don't retrieve it, which means no need to send it. Also, player indexes can change, so when selecting a player you should use the player's userid and send that in menu_additem() instead of player index. Something you've missed aswell is checking to see if the player is still connected - you might donate to the wrong player otherwise.

You may also want to revise your readability with variable names, eg. g_szDonationTarget is numerical.

Updated v1.0.1

edited all you have stated apart from the players userid im having trouble getting it working 100% so atm left it at players index.
__________________
Blizzard_87 is offline