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
there is an variable in (MYSQL) Clan_CashReward_End
PHP Code:
new Query[300];
new cashreward;
new cashrewardexpire;
mysql_format(gSQL,Query, sizeof(Query), "SELECT * FROM `Clans` WHERE `ID` = '%d'",GetPlayerClanId(playerid));
mysql_query(gSQL, Query );
cache_get_value_int(0, "Clan_CashReward",cashreward);
cache_get_value_int(0, "Clan_CashReward_End", cashrewardexpire);
if(cashreward == 0)
{
new year, month, day, Date[12];
getdate(year, month, day);
format(Date, 12, "%02d/%02d/%d", day, month, year);
mysql_format(gSQL,Query, sizeof(Query), "UPDATE `Clans` SET `Clan_CashReward` = '1' WHERE `ID` = '%d'",GetPlayerClanId(playerid));
mysql_query(gSQL, Query );
mysql_format(gSQL,Query, sizeof(Query), "UPDATE `Clans` SET `Clan_CashReward_Start` = '%s' WHERE `ID` = '%d'",Date,GetPlayerClanId(playerid));
mysql_query(gSQL, Query );
}
else
{
SendClientMessage(playerid,-1,"{FF0000}ERROR: Its Already Activated!");
}