Free /AKA command (in return for assistance)
#1

Can any scripting wizards out there help me figure out why my AKA system stops writing to the txt file after the file reaches 65 lines?
When I clear the txt file, it writes and works perfectly in-game. But after a while of using it on my server it suddenly stops writing new information to the file and becomes essentially useless

I'm not 100 percent sure that the 65 lines is the condition which causes it to stop writing or whether its something unrelated to the amount of lines in the text file, but the text file is currently at 65 lines and no more data will write to it through the aka function

There's probably something obvious I've missed here but would really appreciate if somebody here could point out what could be causing the problem

OnPlayerConnect:
Код:
new Tmp3[50];

	GetPlayerIp(playerid,Tmp3,50);

	if(strlen(dini_Get("Aka.txt", Tmp3)) == 0)
	dini_Set("Aka.txt", Tmp3, PlayerInfo[playerid][pName]);
 	else
	{
	    if(strfind( dini_Get("Aka.txt", Tmp3), PlayerInfo[playerid][pName], true) == -1 )
		{
  		format(string,sizeof(string),"%s, %s", dini_Get("Aka.txt",Tmp3), PlayerInfo[playerid][pName]);
	   	dini_Set("Aka.txt", Tmp3, string);
        }
    }
COMMAND:aka (obviously change the arrays and textdraw display for the ones used by your script)
Код:
COMMAND:aka(playerid,params[])
{
		if(PlayerInfo[playerid][pSpawned] == 1)
		{
        if(PlayerInfo[playerid][pAdminlevel] > SERVER_MODERATOR)
        {
        new TargetID;
        new string[256], pIP[50];

		if(sscanf(params,"u",TargetID))
		{
		SendClientMessage(playerid,COLOR_ERROR,"Usage: /aka (Name/ID)");
		return 1;
		}

		if(!IsPlayerConnected(TargetID) || TargetID == INVALID_PLAYER_ID)
	    {
	    SendClientMessage(playerid, COLOR_ERROR, "That Player Is Not Connected.");
	    return 1;
	    }

		if(IsPlayerNPC(TargetID))
	    {
    	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Check Aka For a BOT.");
    	return 1;
    	}
    	
		if(PlayerInfo[playerid][pAdminlevel] < PlayerInfo[TargetID][pAdminlevel])
	    {
    	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Check The Aka Of Higher Admins.");
    	return 1;
    	}

 	    GetPlayerIp(TargetID,pIP,50);

        HideTextDrawMenu(playerid);
        ShowTextDrawMenu(playerid, TD_MENU_INFO,"~b~Player's Aka", 7, 0);
        format(string, sizeof(string), "~g~%s (%d)'s Aka~n~~n~~b~IP: ~p~%s~n~~b~Names:~n~~p~%s",PlayerInfo[TargetID][pName],TargetID, pIP, dini_Get("Aka.txt",pIP));
        ShowTextDrawMenuItems(playerid, 0, string, " ", " ",0);
        }else{
        SendClientMessage(playerid,COLOR_ERROR,""ERROR_MSG"");
        }
        }else{
        SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While You're Dead.");
        }
	    return 1;
}
As usual, feel free to use this system for yourself or your own server if youre looking for a simple AKA system, just of course adjust the arrays and textdraw display to fit the ones in your gamemode!
Reply


Messages In This Thread
Free /AKA command (in return for assistance) - by Ducati - 01.05.2018, 14:08
Re: Free /AKA command (in return for assistance) - by Ducati - 02.05.2018, 06:09
Re: Free /AKA command (in return for assistance) - by andrejc999 - 02.05.2018, 07:40
Re: Free /AKA command (in return for assistance) - by Ducati - 03.05.2018, 12:31
Re: Free /AKA command (in return for assistance) - by jasperschellekens - 03.05.2018, 12:38

Forum Jump:


Users browsing this thread: 1 Guest(s)