16.02.2011, 17:25
I dont know for strcmp or dcmd but if you use ZCMD you can do it with OnPlayerCommandPerformed in this way:
And for SendRconMessage (For the loop I would recommend foreach, but this will work to) You can use this:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(!success) return SendClientMessage(playerid, COLOR_HERE,"Unknown command! use /help if you forgot the commands");
else
{
new str[75];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
format(str, sizeof(str),"CMD: %s [%i] Command: \"%s\"",pName, playerid, cmdtext[0]);
printf(str);
SendRconMessage(COLOR_HERE, str);
}
return 1;
}
pawn Код:
forward SendRconMessage(color, string[]);
public SendRconMessage(color, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
SendClientMessage(i, color, string);
}
}
}
}