I suppose that is what you want:
Put it at OnPlayerCommandText:
pawn Код:
if(!strcmp("/a", cmdtext, true, 2))
{
if(strlen(cmdtext[2]) && cmdtext[2] == ' ')
{
new p_Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, p_Name, sizeof(p_Name));
if(!strcmp(p_Name, "Hot") || !strcmp(p_Name, "Cold"))
{
if(!strlen(cmdtext[3]) || cmdtext[3] == ' ')
{
new emsg[120];
format(emsg, 120, "Usage: /update 0-%d", Update_Nr);
return SendClientMessage(playerid, 0xFF0000FF, emsg);
}
new msg[144];
format(msg, sizeof(msg), "[ADMIN] %s: %s", p_Name, cmdtext[3]);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new i_Name[MAX_PLAYER_NAME];
GetPlayerName(i, i_Name, sizeof(i_Name));
if(!strcmp(i_Name, "Hot") || !strcmp(i_Name, "Cold"))
{
SendClientMessage(i, 0xFF0000FF, msg);
}
}
}
}
else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Only ''Hot'' and ''Cold'' can use this command. Sorry.");
}
}
I didn't test it, tell me if there are any mistakes/errors/bugs.
[Yes, I used strcmp and command processor, because (s)he seems new, learning with strcmp is good, I did that too.]