How to setplayerteam other people that hasn't tag..
#1

I've made this code but i don't know how to set other people without tag to NO_TEAM..
How could i do that?
E_E
Here is my code..
Код:
public OnPlayerConnect(playerid)
{
    if(!strcmp(clantag, "[Daedric]", true))
		{
        SendClientMessage(playerid, DAEDRIC_COLOUR, "Sei stato riconosciuto come membro di daedric..");
        SetPlayerTeam(playerid, 1);
        SetPlayerColor(playerid, DAEDRIC_COLOUR);
		return 1;
}
	if(!strcmp(clantag, "[Test]", true))
		{
        SendClientMessage(playerid, TEST_COLOUR, "Sei stato riconosciuto come membro di test..");
        SetPlayerTeam(playerid, 2);
        SetPlayerColor(playerid, TEST_COLOUR);
		}
 	return 1;
}
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    if(!strcmp(clantag, "[Daedric]", true))
    {
        SendClientMessage(playerid, DAEDRIC_COLOUR, "Sei stato riconosciuto come membro di daedric..");
        SetPlayerTeam(playerid, 1);
        SetPlayerColor(playerid, DAEDRIC_COLOUR);
        return 1;
    }
    else if(!strcmp(clantag, "[Test]", true))
    {
        SendClientMessage(playerid, TEST_COLOUR, "Sei stato riconosciuto come membro di test..");
        SetPlayerTeam(playerid, 2);
        SetPlayerColor(playerid, TEST_COLOUR);
    }
    else
    {
        // no tag
    }
    return 1;
}
Reply
#3

pawn Код:
new Team[MAX_PLAYERS]; // A variable to call


public OnPlayerConnect(playerid)
{
    if(!strcmp(clantag, "[Daedric]", true))
        {
        SendClientMessage(playerid, DAEDRIC_COLOUR, "Sei stato riconosciuto come membro di daedric..");
        SetPlayerTeam(playerid, 1);
        Team[playerid] = 1  // Sets the Variable To Team number
        SetPlayerColor(playerid, DAEDRIC_COLOUR);
        return 1;
}
    if(!strcmp(clantag, "[Test]", true))
        {
        SendClientMessage(playerid, TEST_COLOUR, "Sei stato riconosciuto come membro di test..");
        SetPlayerTeam(playerid, 2);
        Team[playerid] = 2 // Sets the Variable To Team number
        SetPlayerColor(playerid, TEST_COLOUR);
        }
    if(Team[playerid] == 0)
    {
        SendClientMessage(playerid, -1 , " ...... " );
        SetPlayerTeam(playerid, 0); // i suppose 0 is no team for you
        SetPlayerColor(playerid, -1); // -1 is color white
    }
    return 1;
}
this will probably fix it

Edit: or the person above me way,i thought of it, but iwanted to make 100% checks on my way,his i think is better
Reply
#4

The prob wasn't this.. but thanks anyway
I just wanted to assign NO_TEAM for players that hasn't tag, or atleast not registred tags..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)