Line removing problem
#3

Quote:
Originally Posted by Threshold
Посмотреть сообщение
I tested it, and it works fine.

Although I can only recommend changing this part:
pawn Код:
new pname[24];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME); // The name of the player
    fremoveline("passed.ini", pname);
EDIT:
All so, make sure the name in the file and the player's name are case sensitive. Otherwise, you can change the 'strfind' line to this:
pawn Код:
if( strfind( szTmp, line, true ) == -1 )
Didnt work :/

here is the full rework of the code tell me why its not working :
Код:
if(GetPVarInt(playerid, "Denied") == 1 && PlayerInfo[playerid][pPosted] == 1)
{
	new playerName[24], Reason[128];
	new str[128], pname[24];
	GetPlayerName(playerid, pname, MAX_PLAYER_NAME); // The name of the player
	format(str, sizeof(str), "%s\r\n", pname); // format
	new File:handle = fopen("passed.ini", io_append);
	if(handle)
	{
		while(fread(handle, str))
		{
			if(strcmp(string, pname, false, strlen(pname))==0)
			{
				fremoveline("passed.ini", str);
			}
		}
		fclose(handle);
	}
	format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
	DOF2_RemoveFile(string);
	KickEx(playerid);
}
It doesn't remove the player name from the file!
Reply


Messages In This Thread
Line removing problem - by maximthepain - 09.07.2015, 11:34
Re: Line removing problem - by Threshold - 09.07.2015, 12:13
Re: Line removing problem - by maximthepain - 09.07.2015, 18:42
Re: Line removing problem - by Threshold - 10.07.2015, 06:13
Re: Line removing problem - by maximthepain - 11.07.2015, 09:40
Re: Line removing problem - by Threshold - 11.07.2015, 10:59
Re: Line removing problem - by maximthepain - 11.07.2015, 12:39

Forum Jump:


Users browsing this thread: 1 Guest(s)