Admin say problem
#4

Quote:
Originally Posted by Soumi
Посмотреть сообщение
Tell me how?
Define this above your script:

Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
Add this somewhere in your script:
Код:
dcmd_adminsay(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
	    if(strlen(params) == 0)
	    {
			SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /adminsay [text]");
			return 1;
		}
		new message = params[0];
		new adminname[MAX_PLAYER_NAME], str1[128];
		GetPlayerName(playerid, adminname, sizeof(adminname));
		
		format(str1, sizeof(str1), "(( [ADMIN] %s: %s ))", adminname, message);
		SendClientMessageToAll(0xFFFFFFFF, str1);
	}
	else
	{
	    SendClientMessage(playerid, 0xFFFFFFFF, "  You must be an admin to use this command.");
	}
	return 1;
}
Add this to OnPlayerCommandText:
Код:
dcmd(adminsay, 8, cmdtext);
Here you go, re-write this, learn this.
DCMD is very simple and nice, I use it too.

Enjoy your new working command!
Reply


Messages In This Thread
Admin say problem - by Soumi - 19.03.2011, 15:59
Re: Admin say problem - by Biesmen - 19.03.2011, 16:01
Re : Admin say problem - by Soumi - 19.03.2011, 16:04
Re: Re : Admin say problem - by Ihsan-Cingisiz - 19.03.2011, 16:11
Re: Admin say problem - by austin070 - 19.03.2011, 16:14
Re : Admin say problem - by Soumi - 21.03.2011, 18:10

Forum Jump:


Users browsing this thread: 1 Guest(s)