Problem with string
#1

the problem is on the Owner %s it doesn't show the name... it only shows "Owner: ||"

Код:
new string[256], id, slots, name[256];
name = dini_Int(dat, "Name");
id = dini_Int(dat, "ID");
slots = dini_Int(dat, "Slots");
format(string, sizeof(string), "Owner: %s || Vehicle Slots: %d || House ID: %d", name, slots, id);
SendClientMessage(playerid, ORANGE, string);
Reply
#2

You cannot assign a value to a string with '='. You need to use format or strmid with it.
And while we're at it, you might want to read this topic as-well: https://sampforum.blast.hk/showthread.php?tid=55261
Reply
#3

so how to fix it?...
Код:
new string[256], id, slots, name[20];
format(name, sizeof(name), "%s", dini_Int(dat, "Name"));
id = dini_Int(dat, "ID");
slots = dini_Int(dat, "Slots");
format(string, sizeof(string), "Owner: %s || Vehicle Slots: %d || House ID: %d", name, slots, id);
SendClientMessage(playerid, ORANGE, string);
that works neither... however I guess what I just did was kinda stupid...
Reply
#4

Quote:
Originally Posted by Sascha
Посмотреть сообщение
so how to fix it?...
Код:
new string[256], id, slots, name[20];
format(name, sizeof(name), "%s", dini_Int(dat, "Name"));
id = dini_Int(dat, "ID");
slots = dini_Int(dat, "Slots");
format(string, sizeof(string), "Owner: %s || Vehicle Slots: %d || House ID: %d", name, slots, id);
SendClientMessage(playerid, ORANGE, string);
that works neither... however I guess what I just did was kinda stupid...

Yes you need to use strmid + for strings use "dini_get " not "dini_int"..
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)