Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

VIP Problem

$
0
0
Hello .. I have a vip system in dini and I translated it into ini.
When I enter the command /setvip, I turn off the server and I'm still crashing the game

Original code:
PHP Code:

dcmd_setvip(playeridparams[])
{
    new 
string[128];
    if(!
IsPlayerAdmin(playerid)) return SCM(playerid,WHITE ,"Pouze Hlavní Administrátor poihlášený poez Rcon muže nastavit VIP úeet !");
    new 
ID,DEN,level;
    if(!
IsPlayerAdmin(playerid)) return SCM(playerid0xFFFFFFFF"Neisi admin !");
    if(
sscanf(params"iii"ID,level,DEN)) return SCM(playerid0xFFFFFFFF"/setvip [playerid] [level] [den]");
    if(!
IsPlayerConnected(ID)) return SCM(playerid0xFFFFFFFF"ID nieje online!");
    if(
level || level 3) return SCM(playeridWHITE"Zlý level !");
    new 
DATE gettime()+mktime(0,0,0,DEN,0,0);

    new 
file[128];
    
format(file,sizeof(file),"VIP/%s.ini",Jmeno(ID));
    print(
file);
    if(
level 0)
    {
        if(
fexist(file)) return SCM(playeridWHITE"Tento hráe už VIP level má !");
        
format(stringsizeof(string), "Hlavný Administrátor %s nastavil hráeovy %s VIP úeet do %s !"Jmeno(playerid),Jmeno(ID),date(DATE,1));
        if(
level == 1format(string128"Admin %s nastavil hráeovy %s VIP {CD7F32}BRONZE{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        else if(
level == 2format(string128"Admin %s nastavil hráeovy %s VIP {C0C0C0}SILVER{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        else if(
level == 3format(string128"Admin %s nastavil hráeovy %s VIP {FFD700}GOLD{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        
RemoveTime[playerid] = DATE;
        print(
"If the server now falls, problem is box (VIP)");
        
dini_Create(file);
        
dini_IntSet(file,"Time",DATE);
        
dini_IntSet(file,"VIP",level);
        
SCMTA(0xFF0000AAstring);
    }
    else if(
level == 0)
    {
        if(!
fexist(file)) return SCM(playeridWHITE"Tento hráe nemá VIP level!");
        
format(stringsizeof(string), "Hlavný Administrátor %s zobral hráeovy %s VIP úeet !"Jmeno(playerid),Jmeno(ID));
        
dini_Remove(file);
        
SCMTA(0xFF0000AAstring);
    }
    
vip[ID] = level;
    return 
true;



My code in ini:

PHP Code:

CMD:setvip(playeridparams[])
{
    new 
string[128],ID,DEN;
    new 
vlvl;
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid,WHITE ,"Pouze Hlavní Administrátor poihlášený poez Rcon muže nastavit VIP úeet !");
    if(
sscanf(params"iii"ID,vlvl,DEN)) return SendClientMessage(playerid0xFFFFFFFF"/setvip [playerid] [level] [den]");
    if(!
IsPlayerConnected(ID)) return SendClientMessage(playerid0xFFFFFFFF"ID nieje online!");
    if(
vlvl || vlvl 3) return SendClientMessage(playeridWHITE"Zlý level !");
    new 
DATE gettime()+mktime(0,0,0,DEN,0,0);

    new 
s[128];
    
format(s,sizeof(s),"VIP/%s.ini",Jmeno(ID));
    if(
vlvl 0)
    {
        if(
fexist(s)) return SendClientMessage(playeridWHITE"Tento hráe už VIP level má !");
        if(
vlvl == 1format(string128"Admin %s nastavil hráeovy %s VIP {CD7F32}BRONZE{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        else if(
vlvl == 2format(string128"Admin %s nastavil hráeovy %s VIP {C0C0C0}SILVER{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        else if(
vlvl == 3format(string128"Admin %s nastavil hráeovy %s VIP {FFD700}GOLD{FF0000} úeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
        
PlayerInfo[playerid][RemoveTime] = DATE;
        print(
"If the server now falls, problem is box (VIP)");
        new 
INI:File INI_Open(s);
        
INI_WriteInt(File,"Time",PlayerInfo[ID][VIP] = DATE);
        
INI_WriteInt(File,"VIP",PlayerInfo[ID][VIP] = vlvl);
        
INI_Close(File);
        
SendClientMessageToAll(0xFF0000AAstring);
    }
    else if(
vlvl == 0)
    {
        if(!
fexist(s)) return SendClientMessage(playeridWHITE"Tento hráe nemá VIP level!");
        
format(stringsizeof(string), "Hlavný Administrátor %s zobral hráeovy %s VIP úeet !"Jmeno(playerid),Jmeno(ID));
        
SendClientMessageToAll(0xFF0000AAstring);
        new 
INI:File INI_Open(s);
        
INI_WriteInt(File,"VIP",PlayerInfo[ID][VIP] = 0);
        
INI_Close(File);
    }
    
PlayerInfo[ID][VIP] = vlvl;
    return 
true;


My code text is language Slovak :)
Please help me.. :)

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>