id 0 bug ?
#1

hey guys i have this command that answears to players report, but it has a bug at id 0 if any other id it's getting an answear from a helper and player who get the answear have id 1+ it's ok but if that player is id 0 he will get the message but helper will receive a message "unknown command" idea?

Код HTML:
CMD:nre(playerid, params[])
{
	new message[500 + 1], nstring[500 + 1];
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
	if(PlayerInfo[playerid][pTwinPixSecurity] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai acces la aceasta comanda!");
	if(PlayerInfo[playerid][pHelper] < 1) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
	if(HelperAnswer[playerid] == -1) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai primit o intrebare.");
	if(sscanf(params,"s[164]", message)) return SendClientMessage(playerid, COLOR_SYN,"Sintaxa:{FFFFFF} /nre <raspuns>");
	{
		    PlayerInfo[playerid][pStaffPoints]++;
			Update(playerid, pStaffPointsx);
			Questions--;
			UpdateStaffTextdraw();

			format(gString, sizeof(gString), "(N - A) Helper %s: @%s, %s", GetName(playerid),GetName(HelperAnswer[playerid]), message);
			new string2[500 + 1];
			if(strlen(gString) > 120)
			{
				strmid(string2, gString, 110, 256);
				strdel(gString, 110, 256);

				format(gString,128,"%s ...",gString);
				format(string2,128,"... %s",string2);
			}

			foreach(new x : Player)
		    {
				if(NewbieEnabled[x] == 1)
				{
                    format(nstring, sizeof(nstring), "(N - Q) Newbie %s: %s", GetName(HelperAnswer[playerid]),PlayerInfo[HelperAnswer[playerid]][pNewbie]);
					SendClientMessage(x,COLOR_YELLOW, nstring);

					if(strlen(gString) > 120)
					{
						SendClientMessageToAll(COLOR_NOB, gString);
						SendClientMessageToAll(COLOR_YELLOW, string2);
					}
					else
					{
						SendClientMessage(x,COLOR_NOB, gString);
					}
				}

                if(HelperAnswer[x] == playerid)
				{
				    format(PlayerInfo[x][pNewbie],164," ");
				    HelperAnswer[x] = -1;
				    foreach(new i : Player)
		    		{
				    	HelperAnswer[i] = -1;
				    }
				}

				if(strlen(PlayerInfo[x][pNewbie]) > 1 && HelperAnswer[x] == -1)
			    {
                    format(gString, sizeof(gString), "(Question) %s - lvl %d: %s", GetName(x), PlayerInfo[x][pLevel], PlayerInfo[x][pNewbie]);
					SendClientMessage(playerid, COLOR_NEWBIE, gString);
					HelperAnswer[x] = playerid;
					HelperAnswer[playerid] = x;
					format(gString, sizeof(gString), "Intrebarea ta a fost atribuita helperului %s, te rugam sa astepti raspunsul acestuia.", GetName(HelperAnswer[playerid]));
    				SendClientMessage(x,COLOR_NOB,gString);
					SendClientMessage(x,COLOR_NOB,"Chat-ul (/n)ewbie a fost activat automat. Dupa ce primesti un raspuns il poti dezactiva (/nonewbie)");
					break;
			    }
			}
	}
	return 1;
}
Reply
#2

Which version of sscanf are you using? Is it 2.8.2?
Reply
#3

yes man
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)