01.07.2012, 23:10
Well i have been trying to create a vip system where if you get VIP it lasts for 30 days well its fine if you get VIP and the log out and log back in you still have it until the time is up..
But..
If i restart the server it says Your vip has expired and it should not have.. And i dont have VIP no more... I think it it something to do with gettime()
Please help me
This is in my player stats enum
This is under save player data
This is on register player
This is under on player login attempt
This is under on player login
If you need any more code just ask
Please help
Thanks
But..
If i restart the server it says Your vip has expired and it should not have.. And i dont have VIP no more... I think it it something to do with gettime()
Please help me
pawn Код:
new VIPexpire;
pawn Код:
VipExpiredTime
pawn Код:
dini_IntSet(string, "VipExpiredTime", Player[playerid][VipExpiredTime]);
pawn Код:
dini_IntSet(string, "VipExpiredTime", Player[playerid][VipExpiredTime]);
pawn Код:
Player[playerid][VipExpiredTime] = dini_Int(string, "VipExpiredTime");
pawn Код:
command(changeviplevel, playerid, params[])
{
new level, id, string[128], string2[128];
if(sscanf(params, "ud", id, level))
{
if(Player[playerid][AdminLevel] >= 5)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /changeviplevel [playerid] [level]");
}
}
else
{
if(Player[playerid][AdminLevel] >= 5)
{
if(level > 4 ) return SendClientMessage(playerid, RED, "Avaliable levels 1 - 4");
if(IsPlayerConnectedEx(id))
{
Player[id][VipRank] = level;
VIPexpire = gettime() + 2592000;
format(string, sizeof(string), "%s's VIP level has been changed to %d, by %s.", GetName(id), level, GetName(playerid));
format(string2, sizeof(string2), "%s's VIP level has been changed to %d by %s.", GetName(id), level, GetName(playerid));
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1)
{
SendClientMessage(i, YELLOW, string);
SetPlayerColor(id, YELLOW);
}
if(level == 0)
{
SendClientMessage(i, YELLOW, string2);
SetPlayerColor(id, WHITE);
}
}
}
else
{
SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
}
}
}
return 1;
}
pawn Код:
if(gettime() > VIPexpire && Player[playerid][VipRank] != 0)
{
Player[playerid][VipExpiredTime] = 1;
}
if(Player[playerid][VipExpiredTime] == 1)
{
SendClientMessage(playerid, RED, "Your VIP has expired to by it again go to www.DBullet-Gaming.tk");
Player[playerid][VipRank] = 0;
Player[playerid][VipExpiredTime] = 0;
}
Please help
Thanks