SA-MP Forums Archive
OnPlayerText prob.. - 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: OnPlayerText prob.. (/showthread.php?tid=450744)



OnPlayerText prob.. - Steezy_ - 14.07.2013

Hey guys, i just wanted to make a clan and clan chat system..
Idk where is the prob, but ig even if i have a registred tag it says that im in public team..
This is the code..
Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '!')
    {
        if(TagUfficiali(playerid))
        {
            new string[128];
    		GetPlayerName(playerid, string, sizeof(string));
    		format(string, sizeof(string), "[Clan chat] %s: %s", string, text[1]);
    		for(new i = 0; i < MAX_PLAYERS; i++)
    		{
    			if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, DAEDRIC_TCOLOUR, string);
			}
   			return 1;
 		}
        else
        {
            if(!TagUfficiali(playerid))
           	{
           		new string[128];
    			GetPlayerName(playerid, string, sizeof(string));
    			format(string, sizeof(string), "[Civilian chat] %s: %s", string, text[1]);
    			for(new i = 0; i < MAX_PLAYERS; i++)
    			{
    			if(IsPlayerConnected(i) && gTeam[i] == gTeam[playerid]) SendClientMessage(i, DAEDRIC_TCOLOUR, string);
				}
				return 0;
			}
		}
    }
	return 1;
}


stock TagUfficiali(playerid)
{
    GetPlayerName(playerid, Name, sizeof(Name));
    if(strfind(Name, "[Test]", true) != -1 || strfind(Name, "[Deadric]", true) != -1) return 1;
    return 0;
}
Help please зuз


Re: OnPlayerText prob.. - Misiur - 14.07.2013

Please do not open new topics when you still have previous open about same issue.


Re: OnPlayerText prob.. - Steezy_ - 14.07.2013

I've edited some parts.. so i thought i could make another topic