#5

I dont know for strcmp or dcmd but if you use ZCMD you can do it with OnPlayerCommandPerformed in this way:
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;
}
And for SendRconMessage (For the loop I would recommend foreach, but this will work to) You can use this:
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);
                        }
                }
        }
}
Reply


Messages In This Thread
help - by omer5198 - 16.02.2011, 15:49
Re: help - by _Tommy - 16.02.2011, 15:58
Re: help - by omer5198 - 16.02.2011, 16:19
Re: help - by omer5198 - 16.02.2011, 17:16
Re: help - by alpha500delta - 16.02.2011, 17:25

Forum Jump:


Users browsing this thread: 1 Guest(s)