zcmd and sscanf problem
#1

Код:
CMD:pm(playerid, params[])
{
	new str[128], str2[128], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
	if(sscanf(params, "us", id, str2))
	{
	    SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id/name> <message>");
		return 1;
	}
	if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: That player is not connected!");
	if(playerid != id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
	GetPlayerName(playerid, Name1, sizeof(Name2)); //The Sender's Name so we use (playerid).
	GetPlayerName(id, Name2, sizeof(Name2)); //The Receiver's Name so we use (id).
	format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
	SendClientMessage(playerid, 0xFF0000FF, str);
	format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
	SendClientMessage(id, 0xFF0000FF, str);
 	return 1;
}
theres my code, but why doesnt it work when i type /pm it returns unknown command
am i suppose to put something under onplayercommand if so, what? nobody mentioned doing anything in the tutorials
Reply


Messages In This Thread
zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:24
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:31
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:32
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 21:35
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 21:37
Re: zcmd and sscanf problem - by FreshKilla - 23.08.2010, 21:40
Re: zcmd and sscanf problem - by [L3th4l] - 23.08.2010, 21:43
Re: zcmd and sscanf problem - by mrcoolballs - 23.08.2010, 21:45
Re: zcmd and sscanf problem - by nemesis- - 23.08.2010, 22:08
Re: zcmd and sscanf problem - by Sky4D - 23.08.2010, 22:10

Forum Jump:


Users browsing this thread: 2 Guest(s)