[SOLVED] problem with /report.
#1

it says unknown command in-game. my code:

Код:
dcmd_report(playerid, params[])
{
	new id, text;
	new string[256],reporter[MAX_PLAYER_NAME], reportee[MAX_PLAYER_NAME];
	GetPlayerName(playerid,reporter,sizeof(reporter));
	GetPlayerName(id,reportee,sizeof(reportee));
	format(string,sizeof(string), "%s has reported %s for: %s",reporter,reportee,text);
	if(sscanf(params,"dz",id,text)) SendClientMessage(playerid,COLOR_RED,"USAGE: /report [id] [Message]");
	else
	{
    for(new i=0; i<=MAX_PLAYERS; i++)
		{
			if(IsPlayerAdmin(i) >= 10)
			{
				SendClientMessage(i, COLOR_RED, string);
			}
		}
	}
	return 1;
}
and i get no errors when i compile.

can anyone help? thanks I.A.
Reply
#2

can anyone see the problem here? cause i dont get it. please can someone help. thnx I.A.
Reply
#3

Код:
dcmd_report(playerid, params[])
{
	new id, text;
	new string[256],reporter[MAX_PLAYER_NAME], reportee[MAX_PLAYER_NAME];
	GetPlayerName(playerid,reporter,sizeof(reporter));
	GetPlayerName(id,reportee,sizeof(reportee));
	format(string,sizeof(string), "%s has reported %s for: %s",reporter,reportee,text);
	if(sscanf(params,"dz",id,text)) SendClientMessage(playerid,COLOR_RED,"USAGE: /report [id] [Message]");
	else
	{
    for(new i=0; i<=MAX_PLAYERS; i++)
		{
			if(IsPlayerAdmin(i) == 1)
			{
				SendClientMessage(i, COLOR_RED, string);
			}
		}
	}
	return 1;
}
Reply
#4

i tied that, it gives me no errors but when i get in-game it says "unknown command" ..........
Reply
#5

ok, i found 1 problem, i had dcmd(report,5[instead of 6],cmdtext) so i changed it, now when i go in-game, it shows th "USAGE" message i scripted, but wen i use the cmd the right way it says inknown command...

i put

Код:
new id;
new text;
instead of:
Код:
new id, text;
Thanks for the help tho.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)