Clan chat
#1

I need help with my clan chat. Everyone who's not in a clan can see it, while it should show only for clan members.

PlayerInfo[i][pClan] = cid;
if(PlayerInfo[i][pClan] == cid)
Should detect if the player is in a clan and send the message to his clan members. (I'm not that good with foreach, so sorry if I'm making a major failure :$.

pawn Код:
stock SendClanMessage(color, string[])
{
    foreach(Player, i)
    {
        new cid;
        PlayerInfo[i][pClan] = cid;
        if(PlayerInfo[i][pClan] == cid)
        {
            SendClientMessage(i, color, string);
        }
    }
    return 1;
}
pawn Код:
CMD:c(playerid,params[])
{
    new string[128];
    if(PlayerInfo[playerid][pClan] < 1) return SendClientMessage(playerid, COLOR_REDD, "[ERROR] You are not in a clan!");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_LGREEN, "Usage: /c [text]");
    format(string, sizeof(string), "[CLAN] %s: {FFFFFF}%s", PLAYERNAME(playerid), params);
    SendClanMessage(COLOR_AMERICA, string);
    return 1;
}
Reply


Messages In This Thread
Clan chat - by ThaCrypte - 19.10.2013, 00:07
Re: Clan chat - by SilentSoul - 19.10.2013, 00:10
Re: Clan chat - by ThaCrypte - 19.10.2013, 00:16
Re: Clan chat - by HardRock - 19.10.2013, 00:16
Re: Clan chat - by ThaCrypte - 19.10.2013, 00:20
Re: Clan chat - by HardRock - 19.10.2013, 00:28
Re: Clan chat - by ThaCrypte - 19.10.2013, 00:37
Re: Clan chat - by HardRock - 19.10.2013, 00:40
Re: Clan chat - by ThaCrypte - 19.10.2013, 00:47
Re: Clan chat - by TonyII - 19.10.2013, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)