SA-MP Forums Archive
[help] Gang Chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [help] Gang Chat (/showthread.php?tid=247355)



[help] Gang Chat - Monster[HD] - 09.04.2011

ok i tryed to make a gang chat heres it is


Quote:

if(IsPlayerConnected(playerid))
{
if(text[0] == '!')
{
SendClientMessage(playerid, 0xAA0000AA, "You are sending a gang message");
new name[24], string[128];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "[Team Chat]%s: %s", name, text[1]);
printf("%s", string);

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][gang_member] || PlayerInfo[i][gang_leader] == PlayerInfo[playerid][gang_member] || PlayerInfo[playerid][gang_leader])
SendClientMessage(i, GetPlayerColor(playerid), string);
}
}
return 0;
}

}

But I Got Errors May Someone Help and Fix This Command?


Re: [help] Gang Chat - Shelby - 09.04.2011

Quote:
Originally Posted by Monster[HD]
Посмотреть сообщение
But I Got Errors May Someone Help and Fix This Command?
what errors?


Re: [help] Gang Chat - Monster[HD] - 09.04.2011

i got this command working but i cant find out how to change the color when u chat!!!
its like Color_Black but i want it to be COLOR_LIGHTBLUE


Re: [help] Gang Chat - Shelby - 09.04.2011

pawn Код:
if(IsPlayerConnected(playerid))
{
    if(text[0] == '!')
    {
        SendClientMessage(playerid, 0xAA0000AA, "You are sending a gang message");
        new name[24], string[128];
        GetPlayerName(playerid, name, 24);
        format(string, sizeof(string), "[Team Chat]%s: %s", name, text[1]);
        printf("%s", string);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][gang_member] || PlayerInfo[i][gang_leader] == PlayerInfo[playerid][gang_member] || PlayerInfo[playerid][gang_leader])
                SendClientMessage(i, GetPlayerColor(playerid), string);
            }
        }
        return 0;
    }
}
pawn Код:
GetPlayerColor(playerid)
Change it for the color you want...


Re: [help] Gang Chat - Monster[HD] - 09.04.2011

SOOOOOO
if(IsPlayerConnected(playerid))
{
if(text[0] == '!')
{
SendClientMessage(playerid, 0xAA0000AA, "You are sending a gang message");
new name[24], string[128];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "[Team Chat]%s: %s", name, text[1]);
printf("%s", string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][gang_member] || PlayerInfo[i][gang_leader] == PlayerInfo[playerid][gang_member] || PlayerInfo[playerid][gang_leader])
SendClientMessage(i, COLOR_LIGHTBLUE(playerid), string);
}
}
return 0;
}
}


?


Re: [help] Gang Chat - Shelby - 09.04.2011

pawn Код:
if(IsPlayerConnected(playerid))
{
    if(text[0] == '!')
    {
        SendClientMessage(playerid, 0xAA0000AA, "You are sending a gang message");
        new name[24], string[128];
        GetPlayerName(playerid, name, 24);
        format(string, sizeof(string), "[Team Chat]%s: %s", name, text[1]);
        printf("%s", string);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][gang_member] || PlayerInfo[i][gang_leader] == PlayerInfo[playerid][gang_member] || PlayerInfo[playerid][gang_leader])
                SendClientMessage(i, COLOR_LIGHTBLUE, string);//<<<<
            }
        }
        return 0;
    }
}
pawn Код:
SendClientMessage(i, COLOR_LIGHTBLUE, string);
//or
SendClientMessage(i, 0x33CCFFAA, string);