unknown command
#1

why i get unknown command ? on other server works

Код HTML:
CMD:friends(playerid, params[])
{
  	new online[1000],offline[1000],result[30],name[30],idd,mid=1,aim2[2000];
	mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `friends` WHERE `ID` = '%d' AND `Status`='1'",PlayerInfo[playerid][pSQLID]);
	new Cache: membresult = mysql_query(handle,gQuery);
	for(new i, j = cache_get_row_count (); i != j; ++i)
	{
		idd = cache_get_field_content_int(i, "FriendID");
		cache_get_field_content(i, "FriendName", result); format(name, 30, result);
		Selected1[playerid][mid] = idd;
		format(online, sizeof(online), "%s{228404}[online]{FFFFFF} %s\n",online,name);
		mid++;
	}
	cache_delete(membresult);
	mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `friends` WHERE `ID` = '%d' AND `Status`='0'",PlayerInfo[playerid][pSQLID]);
	new Cache: membresult1 = mysql_query(handle,gQuery);
	for(new i, j = cache_get_row_count (); i != j; ++i)
	{
		idd = cache_get_field_content_int(i, "FriendID");
		cache_get_field_content(i, "FriendName", result); format(name, 30, result);
		Selected1[playerid][mid] = idd;
		format(offline, sizeof(offline), "%s{BB172D}[offline]{FFFFFF} %s\n",offline,name);
		mid++;
	}
	cache_delete(membresult1);
	format(aim2,sizeof(aim2),"{F89B0E}[+] Add Friend\n%s%s",online, offline);
	ShowPlayerDialog(playerid, DIALOG_FRIENDS, DIALOG_STYLE_LIST, "Friends", aim2, "Select", "Exit");
	return 1;
}
Reply
#2

Yeh, this happens to me so often too, all I do is to update my includes and plugins
Reply
#3

yea but i don't have something to update...
Reply
#4

It happens to me too sometimes and I believe it does so when the command "crashes". It shows no error by the compiler and only way I get it working is by removing lines in the command and then re-add them function by function. Very slow way of debugging but it usually works. I also then add any database related functions last when I know the command works on everything else (unless you are running it in local as you should always).
Reply
#5

no i running in host..
Reply
#6

I had the problem exactly 1 minute ago in fact... I had a loop running out of its "allowed index" (can't remember what it is called).

I had a for-loop run an array out of its reach, so instead of going to 100, it went to 1000 because I named the declaration wrong. I named it

Код:
ArrayName[MAX_PLAYERS];
instead of:

Код:
ArrayName[MAX_WHATEVER_ELSE];
And then I had a for loop something similar to this:
Код:
for (new i = 0; i < MAX_WHATEVER_ELSE; i++)
{
    printf("%i", ArrayName[i]);
}
So since the compiler does not tell you if an array WILL go out of range you have to be careful with that. Again this is just one example of many of what can go wrong of why it says "unknown command".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)