Help Command
#1

So,I have a problem,I do not know how can make an error. If a player send a message to admins,and the admin use command to solve him problem,and write another id,work,but it should not.

Here can see what is wrong,there show id 0,if I write id 1,work,and should not to work...

Ph: https://imgur.com/PZoe6Uj, https://imgur.com/PZoe6Uj

CMD:
Код HTML:
CMD:answer(playerid, params[])
{
	new Player; eString[0] = EOS; new LittleCount[10];
	//--------------------------------------------------------------------------
	if(CosminInfo[playerid][Level] < 3) return SendError2(playerid, "{E4EDF4}You must to be Admin Level 3 to use that command", "{E4EDF4}Trebuie sa fi Admin Level 3 pentru a folosi comanda respectiva");
    if(sscanf(params, "uS[250]", Player, ReqeStr)) return SendUsage(playerid, "/answer [ID]");
	if(Player == INVALID_PLAYER_ID) return SendError2(playerid, "{E4EDF4}Player is not connected", "{E4EDF4}Jucatorul nu este conectat");
	if(ServerInfo[ServerReports] == 0) return SendError2(playerid, "{E4EDF4}This player has not been having a problem", "{E4EDF4}Acest jucator nu a cerut ajutor");
	//--------------------------------------------------------------------------
	new Str[2500];
	if(CosminInfo[playerid][Language] 	   == 1) format(Str, sizeof(Str), "{3399FF}HELP REQUEST: {F81414}%s {E4EDF4}ti-a raspuns la problema", PlayerName(playerid));
	else if(CosminInfo[playerid][Language] == 0) format(Str, sizeof(Str), "{3399FF}HELP REQUEST: {F81414}%s {E4EDF4}has answered the problem", PlayerName(playerid));
	SendClientMessage(CosminInfo[Player][ReportedByy], -1, Str);
	//--------------------------------------------------------------------------
	ServerInfo[ServerReports]--; CosminInfo[Player][ReportedBy] = -1; format(ReqeStr, sizeof(ReqeStr), "%s", eString);
	//--------------------------------------------------------------------------
	format(LittleCount, 10, "%i", ServerInfo[ServerReports]);
	//--------------------------------------------------------------------------
	format(LittleCount, 10, "%i", ServerInfo[ServerReports]); TextDrawSetString(ReportInfo[1], LittleCount);
	//--------------------------------------------------------------------------
    foreach(new l: Player) if(CosminInfo[l][Level] >= 3)
	{
	    if(ServerInfo[ServerReports] == 0)      TextDrawHideForPlayer(l, ReportInfo[0]), TextDrawHideForPlayer(l, ReportInfo[1]);
	    else                                    TextDrawShowForPlayer(l, ReportInfo[0]), TextDrawShowForPlayer(l, ReportInfo[1]);
	}
	//--------------------------------------------------------------------------
	format(eString, sizeof(eString), "{3399FF}[ADMIN]: {F81414}%s {3399FF}has solved help request of the player {F81414}#%s", PlayerName(playerid), PlayerName(Player)); MessageToAdmins(COLOR_YELLOW, eString);
	//--------------------------------------------------------------------------
 	return 1;
}
Reply
#2

First, why are you seting first array element to null, and as second, I don't understand you. Can you try to explain better so we could understand you, please?
Reply
#3

So,a player use /hmessage for help,and the comand /answer is for answer on him problem,but,if I write ex:"/answer 1" work,but should not. Command /answer do not work if the ID is not on the player what report a problem,do you understand?
Reply
#4

Код:
    foreach(new l: Player) if(CosminInfo[l][Level] >= 3)
	{
	    if(ServerInfo[ServerReports] == 0)      TextDrawHideForPlayer(l, ReportInfo[0]), TextDrawHideForPlayer(l, ReportInfo[1]);
	    else                                    TextDrawShowForPlayer(l, ReportInfo[0]), TextDrawShowForPlayer(l, ReportInfo[1]);
	}
What is the purpose of this? You should also formalize your code into a more readable fashion so that you can easily spot where the problem is.
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Код:
    foreach(new l: Player) if(CosminInfo[l][Level] >= 3)
	{
	    if(ServerInfo[ServerReports] == 0)      TextDrawHideForPlayer(l, ReportInfo[0]), TextDrawHideForPlayer(l, ReportInfo[1]);
	    else                                    TextDrawShowForPlayer(l, ReportInfo[0]), TextDrawShowForPlayer(l, ReportInfo[1]);
	}
What is the purpose of this? You should also formalize your code into a more readable fashion so that you can easily spot where the problem is.
It no longer matters,that hide a textdraw when a admin solve one of the reports..
Reply
#6

Код:
	format(LittleCount, 10, "%i", ServerInfo[ServerReports]);
	//--------------------------------------------------------------------------
	format(LittleCount, 10, "%i", ServerInfo[ServerReports]); TextDrawSetString(ReportInfo[1], LittleCount);
So why are you formating string and doing nothing, then again formating the SAME string and seting the textdraw string? Arange the code little better, and learn to use functions in specific way that they are needed for. Because literaly I don't understand why you have code like that and you do not understand what is happening?
Reply
#7

It no longer matters,I have another problem,leave that..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)