CMD warn
#6

Quote:
Originally Posted by KamalBa
Посмотреть сообщение
Код:
CMD:ac(playerid, params[])
{
 new tmp[256], playername[25], string[256];
 if (adlvl[playerid] < 1) return 0;
 if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /ac [message]");
 GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
 format(string, sizeof(string), "Admin Chat [%s] %s", playername, tmp);
 SendMessageToAdmins(COLOR_ADMIN, string);
 print(string);
 return 1;
}
This is the full code

and i added

#define SendMessageToAdmins.
How is pawno supposed to know what to make of "#define SendMessageToAdmins" you could use this;

Код:
stock SendMessageToAdmins(color, message[])
{
	for(new i = 0; i < GetMaxPlayers(); i++)
	{
		if(pData[i][Admin] > 0) // You'll have to change this to your own var
		{
			SendClientMessage(i, color, message);
		}
	}
}
Also returning 0 gives normal players the message: SERVER: Unknown Command
tmp[256] isnt needed, you can use tmp[129](i cantremember if the null cell is needed)
Reply


Messages In This Thread
CMD warn - by KamalBa - 12.06.2015, 07:55
Re: CMD warn - by bogushas - 12.06.2015, 07:58
Re: CMD warn - by JaydenJason - 12.06.2015, 07:59
Re: CMD warn - by KamalBa - 12.06.2015, 08:01
Re: CMD warn - by bogushas - 12.06.2015, 08:03
Re: CMD warn - by JaydenJason - 12.06.2015, 08:15
Re: CMD warn - by KamalBa - 12.06.2015, 09:41
Re: CMD warn - by SpaceX - 12.06.2015, 10:42
Re: CMD warn - by KamalBa - 12.06.2015, 10:59
Re: CMD warn - by KamalBa - 12.06.2015, 11:02

Forum Jump:


Users browsing this thread: 2 Guest(s)