SA-MP Forums Archive
Random Character Assignment - Y_INI - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Character Assignment - Y_INI (/showthread.php?tid=278617)



Random Character Assignment - Y_INI - Kush - 23.08.2011

For some reason, y_ini seems to be returning my strings as values, or simply creating random assignments of characters. I would save my string into a file, but instead of saving the formatted text as "Test", it would save as "*", "." or "E". Anymore information will be provided.


Re: Random Character Assignment - Y_INI - Bakr - 23.08.2011

Post the code where you save the information into the file and we may be able to help.


Re: Random Character Assignment - Y_INI - Kush - 23.08.2011

PHP Code:
enum gInfo
{
    
Test[128]
}
new 
gVar[MAX_PLAYERS][gInfo];
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_String("Test",gVar[playerid][Test], 128);
     return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
INI:File INI_Open(Userpath(playerid));
    
INI_SetTag(File,"data");
    
INI_WriteString(File,"Test"gVar[playerid][Test]);
    
INI_Close(File);
}
YCMD:test(playeridparams[], help)
{
    
#pragma unused help
    #pragma unused params
    
new string[128];
    
format(stringsizeof(string), "Testing...");
    
gVar[playerid][Test] = strlen(string);
    return 
1;

From the file.
PHP Code:
Test = * 



Re: Random Character Assignment - Y_INI - Kush - 23.08.2011

Quote:
Originally Posted by Y_Less
View Post
What is "gTest"? This looks like an issue of you saving the wrong variables, not anything y_ini has done!
Nothing I'll blame y_ini for, thats for sure! My apologies, I've written this up quickly. But yea, I've checked my code and even re-done it and still gives a random character assignment! It now saves as "[]". Tell me y_less, what's the problem here?


Re: Random Character Assignment - Y_INI - PrawkC - 23.08.2011

Just curious.. in your test command why do you want to set a string to an integer ?

gVar[playerid][Test] = strlen(string);

Making the string equal to the length of the string..