Raised This Month: $ Target: $400
 0% 

Integer not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-16-2010 , 01:19   Re: Integer not working
Reply With Quote #1

Quote:
Originally Posted by OneMoreLevel View Post
I've got this code, and my main goal besides providing a list of shop items, is to make it so that you can only purchase 3 items per life. However, it is three items per map. The integer at the bottom of the code is not resetting, any help?

Also, if my code can be optimized, i would appreciate it.

PHP Code:
#include < amxmodx > 
#include < cstrike > 
#include < hamsandwich > 

#define MAX_MONEY 16000 

#define CT_MONEY_PER_SECOND 2 

#define T_MONEY_PER_CT_KILL 250 

public plugin_init( ) 

    
register_plugin"Money Maker""0.0.1""Exolent" ); 
     
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost"); 
    
RegisterHamHam_Killed"player""FwdPlayerKilledPost"); 


public 
client_disconnectiPlayer 

    
remove_taskiPlayer ); 


public 
FwdPlayerSpawnPostiPlayer 

    if( 
is_user_aliveiPlayer ) ) 
    { 
        if( 
cs_get_user_teamiPlayer ) == CS_TEAM_CT 
        { 
            if( !
task_existsiPlayer ) ) 
            { 
                
set_task1.0"TaskGiveMoney"iPlayer ); 
            } 
        } 
        else 
        { 
            
remove_taskiPlayer ); 
        } 
    } 


public 
FwdPlayerKilledPostiVictimiKillerbShouldGib 

    if( 
cs_get_user_teamiVictim ) == CS_TEAM_CT 
    
&&  is_user_connectediKiller 
    &&  
cs_get_user_teamiKiller ) == CS_TEAM_T 
    { 
        new 
iPlayers32 ], iNum
        
get_playersiPlayersiNum"h" ); 
         
        for( new 
0iNumi++ ) 
        { 
            
iVictim iPlayers]; // no need for a new variable 
             
            
if( iVictim == iKiller 
            
||  cs_get_user_teamiVictim ) == CS_TEAM_T 
            { 
                
GiveMoneyiVictimT_MONEY_PER_CT_KILL ); 
            } 
        } 
    } 


public 
TaskGiveMoneyiPlayer 

    if( 
is_user_aliveiPlayer 
    &&  
cs_get_user_teamiPlayer ) == CS_TEAM_CT 
    { 
        
GiveMoneyiPlayerCT_MONEY_PER_SECOND ); 
         
        
set_task1.0"TaskGiveMoney"iPlayer ); 
    } 


GiveMoneyiPlayeriMoneyToGive 

    new 
iMoney cs_get_user_moneyiPlayer ); 
     
    if( 
iMoney MAX_MONEY 
    { 
        
iMoney min( ( iMoney iMoneyToGive ), MAX_MONEY ); 
         
        
cs_set_user_moneyiPlayeriMoney ); 
    } 



I think you need to learn how to copy and paste. That code has nothing to do with your post.
__________________
fysiks is offline
Reply



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 03:43.


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