Getting from file
#1

So yeah, my mind is exploding with this silly little error and I just can't figure it out:

pawn Код:
new motto[128];

// dcmd command here
if (sscanf(inputtext, "s", motto))
{
    format(string, sizeof(string), "Your motto: %s", motto);
    SendClientMessageToAll(COLOR_GREY, string);
}
// end etc.

// onplayerdisconnect
dUserSet(PlayerName(playerid)).("motto",motto);
It saves yeah, but loading this motto on connect just won't work.

So, can someone give me the line of loading this motto on connect? Thanks.
Reply
#2

Anyone?
Reply
#3

Your using dini? Then it would be something like

motto = dini_Get("file.ini","Motto");
Reply
#4

Not really, I'm using DUDB and starting with dini for me might be a little tricky.

I just can't find the piece of code that loads this on connecting.
Reply
#5

Just checked my dudb inc and saw it requires dini so you should have it.


You can just #include <dini> and then the code should work. Then you can learn dini if you want to else just use dudb

But i wasn't able to find a function which did the same thing there
Reply
#6

Well I tried this,

pawn Код:
new format2[128];
format(format2,sizeof(format2),"%s.dudb",PlayerName(playerid));
motto = dini_Get(format2,"motto");
But I recieved this error:

Код:
error 047: array sizes do not match, or destination array is too small
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)