Getting a string with dini?
#1

I found out how to set a string (dini_Set) but how can I recieve a string from a file?
Код:
PlayerInfo[playerid][Nick] = dini_Get(file, "Nick");
gives me this error:
Quote:

C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(243) : error 006: must be assigned to an array

PlayerInfo[playerid][Nick] = dini_Str(file, "Nick"); gives me this error:
Quote:

C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(243) : error 017: undefined symbol "dini_Str"

Reply
#2

In your PlayerInfo enum, you should declare Nick as "Nick[256]".
And there no function like "dini_str".
Reply
#3

Quote:

C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(243) : error 047: array sizes do not match, or destination array is too small

Reply
#4

it would be MAX_STRING (255) but there is no reason to make it so big

pawn Код:
strmid(PlayerInfo[playerid][Nick], dini_Get(file, "Nick"), 0, MAX_PLAYER_NAME);
Reply
#5

Now I've got this:
Код:
	if(strcmp(cmd, "/stats", true) == 0)
	{
  	    new string[128];
	 	format(string, sizeof(string), "Stats of %s (%s)", GetPlayerName(playerid), PlayerInfo[playerid][Nick]);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
And I get these:
Quote:

C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(259) : warning 202: number of arguments does not match definition
C:\Users\James\Desktop\SAMP\gamemodes\dm.pwn(259) : warning 202: number of arguments does not match definition

Reply
#6

Код:
	if(strcmp(cmd, "/stats", true) == 0)
	{
  	    new string[128],name[MAX_PLAYER_NAME];
        GetPlayerName(playerid,name,sizeof(name));
	 	format(string, sizeof(string), "Stats of %s (%s)", name, PlayerInfo[playerid][Nick]);
		SendClientMessage(playerid, COLOR_WHITE, string);
	}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)