[Help] Clan Chat
#1

I've got dynamic clan system where people can create their own clan which appears in a [] tag.
Each clan created saves in a new .ini file with it's name (Just like players) in the "Clans" folder.

What I wanna do is getting a "/cc [text]" command that only appears for people in the clan of "playerid".
I've been trying to do this but well... I failed.

Note: A clan could have ANY name, it's set by the player via "/clan create" command.

I use this for detecting the player's clan "PlayerInfo[playerid][pClan]"


Can someone help ?
Reply
#2

pawn Код:
CMD:cc(playerid, params[])
{
    new text[128], string[128];
    if(sscanf(params, "s", text)) return 1
    format(string, 128, "[CLAN] %s: %s", RPN(playerid), text);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i) || strcmp(PlayerInfo[playerid][pClan], PlayerInfo[i][pClan], true)) continue;
        SendClientMessage(i, colour, text);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
pawn Код:
CMD:cc(playerid, params[])
{
    new text[128], string[128];
    if(sscanf(params, "s", text)) return 1
    format(string, 128, "[CLAN] %s: %s", RPN(playerid), text);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i) || strcmp(PlayerInfo[playerid][pClan], PlayerInfo[i][pClan], true)) continue;
        SendClientMessage(i, colour, text);
    }
    return 1;
}
I can't really get it to work properly, I'll just try more with it.
Reply
#4

is pclan a intger or a string? ie its the id of a players clan || a name "something"
Reply
#5

pClan is a string
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)