[PEDIDO] Chat vip
#1

Eu tentei uns carai a 4, tentei deixar o anъncio e fazer um cmd de chat e tal e nгo deu certo...

peguei do thug e coloquei no meu gm:

pawn Код:
CMD:vipchat(playerid, params[])
{
        new string[128];
        new cmdtext[256];
        new idx;
        if(IsPlayerConnected(playerid) && PlayerInfo[playerid][VIP] >= 1)
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            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))
            {
                SendClientMessage(playerid, COLOR_RED, "USE: /vipchat [texto]");
                return 1;
            }
            format(string, sizeof(string), "** VIP %s: %s", sendername, result);
            SendClientMessage(playerid,0xFFCCFFAA,string);
            printf("** VIP %s: %s", sendername, result);
        }
        return 1;
    }
Reply
#2

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
new Vip[MAX_PLAYERS];

public OnPlayerText(playerid,text[])
{
if(Vip[playerid]==1)
{
if(text[0]=='-')
{
new string[128];
format(string,128,"Chat Vip- %s: %s",PlayerName(playerid),text[1]);
for(new i=0;i<MAX_PLAYERS,i++)
{
if(Vip[i]==1)SendClientMessage(i,0xFFFFFFFF,string);
}

}
}

}

public OnPlayerCommandText(playerid,cmdtext[])
{
dcmd(darvip,6,cmdtext);
return 0;
}
dcmd_darvi3(playerid,params[])
{
if(IsPlayerAdmin(playerid))
{
Vip[strval(params)]=1;
SendClientMessage(strval(params),0xFFFFFFFF,"enjoy chat vip sucesful");
}
return 1;
}

stock PlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
return name;
}
write -this text in chat vip
Reply
#3

wtf?? alguйm me ajuda que nгo seja mexicano ._.
Reply
#4

Usa o do mexicano traduzindo >D
Reply
#5

pawn Код:
public OnPlayerText(playerid,text[])
{
    if(text[0] == '!')
    {
        if( PlayerInfo [ playerid ] [ VIP ]  > =  1)
        {
            static lolz[128],Nome_Admin[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Nome_Admin, sizeof(Nome_Admin));
            format(lolz, sizeof(lolz),"[VIP-CHAT]: %s[ID:%i]%s",Nome_Admin, playerid, text[1]);
            SendMenssageToVips( 0x00FF00AA, lolz);
            return false;
        }
    }
    return false;
}
stock SendMenssageToVips(Color, Message[])
{
    for(new i; i <MAX_PLAYERS; ++i)
    if(IsPlayerConnected(i) && PlayerInfo [ playerid ] [ VIP ]  > =  1)
    {
        SendClientMessage(i, Color, Message);
    }
    return true;
}

// Ao digitar com ! antes da frase irб automaticamente para todos os vips.
Baseado no 'Lasanha Admin System'

PS: ele й Espaсol, e nгo mexicano!
Reply
#6

pawn Код:
public OnPlayerText(playerid,text[])
{
    if(text[0] == '!')
    {
        if( PlayerInfo [ playerid ] [ VIP ]  > =  1)
        {
            static lolz[128],Nome_Admin[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Nome_Admin, sizeof(Nome_Admin));
            format(lolz, sizeof(lolz),"[VIP-CHAT]: %s[ID:%i]%s",Nome_Admin, playerid, text[1]);
            SendClientMessage(i, 0x00FF00AA, lolz);
            return false;
        }
    }
    return false;
}
Reply
#7

Quote:
Originally Posted by Ricop522
Посмотреть сообщение
pawn Код:
public OnPlayerText(playerid,text[])
{
    if(text[0] == '!')
    {
        if( PlayerInfo [ playerid ] [ VIP ]  > =  1)
        {
            static lolz[128],Nome_Admin[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Nome_Admin, sizeof(Nome_Admin));
            format(lolz, sizeof(lolz),"[VIP-CHAT]: %s[ID:%i]%s",Nome_Admin, playerid, text[1]);
            SendClientMessage(i, 0x00FF00AA, lolz);
            return false;
        }
    }
    return false;
}
Cadк o loop e a variбvel 'i' ?
Reply
#8

Nao sei se voce ja conseguiu mais ta aew.

pawn Код:
if(strcmp(cmd, "/chatvip", true) == 0 || strcmp(cmd, "/vp", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            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))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USO: (/vp)vip [chat]");
                return 1;
            }
            else if(PlayerInfo[playerid][pDonateRank] ==1)
            {
                format(string, sizeof(string), "|-Vip Simples-|%s: %s, cвmbio. ", sendername, result);
                SendClientMessage(playerid, BLUE, string);
                printf("%s", string);
                return 1;
            }
            else if(PlayerInfo[playerid][pDonateRank] ==2)
            {
                format(string, sizeof(string), "|-Vip Ouro-|%s: %s, cвmbio. ", sendername, result);
                SendClientMessage(playerid, COLOR_OOC, string);
                printf("%s", string);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_YELLOW, "   Vocк nгo pode usar o rбdio !");
                return 1;
            }
        }
        return 1;
    }
Esse eu uso no meu gm ai se adapta ali os Rank
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)