Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

How to make expire system

$
0
0
Here clan_cashreward is activated and need to expire it after 4 days how can it set;
there is an variable in (MYSQL) Clan_CashReward_End

PHP Code:

                new Query[300];
                new 
cashreward;
                new 
cashrewardexpire;
                
mysql_format(gSQL,Querysizeof(Query), "SELECT * FROM `Clans` WHERE `ID` = '%d'",GetPlayerClanId(playerid));
                
mysql_query(gSQLQuery );
                
cache_get_value_int(0"Clan_CashReward",cashreward);
                
cache_get_value_int(0"Clan_CashReward_End"cashrewardexpire);
                if(
cashreward == 0)
                {
                    new 
yearmonthdayDate[12];
                    
getdate(yearmonthday);
                    
format(Date12"%02d/%02d/%d"daymonthyear);
                    
mysql_format(gSQL,Querysizeof(Query), "UPDATE `Clans` SET `Clan_CashReward` = '1' WHERE `ID` = '%d'",GetPlayerClanId(playerid));
                    
mysql_query(gSQLQuery );
                    
mysql_format(gSQL,Querysizeof(Query), "UPDATE `Clans` SET `Clan_CashReward_Start` = '%s' WHERE `ID` = '%d'",Date,GetPlayerClanId(playerid));
                    
mysql_query(gSQLQuery );
                }
                else
                {
                    
SendClientMessage(playerid,-1,"{FF0000}ERROR: Its Already Activated!");
                } 


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>