prob with sscanf
#1

Код:
CMD:accept(playerid, params)
{
	new id,name[MAX_PLAYERS], query[128],string[128];
	if(sscanf(params,"u",id)) return SendClientMessage(playerid, red, "USAGE:/accept [id]");
	if(leader[playerid]<1) return SendClientMessage(playerid, red, "Your not a leader.");
	if(req[id] != org[playerid]) return SendClientMessage(playerid, red, "The player is not requesting to join your org.");
   	GetPlayerName(playerid, Name, sizeof(Name));
	GetPlayerName(id,name,sizeof(name));
	format(query,sizeof(query), "UPDATE ostats SET org=%d, req=0 WHERE name='%s'",org[playerid],name);
	format(string, sizeof(string), "Your application for %s has been accepted.",oname[playerid]);
	SendClientMessage(id, COLOR_ORANGE, string);
	new string1[128];
	format(string1, 128, "You have accepted %s into your organisation.",name);
	SendClientMessage(playerid, COLOR_ORANGE, string1);
	return 1;
}
argument type mismatch(argument 1)

line:
if(sscanf(params,"u",id)) return SendClientMessage(playerid, red, "USAGE:/accept [id]");
Reply
#2

The parameter "params" should be an array, but you're initializing it in the function otherwise, it should be initialized like so:

pawn Код:
CMD:accept(playerid, params[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)