03.07.2012, 13:26
Well i have create a VIP system and pretty much it runs by Unix timestamps and when ever i put someone to VIP and they relog for some reason it just goes it dont say there VIP has expired it just goes like they never had it please help me
And this is OnPlayerLogin
Please help me
Does it only save for a certain level or something ?
If you need any more code just ask
Thanks
pawn Код:
command(changeviplevel, playerid, params[])
{
new level, id, string[128], string2[128], Hour, Minute, Second;
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;
gettime(Hour, Minute, Second);
Player[id][VipExpiredTime] = gettime() + 2516000;
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() > Player[playerid][VipExpiredTime] && 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;
}
Does it only save for a certain level or something ?
If you need any more code just ask
Thanks