09.02.2010, 16:30
pawn Код:
#define Command(%1) if(!strcmp(cmdtext,%1,true))
#define sM(%1,%2,%3) SendClientMessage(%1,%2,%3)
//Defines Command(CMD) to "if(!strcmp(cmdtext,%1,true))" and sM(playerid,COLOR,string) to SendClientMessage to save writing. Simple, but could
//come in use for long scripts.
//Example:
Command("/hello")
{
sM(playerid,RED,"Hello!");
return 1;
}
//For formatted strings...
sM(playerid,RED,"%s set on fire",playername);
//The exact same!