What am I doing wrong ?
#3

Quote:
Originally Posted by bijoyekuza
Посмотреть сообщение
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    dcmd(ban, 3, cmdtext);
	dcmd_ban(playerid, params[])
	{
	new pName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pName, sizeof(pName));
	if(!IsPlayerAdmin(playerid)) return 0;
	new targetid, reason[64], string[128];
	if(sscanf(params, "uz", targetid, reason)) return SendClientMessage(playerid, COLOR_RED, "Usage: /ban [playerid/partofname] [reason]");
	if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Player not connected or is yourself!");
	format(string, sizeof(string), "%s has been banned (Reason: %s)",pName, reason);
	SendClientMessageToAll(COLOR_RED, string); // Sending the string to all
	Ban(targetid);
	}
}
dcmd_ban should not be it OnPlayerCommandText, but below it
Reply


Messages In This Thread
What am I doing wrong ? - by bijoyekuza - 21.03.2011, 10:36
Re: What am I doing wrong ? - by Mike Garber - 21.03.2011, 11:09
Re: What am I doing wrong ? - by airsoft - 21.03.2011, 11:11
Re: What am I doing wrong ? - by ricardo178 - 21.03.2011, 14:00
AW: What am I doing wrong ? - by Pablo Borsellino - 21.03.2011, 14:35

Forum Jump:


Users browsing this thread: 1 Guest(s)