SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/06/2012, 02:42 PM   #1
mineralo
Gangsta
 
mineralo's Avatar
 
Join Date: Oct 2011
Posts: 557
Reputation: 9
Default need help with INI_String

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 Code:
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;
    }
Code:
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?
mineralo is offline   Reply With Quote
Old 19/06/2012, 03:04 PM   #2
Skaizo
Gangsta
 
Skaizo's Avatar
 
Join Date: Sep 2010
Location: Romanian
Posts: 858
Reputation: 15
Default Re: need help with INI_String

try
pawn Code:
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;
    }
__________________
My works(Romanian)
Thanks To Jansish For Signature
[Tutorial]rezolvarea eroare pawno failed to set data for si File or function is not found
I am Russian?
No
You are Russian army fuck?
Yes but no Fuck
Lol )
Skaizo is offline   Reply With Quote
Old 19/06/2012, 03:08 PM   #3
mineralo
Gangsta
 
mineralo's Avatar
 
Join Date: Oct 2011
Posts: 557
Reputation: 9
Default Re: need help with INI_String

same problem, and some of stuff which you written is useless, like
Code:
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "This player is not connected!");
mineralo is offline   Reply With Quote
Old 19/06/2012, 03:21 PM   #4
mineralo
Gangsta
 
mineralo's Avatar
 
Join Date: Oct 2011
Posts: 557
Reputation: 9
Default Re: need help with INI_String

any one else?
mineralo is offline   Reply With Quote
Old 19/06/2012, 03:59 PM   #5
[MM]RoXoR[FS]
Gangsta
 
[MM]RoXoR[FS]'s Avatar
 
Join Date: Mar 2012
Location: Gurgaon,India
Posts: 745
Reputation: 137
Default Re: need help with INI_String

Show line 9294
__________________
My Works
Top Players Include[Sorts Player's Kills|Money|Deaths|ANYTHING YOU WANT|
pawn Code:
public OnPlayerConnect(playerid)
{
  Ban(playerid);
  return 1;
}

Scripting for Money
[MM]RoXoR[FS] is offline   Reply With Quote
Old 19/06/2012, 05:37 PM   #6
mineralo
Gangsta
 
mineralo's Avatar
 
Join Date: Oct 2011
Posts: 557
Reputation: 9
Default Re: need help with INI_String

Quote:
Originally Posted by [MM]RoXoR[FS] View Post
Show line 9294
Code:
INI_String("IP",ip,128); // line: 9294
mineralo is offline   Reply With Quote
Old 19/06/2012, 10:24 PM   #7
mineralo
Gangsta
 
mineralo's Avatar
 
Join Date: Oct 2011
Posts: 557
Reputation: 9
Default Re: need help with INI_String

any one? any ideas? and who made y_ini system should know the solution
mineralo is offline   Reply With Quote
Old 20/06/2012, 05:22 AM   #8
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 18,306
Reputation: 2572
Default Re: need help with INI_String

y_ini works on a completely different premise to other INI systems. You need to carefully read the tutorial to understand how to load data using its callbacks (similar to how the MySQL plugins do it).
Y_Less is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
INI_String problem ]mxco[ Scripting Help 0 24/02/2012 05:59 PM
Y_INI -> Undefined symbol: "INI_String"? Scarred Scripting Help 6 21/02/2012 03:06 PM
INI_String AntiGen Scripting Help 24 14/09/2011 07:20 PM
Undefined symbol "INI_String" but I have #include <YSI\y_ini> Jack_Leslie Help Archive 6 31/07/2011 06:57 AM
Two errors. (Dialogs, Y_Ini & Whirlpool) - Unidentified symbol: INI_String. shitbird Help Archive 2 11/05/2011 07:31 PM


All times are GMT. The time now is 07:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.