need help with INI_String
#1

well, at moment I use y_ini system of saving stuff, I wanted make a simple ban and unban system for my server but when I want to unban ip from rcon cmd I get 2 error of getting the ip
pawn Код:
if(strcmp(cmd,"/unban",true) == 0)
    {
        new string[256],ip[128];
        if(GetPlayerAdminz(playerid) < 1) return 0;
        new length = strlen(cmdtext);
        while ((idx < length) && (cmdtext[idx] <= ' '))
        {
        idx++;
        }
        new offset = idx;
        new result[256];
        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
        {
        result[idx - offset] = cmdtext[idx];
        idx++;
        }
        result[idx - offset] = EOS;
        if(!strlen(result))return SendClientMessage(playerid, COLOR_WHITE, "( ! ) /unban (name)");
        if(fexist(result))
        {
        new INI:File = INI_Open(result);
        INI_String("IP",ip,128); // line: 9294
        INI_Close(File);
        format(string,sizeof(string),"unbanip %s",ip);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
        format(string,sizeof(string),"( ! ) %s has been unbanned by %s.",result,PlayerName(playerid));
        MessageToAdmins(COLOR_RED,string);
        }
        else
        {
        scm(playerid,c_r,"( ! ) This player not exist !");
        }
        return 1;
    }
Код:
D:\Programs\proecte ne terminate\samp\gamemodes\rpg.pwn(9294) : error 017: undefined symbol "name"
D:\Programs\proecte ne terminate\samp\gamemodes\rpg.pwn(9294) : error 017: undefined symbol "value"
the line get error that of INI_String
any one know what its wrong?
Reply
#2

try
pawn Код:
if(strcmp(cmd,"/unban",true) == 0)
    {
        new string[256], ip[128], result[128], unban[128];
        if(!IsPlayerConnect(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "This player is not connected!");
        if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "You are not authorized to use this command!");
        if(!strlen(result))return SendClientMessage(playerid, COLOR_WHITE, "( ! ) /unban (name)");
        if(sscanf(params, "s[128]", unban)) return SendClientMessage(playerid, COLOR_WHITE, "CMD: /unban [Full Player Name]");
        if(fexist(result))
        {
        new INI:File = INI_Open(result);
        INI_String("IP",ip,128); // line: 9294
        INI_Close(File);
        format(string,sizeof(string),"unbanip %s",ip);
        SendRconCommand(string);
        SendRconCommand("reloadbans");
        format(string,sizeof(string),"( ! ) %s has been unbanned by %s.",result,PlayerName(playerid));
        MessageToAdmins(COLOR_RED,string);
        }
        return 1;
    }
Reply
#3

same problem, and some of stuff which you written is useless, like
Код:
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "This player is not connected!");
Reply
#4

any one else?
Reply
#5

Show line 9294
Reply
#6

Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Show line 9294
Код:
INI_String("IP",ip,128); // line: 9294
Reply
#7

any one? any ideas? and who made y_ini system should know the solution
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)