SA-MP Forums Archive
Clan 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)
+--- Thread: Clan chat (/showthread.php?tid=491791)



Clan chat - DzDanieL - 01.02.2014

Hello everyone,I have a problem in my clans chat when I'm doing the sign [@ asd] it post the text on chat and not on the clan chat.

Sorry for my english If you dont understand.

Code:

Код:
public OnPlayerText(playerid, text[])
{
        new str[286];
        if(text[0] == '@')
        {
            if(!text[1]) return SendClientMessage(playerid,-1,"{ff0000}[USAGE]: {868686}@ [Text]"),0;
            new clevel[106];
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 1) return strcat(clevel,"Member");
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 2) return strcat(clevel,"Honor");
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 3) return strcat(clevel,"Tester");
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 4) return strcat(clevel,"S.Leader");
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 5) return strcat(clevel,"Leader");
            if(DOF2_GetInt(PFile(playerid),"ClanLevel") == 6) return strcat(clevel,"Founder");
            if(!DOF2_GetBool(PFile(playerid),"HaveClan")) return SendClientMessage(playerid,-1,"{ff0000}[USAGE]: {868686}айрк роца бчмап"),0;
            format(str,sizeof(str),"{00bdb3}(%s Chat) %s: {ffffff}%s {00bdb3}[ID: {ffffff}%d {00bdb3}| {ffffff}%s{00bdb3}]",DOF2_GetString(PFile(playerid),"ClanName"),GetName(playerid),text[1],playerid,clevel);
                SendClanMessage(playerid,-1,str);
                return false;
        }
        return false;
}
 
stock SendClanMessage(playerid, color, const msg[])
{
        for(new i,j = GetMaxPlayers(); i<j; i++)if(IsPlayerConnected(i) && !strcmp(DOF2_GetString(PFile(i),"ClanName"), DOF2_GetString(PFile(playerid),"ClanName"), false))
        {
                SendClientMessage(i, color, msg);
        }
        return 1;
}



Re: Clan chat - streetpeace - 01.02.2014

PHP код:
stock SendClanMessage(colorstring[])
{
    foreach(
Playeri)
    {
        if(
YourValue[i] == 1)
        {
            
SendClientMessage(icolorstring);
        }
    }
    return 
1;




Re : Clan chat - mirou123 - 01.02.2014

Код:
stock SendClanMessage(playerid, color, const msg[])
{
        for(new i = 0;i<MAX_PLAYERS;i++)
		{
			if(IsPlayerConnected(i) && !strcmp(DOF2_GetString(PFile(i),"ClanName"), DOF2_GetString(PFile(playerid),"ClanName"), false))
 			{
                SendClientMessage(i, color, msg);
        	}
    	}
        return 1;
}