Small problem.
#1

Okay, i have a small problem.. no errors or nothing everything is right but once you use the command it does not work well it does but it just says "Player didn't send a /helpme message or it's already answered to.", even though a question has been asked. Any solutions?

Thanks in advanced, and here is the code.


Код:
	if(strcmp(cmd, "/accepthelpme", true) == 0 || strcmp(cmd, "/ahm", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(gPlayerLogged[playerid] == 0)
	        {
	            SendClientMessage(playerid, COLOR_GREY, "   You need to login first !");
	            return 1;
	        }
	        if(PlayerInfo[playerid][pHelper] > 1)
	        {
	            tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
			    	SendHelperMessage(COLOR_WHITE, "HINT: /(a)ccept(h)elp(m)e [playerid/PartOfName]");
			    	return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				        if(JustAsked[giveplayerid] > 0)
				        {
				            JustAsked[giveplayerid] = 0;
				            GetPlayerName(playerid, sendername, sizeof(sendername));
							GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				            GiveNameSpace(sendername);
				            GiveNameSpace(giveplayer);
							format(string, sizeof(string), "Helperwarning: %s has just accepted the /helpme of [ID:%d]%s.", sendername, giveplayerid, giveplayer);
							SendHelperMessage(COLOR_YELLOW, string);
							format(string, sizeof(string), "** PL:RP Helper [ID:%d]%s has accepted your question and is now ready to assist you! Please be patience.", playerid, sendername);
							SendClientMessage(giveplayerid, 0x4D903DAA, string);
				        }
				        else
				        {
				            SendClientMessage(playerid, COLOR_GREY, "Player didn't send a /helpme message or it's already answered to.");
				            return 1;
				        }
				    }
				}
	        }
	        else
	        {
	            SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
	            return 1;
	        }
	    }
	    return 1;
	}
Reply
#2

You sure you're setting

pawn Код:
JustAsked[playerid]
Properly in the command /helpme or whatever you're using? Can't see any other reason why it would show that message every time.
Reply
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
You sure you're setting

pawn Код:
JustAsked[playerid]
Properly in the command /helpme or whatever you're using? Can't see any other reason why it would show that message every time.
Here's the /helpme command..


Код:
   if(strcmp(cmd, "/helpme", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(Mute[playerid] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				return 1;
	        }
        	if(UseHelperTimer[playerid]) return SendClientMessage(playerid,COLOR_GREY,"  You must wait 50 seconds before speaking in that channel !");
        	GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
	        GetPlayerName(playerid, sendername, sizeof(sendername));
			GiveNameSpace(sendername);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[128];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /helpme [text]");
				return 1;
			}
			format(string, sizeof(string), "Help request from %s ID:[%i]: %s", sendername, playerid, (result));
            SendHelperMessage(COLOR_ASKQ, string);
            SendHelperMessage(COLOR_GREEN, "/(a)ccept(h)elp(m)e to accept the /helpme.");
			SendClientMessage(playerid, COLOR_GREEN, "Your help request has been sent to all online helpers.");
	    }
	    return 1;
	}
Reply
#4

In /helpme cmd I can't find where you set to all online helpers JustAsked[helperid] = 1; or any other value > 0

Make a loop where you set for all online helpsers JustAsked[helperid] = 1;

and when you accept, set to all helpers JustAsked to 0, not only accepter
Reply
#5

I'll do it right away Voldermot, cheers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)