06.12.2017, 19:27
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:
My code in ini:
My code text is language Slovak
Please help me..
When I enter the command /setvip, I turn off the server and I'm still crashing the game
Original code:
PHP код:
dcmd_setvip(playerid, params[])
{
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(playerid, 0xFFFFFFFF, "Neisi admin !");
if(sscanf(params, "iii", ID,level,DEN)) return SCM(playerid, 0xFFFFFFFF, "/setvip [playerid] [level] [den]");
if(!IsPlayerConnected(ID)) return SCM(playerid, 0xFFFFFFFF, "ID nieje online!");
if(level < 0 || level > 3) return SCM(playerid, WHITE, "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(playerid, WHITE, "Tento hrбe uћ VIP level mб !");
format(string, sizeof(string), "Hlavnэ Administrбtor %s nastavil hrбeovy %s VIP ъeet do %s !", Jmeno(playerid),Jmeno(ID),date(DATE,1));
if(level == 1) format(string, 128, "Admin %s nastavil hrбeovy %s VIP {CD7F32}BRONZE{FF0000} ъeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
else if(level == 2) format(string, 128, "Admin %s nastavil hrбeovy %s VIP {C0C0C0}SILVER{FF0000} ъeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
else if(level == 3) format(string, 128, "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(0xFF0000AA, string);
}
else if(level == 0)
{
if(!fexist(file)) return SCM(playerid, WHITE, "Tento hrбe nemб VIP level!");
format(string, sizeof(string), "Hlavnэ Administrбtor %s zobral hrбeovy %s VIP ъeet !", Jmeno(playerid),Jmeno(ID));
dini_Remove(file);
SCMTA(0xFF0000AA, string);
}
vip[ID] = level;
return true;
}
PHP код:
CMD:setvip(playerid, params[])
{
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(playerid, 0xFFFFFFFF, "/setvip [playerid] [level] [den]");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xFFFFFFFF, "ID nieje online!");
if(vlvl < 0 || vlvl > 3) return SendClientMessage(playerid, WHITE, "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(playerid, WHITE, "Tento hrбe uћ VIP level mб !");
if(vlvl == 1) format(string, 128, "Admin %s nastavil hrбeovy %s VIP {CD7F32}BRONZE{FF0000} ъeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
else if(vlvl == 2) format(string, 128, "Admin %s nastavil hrбeovy %s VIP {C0C0C0}SILVER{FF0000} ъeet do %s !",Jmeno(playerid),Jmeno(ID),date(DATE,1));
else if(vlvl == 3) format(string, 128, "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(0xFF0000AA, string);
}
else if(vlvl == 0)
{
if(!fexist(s)) return SendClientMessage(playerid, WHITE, "Tento hrбe nemб VIP level!");
format(string, sizeof(string), "Hlavnэ Administrбtor %s zobral hrбeovy %s VIP ъeet !", Jmeno(playerid),Jmeno(ID));
SendClientMessageToAll(0xFF0000AA, string);
new INI:File = INI_Open(s);
INI_WriteInt(File,"VIP",PlayerInfo[ID][VIP] = 0);
INI_Close(File);
}
PlayerInfo[ID][VIP] = vlvl;
return true;
}
Please help me..