if(strlen(Player[playerid][VipExpirationDate]) == Day && Player[playerid][VipExpirationMonth] == Month && Player[playerid][VipLevel] >= 1)
{
format(string, sizeof(string), "Your VIP subscription (level %d) has expired.", Player[playerid][VipLevel]);
SendClientMessage(playerid, YELLOW, string);
Player[playerid][VipLevel] = 0;
Player[playerid][VipExpirationDate] = 0;
Player[playerid][VipExpirationMonth] = 0;
format(string, sizeof(string), "%s's VIP subscription (level %d) has expired.", GetNameWithUnderscore(playerid), Player[playerid][VipLevel]);
SendToAdmins(ADMINORANGE, string, 0);
}
if(Player[playerid][VipExpirationDate]) >= Day && Player[playerid][VipExpirationMonth] >= Month && Player[playerid][VipLevel] >= 1)
._.
this thing is the problem - "strlen(Player[playerid][VipExpirationDate]) == Day" u dont use strlen here... use this "Player[playerid][VipExpirationDate] == Day" Edit; there is a back draw of the code you are using.. If u login on the day vip would be expired then ur vip will be taken.. But what if u dont login on the day of expiration date and login a day after that? then the vip will not be taken... So solution to this is use the following if Line pawn Код:
|
C:\Users\Jason\Documents\Something Gaming\Something Roleplay\gamemodes\RP.pwn(3658) : error 029: invalid expression, assumed zero
C:\Users\Jason\Documents\Something Gaming\Something Roleplay\gamemodes\RP.pwn(3658) : warning 215: expression has no effect
C:\Users\Jason\Documents\Something Gaming\Something Roleplay\gamemodes\RP.pwn(3658) : error 001: expected token: ";", but found ")"
C:\Users\Jason\Documents\Something Gaming\Something Roleplay\gamemodes\RP.pwn(3658) : error 029: invalid expression, assumed zero
C:\Users\Jason\Documents\Something Gaming\Something Roleplay\gamemodes\RP.pwn(3658) : fatal error 107: too many error messages on one line
You can use Unix Timestamps which are a much shorter efficient method to handling dates. I wrote a tutorial here.
|
if(Player[playerid][VipExpirationDate] >= Day && Player[playerid][VipExpirationMonth] >= Month && Player[playerid][VipLevel] >= 1)