Leader chat
#6

I would recomment you since you are using sscanf, to switch to ZCMD because it's faster and better than strcmp.
Last, the lenght of "/le" is not 10, but 3.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/le", true))
    {
        new
            text[100]
        ;
        if(sscanf(cmdtext, "s[100]",text)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /le [text]");
        if(!IsLeader(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You are not a leader!");
        new
            string[128],
            leader[ MAX_PLAYER_NAME ],
            orgname[118]// it should be lower
        ;
        GetPlayerName(playerid, leader, sizeof(leader));
        orgname = GetOrgName(PlayerOrg[playerid]);
        format(string,sizeof(string), "%s leader %s: %s", orgname, leader, text);
        SendClientMessageToLeaders(0xB6BAFFFF,string); // Make sure that function is called.
        print(string);// Debug
        return 1;
    }
    return 0;
}
Reply


Messages In This Thread
Leader chat - by T_Boy - 29.12.2012, 07:34
Re: Leader chat - by B-Matt - 29.12.2012, 07:48
Re: Leader chat - by T_Boy - 29.12.2012, 08:01
Re: Leader chat - by xMCx - 29.12.2012, 09:11
Re: Leader chat - by YoYo123 - 29.12.2012, 09:32
Re: Leader chat - by Konstantinos - 29.12.2012, 09:43
Re: Leader chat - by T_Boy - 29.12.2012, 09:46
Re: Leader chat - by T_Boy - 29.12.2012, 10:05
Re: Leader chat - by T_Boy - 29.12.2012, 12:57
Re: Leader chat - by Konstantinos - 29.12.2012, 16:54

Forum Jump:


Users browsing this thread: 1 Guest(s)