Why does this happen... Please help
#1

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

pawn Код:
new VIPexpire;
This is in my player stats enum

pawn Код:
VipExpiredTime
This is under save player data

pawn Код:
dini_IntSet(string, "VipExpiredTime", Player[playerid][VipExpiredTime]);
This is on register player

pawn Код:
dini_IntSet(string, "VipExpiredTime", Player[playerid][VipExpiredTime]);
This is under on player login attempt

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;
}
This is under on player login

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;
            }
If you need any more code just ask

Please help

Thanks
Reply


Messages In This Thread
Why does this happen... Please help - by Euan Hughes - 01.07.2012, 23:10
Respuesta: Why does this happen... Please help - by PHudson - 01.07.2012, 23:16
Re: Respuesta: Why does this happen... Please help - by Vince - 01.07.2012, 23:18
Re: Why does this happen... Please help - by Euan Hughes - 01.07.2012, 23:25
Re: Why does this happen... Please help - by Ricop522 - 02.07.2012, 00:19
Re: Why does this happen... Please help - by Euan Hughes - 02.07.2012, 00:25
Re: Why does this happen... Please help - by Tee - 02.07.2012, 02:09

Forum Jump:


Users browsing this thread: 1 Guest(s)