Why does my variable turn out like this..
#1

Well im making a VIP system and when you get VIP it stays there for 30 days and it disappears after a certain amount of time.. Im using unix timestamps.. ( I think ) and when it saves the time in a variable it shows like this

pawn Код:
VipExpiredTime=1343821147
And it should not ... This is what the code looks like

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;
                Player[id][VipExpiredTime] = gettime() + 60;

                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;
}
The time plus 60 seconds should no where be as big as that...

And this is when the player trys and logs in..

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

Thanks
Reply


Messages In This Thread
Why does my variable turn out like this.. - by Euan Hughes - 02.07.2012, 16:15
Re: Why does my variable turn out like this.. - by Niko_boy - 02.07.2012, 16:41
AW: Why does my variable turn out like this.. - by Nero_3D - 02.07.2012, 17:05

Forum Jump:


Users browsing this thread: 1 Guest(s)