[HELP] Y_ini reading a string - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Y_ini reading a string (
/showthread.php?tid=425173)
[HELP] Y_ini reading a string -
Saw® - 24.03.2013
pawn Код:
// parts of my script
new INI:File = INI_Open(UserPath(playerid));
new string[200];
INI_String(File,"AdminBan");
INI_String(File,"Reason");
the problem is when compiling I get Tag Mismatch error.
explaination:
I have a ban command that save The admin + reason of ban , but when connecting I wanna get all the saved strings when a player is banned.
what heppen?:
/ban then the admin+reason are saved in player's ini file , but when he connect I wanna get the saved admin & reason string ... how to do it ?
Re: [HELP] Y_ini reading a string -
Saw® - 24.03.2013
Explaining more...
Tried this & keep TagMismach:
pawn Код:
new INI:File = INI_Open(UserPath(playerid));
new string[200];
format(string, sizeof(string), "Admin: %s\nReason: %s",INI_String(File,"AdminBan"),INI_String(File,"Reason"));
NB: The AdminBan+Reason are saved when the player is banned so I don't know how to load them....
Код:
C:\Documents and Settings\Administrateur\Bureau\Mrich's CnR\gamemodes\CnR.pwn(209) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrateur\Bureau\Mrich's CnR\gamemodes\CnR.pwn(209) : error 035: argument type mismatch (argument 1)
C:\Documents and Settings\Administrateur\Bureau\Mrich's CnR\gamemodes\CnR.pwn(209) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Administrateur\Bureau\Mrich's CnR\gamemodes\CnR.pwn(209) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
EDIT
I think guys u didn't understand , I only want how to get a s aved string using y_ini
pawn Код:
INI_String("Reason",reason,70);
is correct ? don't think so , cuz it will not know what is the player's file...
Re: [HELP] Y_ini reading a string -
Saw® - 25.03.2013
small UP..
Re: [HELP] Y_ini reading a string -
Saw® - 25.03.2013
Thank you for coming , yea I read it but didn't understand this part :
pawn Код:
INI:myini[](name[], value[]) // this is from ****** tutorial about Y_ini
{
INI_String("a", gA, len_of_gA);
INI_String("b", gB, len_of_gB);
INI_String("c", gC, len_of_gC);
return 0; // This is now required.
}