Loop saving?
#1

Hello, I would like to know how can I loop? I did everything wrong.

PHP код:
enum pInfo2
{
    
pSenha,
    
pPersonagem1[80],
    
pPersonagem2[80],
    
pPersonagem3[80],
    
PlayerText:pTextDraws[18]
};
new 
Account[MAX_PLAYERS][pInfo2];
for (new 
019i++)
{
      
DOF2_SetInt(arquivo"TextDraws%s"iAccount[playerid][pTextDraws][i]);

Reply
#2

Dude, that's not how you create a thread in this section, read the rules and rethink your post
Reply
#3

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
Dude, that's not how you create a thread in this section, read the rules and rethink your post
Beauty, I'm just trying to clarify ideas with the community, up! How can I create this loop? Are not you saving why?


Код:
TextDraws0 = 0
TextDraws1 = 1
TextDraws2 = 2
TextDraws3 = 3
TextDraws4 = 4
TextD....
PHP код:
            for (new 019i++)
            {
                
DOF2_SetInt(arquivo"TextDraws%s"iAccount[playerid][pTextDraws][i]);
            } 
Reply
#4

How I do? It's like this, when it's time to log in the first time, log in right, show the names of the characters in the textdraws, but if I go to the scriptfiles and change the name and log back on the server without disconnecting, it's the same as before, like If I had not put a new character in the scriptfiles to be clickable in the textdraw, it shows empty or the character that had already saved in the textdraw to log in the first time, and I thought I needed to save the textdraw, but I can not save due to lack of experience.
Reply
#5

I don't completely understood what you asking but i can see one thing in your code that is you are referring string specifier %s to a integer use %d or %i

Код:
 for (new i = 0; i < 19; i++)
            {
                DOF2_SetInt(arquivo, "TextDraws%i", i, Account[playerid][pTextDraws][i]);
            }
Reply
#6

The problem is to save, not to save, why do I want to save? When I next, it shows "Empty" in the space to create character, and I go in the files and create a character, but this character appears in the textdraw only when I turn off and on again the gamemode, in the console.
Reply
#7

You were reputedly successful, 50 percent of our problem was solved, come on.


Why do I save in an enum?

Код HTML:
//enum updated:

enum pInfo2
{
	pSenha,
    pPersonagem1[80],
    pPersonagem2[80],
    pPersonagem3[80],
    PlayerText:pTextDraws[9]
};
new Account[MAX_PLAYERS][pInfo2];
I got the TextDraw system from another Mysql gamemode, so mine did a good job to convert.
In the enum loads all the TextDraw and saves in the files, I do not know what, but I put it because it was giving error when I enter, it shows "Empty" in the space to create character, and I go in the files and create a character manually, Character appears in textdraw only when I turn off the server and call again,
And I thought of leaving in enum, but I can not save the right way, in this next part;


Код HTML:
new str[40]; 

for(new i; i < 19; i ++) 
{ 
    format(str, sizeof str, "TextDraws%d", i); 

    DOF2_SetInt(arquivo, str, pTextDraws[playerid][i]); 

    DOF2_SaveFile(); 
}  
It solved half of my problem, but half of the problem is missing, the enum, I think.
The 9 textdraw are normally loaded in Onplayerconect.

Quote:

Password = pVazio
Personagem1 = Vazio
Personagem2 = Vazio
Personagem3 = Vazio
TextDraws0 = 0
TextDraws1 = 0
TextDraws2 = 0
TextDraws3 = 0
TextDraws4 = 0
TextDraws5 = 0
TextDraws6 = 0
TextDraws7 = 0
TextDraws8 = 0
TextDraws9 = 0

What part of the password is buggy? This annoying part, I already researched the wiki, nothing brings me information to make it functional.
Reply
#8

The error is in the enum in thePlayerTextTextDraw, as I do to increase add the lines correctly, nine in total...

PHP код:
enum pInfo2
{
    
pSenha,
    
pPersonagem1[80],
    
pPersonagem2[80],
    
pPersonagem3[80],
    
PlayerText:pTextDraws[9]
};
new 
Account[MAX_PLAYERS][pInfo2]; 
Reply
#9

Quote:
Originally Posted by SukMathcuck
Посмотреть сообщение
PHP код:
enum pInfo2
{
    
pSenha,
    
pPersonagem1[80],
    
pPersonagem2[80],
    
pPersonagem3[80],
    
PlayerText:pTextDraws[18]
};
new 
Account[MAX_PLAYERS][pInfo2];
for (new 
019i++)
{
      
DOF2_SetInt(arquivo"TextDraws%s"iAccount[playerid][pTextDraws][i]);

THis is to many instead "i < 18"
Reply
#10

If your problem in saving textdraws,You must save textdraws info(text,x,y,and others) separate.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)