08.12.2011, 06:44
if it uses ZCMD & sscanf2...
pawn Код:
CMD:achat(playerid, params[])
{
new str[256], pName[MAX_PLAYER_NAME],msg[170]; //(128 is kinda a small string for chatting with..)
GetPlayerName(playerid, pName, sizeof(pName)); //Get's their name
if(level >= 1) //Use your admin level system variables here instead of what i'm using.
{
if(sscanf(params, "s", msg)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /a(chat) <message>"); //checks if the params are filled.
format(str, sizeof(str), "ADMIN CHAT: %s: %s", pName, msg); //formats the str so we can ready it for sending.
MessageToAdmins(green,str); //sends to admins
}
return 1;
}
CMD:a(playerid, params[]) return cmd_achat(playerid, params); //if they type /a returns the cmd /achat