SA-MP Forums Archive
How comes this does not save VIP after relogging - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How comes this does not save VIP after relogging (/showthread.php?tid=356375)



How comes this does not save VIP after relogging - Euan Hughes - 03.07.2012

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

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;
}
And this is OnPlayerLogin

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;
            }
Please help me

Does it only save for a certain level or something ?

If you need any more code just ask

Thanks


Re: How comes this does not save VIP after relogging - Euan Hughes - 03.07.2012

Please help

Thanks


Re: How comes this does not save VIP after relogging - [MM]RoXoR[FS] - 03.07.2012

pawn Код:
if(gettime() > Player[playerid][VipExpiredTime] && Player[playerid][VipRank] != 0)
            {
                Player[playerid][VipExpiredTime] = 1;
            }
else Player[playerid][VipExpiredTime] = 0;

            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;
            }