Name won't save, help
#1

I want to save some player's name in a .ini file. It's for my faction script and I can't make it to save as text, instead it always save as a number (82).

Код:
COMMAND:setleader1(playerid, params[])
	{
		new leaderid;
	   	if(sscanf(params, "u", leaderid)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /setleader1 [playerID]");
        GetPlayerName(leaderid, FactionSFPD[playerid][fLeader], MAX_PLAYER_NAME);
		dini_IntSet(SERVER_FACTION_SFPD_FILE, "Leaderl",FactionSFPD[playerid][fLeader]);
		SendClientMessage(playerid, COLOR_YELLOW, "You are now a leader of SFPD (faction 1)");
		return 1;
	}
What am I doing wrong?
Reply
#2

Well it's quite simple, you're writing it as an integer using the dini_IntSet function. You need to use the dini_Set function for a string. Like so:

pawn Код:
dini_Set(SERVER_FACTION_SFPD_FILE, "Leaderl",FactionSFPD[playerid][fLeader]);
Reply
#3

You should add it into your register system instead of creating an own file.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)