Raised This Month: $12 Target: $400
 3% 

money shop


Post New Thread Reply   
 
Thread Tools Display Modes
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-26-2020 , 12:31   Re: money shop
Reply With Quote #11

Quote:
Originally Posted by Napoleon_be View Post
Updated my code again, removed is_user_connected() checks in the reset functions since i already remove tasks in client_disconnect(). Also if u modify the plugin, please leave the "if(is_user_alive(id))" check in the shophandler since the player needs to be alive to receive an item. If u don't do this, items will be given to a dead player which is not possible, and money will get decreased of the player buying from the shop.
i can't leave only to Alive player because of the Respawn! when someone dies he isn't able to buy respawn, thats why i used is user alive only where it had to be, like here
PHP Code:
 case 7:
        {
            if(!
is_user_alive(id))
            {
                
ExecuteHamB(Ham_CS_RoundRespawnid);
                
CromChat(id"!g[hS Shop] !nYou have purchased Respawn")
            }
            else
            {
                
CromChat(id"!g[hS Shop] !nYou are not dead, you can't buy Respawn if you're alive")
            }
        } 
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-26-2020 , 12:42   Re: money shop
Reply With Quote #12

Quote:
Originally Posted by Nutu_ View Post
i can't leave only to Alive player because of the Respawn! when someone dies he isn't able to buy respawn, thats why i used is user alive only where it had to be, like here
PHP Code:
 case 7:
        {
            if(!
is_user_alive(id))
            {
                
ExecuteHamB(Ham_CS_RoundRespawnid);
                
CromChat(id"!g[hS Shop] !nYou have purchased Respawn")
            }
            else
            {
                
CromChat(id"!g[hS Shop] !nYou are not dead, you can't buy Respawn if you're alive")
            }
        } 
Yea you're correct, didn't think about that.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 07:31.


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