08.05.2014, 05:41
So I'm trying to write a string (And compare later on.) to a file. The file is a players title. For some reason, all I'm getting in the players file is "Title = " no string is written inside. Can you spot the issue here?
pawn Код:
//A dialog option.
if(dialogid == UCP_TITLE)
{
if(!response) return ShowPlayerDialog(playerid, UCP_MAIN, DIALOG_STYLE_LIST, "User Control Panel", "Change Title\nSpawn Personal Vehicle\n", "Select", "Cancel");
if(listitem == 0) //hunter title 10 karma
{
if(GetPlayerScore(playerid) < 10) return SCM(playerid,COLOR_GREY, "[ERROR]: This title is 10 karma.");
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file, "Player Data");
INI_WriteString(file, "Title", "Hunter");
INI_Close(file);
SaveAccount(playerid);
SCM(playerid, COLOR_LIGHTBLUE, "Title changed to: Hunter");
return 1;
}
//When they speak with the title. Under onplayertext
if(strcmp(pInfo[playerid][pTitle], "Hunter", true))
{
new string[200];
format(string,sizeof(string), "{3737FF}[Hunter]{FFFFFF}%s: %s", GetName(playerid), text);
SCMA(COLOR_WHITE, string);
return 0;
}