Reading string from Dini...
#1

How can I read string from dini?

I have something like:
pawn Код:
dini_Set(file, "MobileType", "Nokia");
    PlayersMob = dini_Int(file, "MobileType");
Where PlayersMob is:
pawn Код:
Player[playerid][MobileType] = PlayersMob;
So this is called when player has got NO phone and he buys it...

And this is called when player already has a phone:
pawn Код:
format(string, sizeof(string),"You already have a phone. Your have %s and your number is %d.", PlayersMob,Player[playerid][PhoneNumber]);
    SendClientMessage(playerid, COLOR_LIGHTRED, string);
But when I'm in game and I try to buy a phone (When I already have one) I get something like:
"You already have a phone. Your have [blank] and your number is 999999."

How can I read that I have Nokia phone?
Reply
#2

Use dini_Get.
Reply
#3

that's because you use dini_int
you need dini_get
pawn Код:
PlayersMob = dini_get(file, "MobileType");
and don't forget to add [255] in new on Mobiletype
pawn Код:
new MobileType[255];
Reply
#4

OMFG!
Thanks guys.
And I just couldn't think of what am I doing wrong.
Anyways, Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)