Random Character Assignment - Y_INI
#1

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.
Reply
#2

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

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 = * 
Reply
#4

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?
Reply
#5

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..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)