[Ajuda] Como Crio Um Chat Da Familia
#1

Tipo Quem Tem o Sobrenome Gewalt no server pode usar /gw bla bla e tals alguen ajuda ?


quem pode ver e falar e somente quem tem o sobrenome gewalt
Reply
#2

Tambem to afim de um desse ae iqual o da gt gta torcidas o cara bota ! na frente so fala com os menbros da propria torcida
Reply
#3

Adapta isso a teu gm peguei do meu gamemode so ir ageitando que tu consegue


pawn Код:
if(strcmp(cmd,"/familia",true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
new tmp[256];
strmid(tmp,cmdtext,5,strlen(cmdtext));
if(!strlen(tmp)) {
SendClientMessage(playerid,Vermelho,"/familia [texto]");
return 1;
} else {
format(string, sizeof(string), "[Chat da Familia] %s: %s", aname, tmp);
Chatfamilia(0x008000AA,string,1,playerid);
return 1;
}
}

forward Chatc(COLOR,const string[],level,playerid);
public Chatfamilia(COLOR,const string[],level,playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new aname[MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
GetPlayerName(i, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
if(dini_Int(file, "SFAMILIA") == 1 && dini_Int(file2, "SFAMILIA") == 1){
if(dini_Int(file, "FAMILIA") == dini_Int(file2, "FAMILIA")){
SendClientMessage(i, COLOR, string);
}
}
}
}
return 1;
}
Reply
#4

pawn Код:
if(strcmp(cmdtext, "/bw", true, 3) == 0)
{
    new nick[24], string[128], nickg[24];
       
    GetPlayerName(playerid, nick, sizeof nick);
       
    if(strfind(nick, "_Gewalt", false) != -1)
    {
        format(string, sizeof string, "[Familia] %s[%d]: %s", nick, playerid, cmdtext[4]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            GetPlayerName(playerid, nickg, sizeof nickg);
            if(strfind(nickg, "_Gewalt", false) != -1 && IsPlayerConnected(i))
            {
                SendClientMessage(i, -1, string);
            }
        }
    }
    return 1;
}
Reply
#5

pawn Код:
CMD:gewalt(playerid)
{
    new nick[24], string[128], nickg[24];
    GetPlayerName(playerid, nick, sizeof nick);
    if(strfind(nick, "_Gewalt", false) != -1)
    {
        format(string, sizeof string, "[Gewalt] %s[ %d ]: %s", nick, playerid, cmdtext[4]);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            GetPlayerName(playerid, nickg, sizeof nickg);
            if(strfind(nickg, "_Gewalt", false) != -1)
        {
            SendClientMessage(i, -1, string);
        }
    }
    return 1;
}
EDIT identei o cod e fechei as chaves que esqueci *-*
Reply
#6

Cуpia! ^^
Reply
#7

sim, so passei pra zcmd e identei e que ele no post dele ele nao pois se й strcmp ou zcmd
Reply
#8

Quote:
Originally Posted by Murilo_sousa
Посмотреть сообщение
sim, so passei pra zcmd e identei e que ele no post dele ele nao pois se й strcmp ou zcmd
O dele sim estб edentado, e o seu nгo e ainda estб faltando chaves...
Reply
#9

Compilando e Funcionando


pawn Код:
if(strcmp(cmd, "/gw", true) == 0)
        {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, pName, sizeof(pName));
        if(strfind(pName, "_Gewalt", false) != -1)
            {
            new length = strlen(cmdtext);
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
           
            if(strlen(result) == 0) return SendClientMessage(playerid, -1, "USO: /gw [Texto]");
            new str[128];
            format(str, sizeof(str), "%s [Familia Gewalt]: %s", pName, result);
            new i = 0;
            while(i < MAX_PLAYERS)
                {
                new nick1[MAX_PLAYER_NAME];
                GetPlayerName(i, nick1, sizeof(nick1));
                if(strfind(nick1, "_Gewalt", false) != -1)
                    {
                    SendClientMessage(i, 0xFFAAFFAA, str);
                    }
                i++;
                }
           
            }
        return 1;
        }
Reply
#10

Do Andmeida funfo direitinho Mais Vlw a todos
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)