Character System problem... 1 - 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: Character System problem... 1 (
/showthread.php?tid=529749)
Character System problem... 1 -
alanhutch - 03.08.2014
Hi all...
I've created a Character System in my server...
Name appears like number in .ini file.
It's all ok, but when you insert your name like "Alan_Hutch" it appears correctly in the dialog, but in the .ini file appears like a number... (I insert Alan_Hutch and it appears 82)
Here's the code
pawn Код:
//under pInfo
pNomePersonaggio1[64],
//in dialogresponse
strcpy(PlayerInfo[playerid][pNomePersonaggio1], inputtext, 64);
OnPlayerSave(playerid);
//OnPlayerConnect
PlayerInfo[playerid][pNomePersonaggio1] = 0;
//OnPlayerRegister
format(var, 32, "NomePersonaggio1=%d\n",PlayerInfo[playerid][pNomePersonaggio1]);fwrite(hFile, var);
//OnPlayerSave
format(var, 32, "NomePersonaggio1=%d\n",PlayerInfo[playerid][pNomePersonaggio1]);fwrite(hFile, var);
//OnPlayerLogin
if( strcmp( key , "NomePersonaggio1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pNomePersonaggio1] = strvalEx( val ); }
Thank you guys in advance.
Re: Character System problem... 1 -
[XST]O_x - 03.08.2014
pawn Код:
format(var, 32, "NomePersonaggio1=%s\n",PlayerInfo[playerid][pNomePersonaggio1]);fwrite(hFile, var);
%d - integer
%s - string
Re: Character System problem... 1 -
alanhutch - 03.08.2014
Thanks man, I have really forgot that...