/rc chat help
#3

pawn Код:
CMD:rc(playerid,params[])
{
    new string[128];
    if(GetPVarInt(playerid, "Spawned") != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 1;
    }
    if(pInfo[playerid][Regularlevel] != 1)
    {
        SendClientMessage(playerid,COLOR_ERROR,"Only Regular Players can use the Regular Player chat to talk.");
        return 1;
    }
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /rc (Message)");
        return 1;
    }
    format(string,sizeof(string),"[REGULAR CHAT] %s(%d): %s",GetName(playerid),playerid,params);
    SendClientMessageToAllRegulars(string);
    return 1;
}

stock SendClientMessageToAllRegulars(const str[])
{
    for (new i = 0, j = GetMaxPlayers(); i < j; i ++) if (IsPlayerConnected(i))
    {
        if (pInfo[i][Regularlevel] != 0)
        {
            SendClientMessage(i, 0x00FF00FF, str);
        }
    }
    return 1;
}
Reply


Messages In This Thread
/rc chat help - by efrim123 - 11.10.2013, 22:35
Re: /rc chat help - by SilentSoul - 11.10.2013, 22:46
Re: /rc chat help - by Emmet_ - 11.10.2013, 22:48
Re: /rc chat help - by efrim123 - 11.10.2013, 22:49

Forum Jump:


Users browsing this thread: 1 Guest(s)