didn't understood y_ini reading well :(
#1

it gives me error

Код:
C:\Users\Dr.Lozer\Desktop\LOL!\filterscripts\asd.pwn(36) : error 017: undefined symbol "name"
C:\Users\Dr.Lozer\Desktop\LOL!\filterscripts\asd.pwn(36) : error 017: undefined symbol "value"
C:\Users\Dr.Lozer\Desktop\LOL!\filterscripts\asd.pwn(37) : error 017: undefined symbol "text"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
can anyone fix and explain me

code:

pawn Код:
CMD:make(playerid, params[])
{
    #pragma unused params
    new PlayerName[24]; GetPlayerName(playerid, PlayerName, 24);
    if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA,"FUCK YOU");
    new INI: file = INI_Open("SS.txt");
    INI_SetTag(file,"[Test]");
    INI_WriteString(file,"Name",PlayerName);
    INI_Close(file);
    return 1;
}

CMD:tell(playerid, params[])
{
    #pragma unused params
    new string[128],test[24];
    INI_Load("SS.txt");
    INI_String("NAME",test,24);
    format(string,128,"NAME=%s",text);
    SendClientMessage(playerid, 0xFFFFFAA,string);
    return 1;
}
Reply
#2

I guess you must add variables for those names for NAME and VALUE and TEXT to be able to use them.

new NAME, VALUE, TEXT; - OnTop of script
Reply
#3

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
I guess you must add variables for those names for NAME and VALUE and TEXT to be able to use them.

new NAME, VALUE, TEXT; - OnTop of script
code please
Reply
#4

On top of your script, do like so:
pawn Код:
new name;
new text;
new value;
Reply
#5

No no no... when they are referring to name[] and value[], they are simply the parameters required for INI_String...

The syntax is basically like this:
Код:
INI_String(name[], value, len);
Either that or you are basically required to use INI_ParseFile, as they also have these parameters, for example:
Quote:
Originally Posted by ******' y_ini tutorial
pawn Код:
INI_ParseFile(userFile, "load_user_data_%s", .bExtra = true, .extra = playerid);

public load_user_data_basic(playerid, name[], value[])
{
    INI_Float("health", gPlayerData[playerid][E_PLAYER_HEALTH]);
    INI_Int("weapon", gPlayerData[playerid][E_PLAYER_WEAPON]);
    INI_String("clan", gPlayerData[playerid][E_PLAYER_CLAN], 4);
}
As you can see, the public function used in the ParseFile, uses the parameters name[] and value[].

The third error is simply referring to the fact that you have used 'text' when instead you should have used the variable 'test', a simple mistake/typo.

pawn Код:
format(string,128,"NAME=%s",text);
Is replaced with:
pawn Код:
format(string,128,"NAME=%s",test);
As for the first two errors, just make sure you read through ******' tutorial of the y_ini system, and get to understand it better. Including...

The official y_ini topic created by ****** himself: https://sampforum.blast.hk/showthread.php?tid=175565
Or the y_ini tutorial, also created by ******: https://sampforum.blast.hk/showthread.php?pid=1138420#pid1138420
Reply
#6

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
No no no... when they are referring to name[] and value[], they are simply the parameters required for INI_String...

The syntax is basically like this:
Код:
INI_String(name[], value, len);
Either that or you are basically required to use INI_ParseFile, as they also have these parameters, for example:

As you can see, the public function used in the ParseFile, uses the parameters name[] and value[].

The third error is simply referring to the fact that you have used 'text' when instead you should have used the variable 'test', a simple mistake/typo.

pawn Код:
format(string,128,"NAME=%s",text);
Is replaced with:
pawn Код:
format(string,128,"NAME=%s",test);
As for the first two errors, just make sure you read through ******' tutorial of the y_ini system, and get to understand it better. Including...

The official y_ini topic created by ****** himself: https://sampforum.blast.hk/showthread.php?tid=175565
Or the y_ini tutorial, also created by ******: https://sampforum.blast.hk/showthread.php?pid=1138420#pid1138420
great! i only understood 50% :P

can you tell how to load player data from file??
like kills, deaths, adminlevel
Reply
#7

A good tutorial is shown here: https://sampforum.blast.hk/showthread.php?tid=273088

I can't really explain it in my own words, so I'm just giving you something to go by, as it seems easier that way for both of us. Basically, just remember to use INI_String for strings, like... a gang name or rank for example, and INI_Int for numeric values/integers like admin level, kills etc.

In the tutorial provided, try not to use udb_hash, use Whirlpool instead.
Reply


Forum Jump:


Users browsing this thread: