Vip system
#1

I made this vip system but it wont save the day and the vip level, this is my coding that i made. Its not saving when it should do.

PHP код:
CMD:setvip(playeridparams[])
{
    new
        
string[200],
        
id,
        
level,
        
days
    
;
    if(
IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 7)
     {
        if(
sscanf(params"uii"idleveldays)) return SendClientMessage(playerid,error"Usage: /setvip [playerid] [level(0/3)] [days]");
        if(
id == INVALID_PLAYER_ID) return SendClientMessage(playeriderror"Error: Player is not connected.");
        if(
level || level 3) return SendClientMessage(playeriderror"Max 3 - Min 1.");
        if(
level == pInfo[id][VIP]) return SendClientMessage(playeriderror"Player is already that VIP level.");
        if(
Logged[playerid] == 0) return SendClientMessage(playeriderror"Player not logged in.");
        if(
level != 0)
        {
            if(
days || days 364) return SendClientMessage(playerid,error"Min Exp 1 - Max Exp 364 .");
        }
        if(
level >= 1)
        {
            
pInfo[id][ExpVIP] = gettime() + 60*60*24*days;
               
pInfo[id][VIP] = level;
        
SaveChar(id);
            
format(string128"[AdmCmd]: {FF6347} An Administrator has set your vip level to %d for %d days.",leveldays);
            
SendClientMessage(idredstring);
            
format(string128"You have set %s vip level to %d for %d days."GetName(id),leveldays);
            
SendClientMessage(playeridjbluestring);
            return 
1;
        }
        else if(
level == 0)
        {
            
days 0;
            
pInfo[id][ExpVIP] = 0;
    
pInfo[id][VIP] = 0;
        
SaveChar(id);
    
        
format(string128"[AdmCmd]: {FF6347} An Administrator has removed your Vip Package.");
            
SendClientMessage(idredstring);
            
format(string128"You have removed %s VIP package."GetName(id));
            
SendClientMessage(playeridjbluestring);
            return 
1;
        }
    }
    else
    {
        
SendClientMessage(playeriderror"You are not authorized to use this command.");
    }
    return 
1;
}
//under savechar forward
    
INI_WriteInt(ACCOUNT"VIP",pInfo[playerid][VIP]);
    
INI_WriteInt(ACCOUNT"ExpVIP",pInfo[playerid][ExpVIP]);
//under loadchar forward
    
INI_Int("VIP"pInfo[playerid][VIP]);
       
INI_Int("ExpVIP",pInfo[playerid][ExpVIP]); 
Reply


Messages In This Thread
Vip system - by 1fret - 05.06.2017, 06:42
Re: Vip system - by 1fret - 05.06.2017, 16:24
Re: Vip system - by sampkinq - 05.06.2017, 16:36
Re: Vip system - by 1fret - 05.06.2017, 17:00
Re: Vip system - by JasonRiggs - 05.06.2017, 17:13
Re: Vip system - by 1fret - 05.06.2017, 17:24
Re: Vip system - by 1fret - 06.06.2017, 05:35
Re: Vip system - by DRIFT_HUNTER - 06.06.2017, 06:22
Re: Vip system - by JasonRiggs - 06.06.2017, 12:54
Re: Vip system - by 1fret - 07.06.2017, 04:06

Forum Jump:


Users browsing this thread: 3 Guest(s)