team case problem
#1

hey well i have TEAM_COPS and this is my undercover cia agent thing

pawn Код:
case 4,5,6,7:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~CIA UNDERCOVER AGENT",5000,4);
            ApplyAnimation(playerid,"KNIFE","KILL_Knife_Player",4.1,0,0,0,0,0);
        }
i need when he spawns it sets there colour to a diff colour or do i have to make another team?
Reply
#2

Код:
case 4,5,6,7:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~CIA UNDERCOVER AGENT",5000,4);
            ApplyAnimation(playerid,"KNIFE","KILL_Knife_Player",4.1,0,0,0,0,0);
            SetPlayerColor(playerid, color);
        }
Add SetPlayerColor under every case
Reply
#3

but this is called under onplayer spawn

pawn Код:
public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == TEAM_COPS)
    {
        SetPlayerColor(playerid, BLUE);
    }
    else if(gTeam[playerid] == TEAM_CIVILIAN)
    {
        SetPlayerColor(playerid, WHITE);
    }
    else if(gTeam[playerid] == TEAM_MEDIC)
    {
        SetPlayerColor(playerid, PURPLE);
    }
}

entire thing
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    gPlayerClass[playerid] = classid;
    SetPlayerColor(playerid,0xAFAFAFAA);
    SetPlayerPos(playerid, 1232.126098, -808.075134, 1084.554687);
    SetPlayerInterior(playerid,5);
    SetPlayerFacingAngle(playerid, 171.853317);
    SetPlayerCameraLookAt(playerid, 1232.126098, -808.075134, 1084.554687);
    SetPlayerCameraPos(playerid, 1232.126098 + (5 * floatsin(-171.853317, degrees)), -808.075134 + (5 * floatcos(-171.853317, degrees)), 1084.554687);
    PlayerPlaySound(playerid, 1097,-119.9460,23.1096,12.2238); //music, duh
    switch(classid)
    {
        case 230:
        {
            GameTextForPlayer(playerid,"~r~~h~ADMINISTRATOR",5000,4);
        }
        case 0,1,2,3,12:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~POLICE OFFICER",5000,4);
            ApplyAnimation(playerid,"COP_AMBIENT","Coplook_think",4.1,0,0,0,0,0);
        }
        case 4,5,6,7:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~CIA UNDERCOVER AGENT",5000,4);
            ApplyAnimation(playerid,"KNIFE","KILL_Knife_Player",4.1,0,0,0,0,0);
        }
        case 8:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~POLICE OFFICER (BIKER)",5000,4);
            ApplyAnimation(playerid,"GANGS","DEALER_IDLE",4.1,0,0,0,0,0);
        }
        case 9:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~POLICE SWAT",5000,4);
            ApplyAnimation(playerid,"COP_AMBIENT","Coplook_think",4.1,0,0,0,0,0);
        }
        case 10:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~FBI AGENT",5000,4);
        }
        case 11:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid,"~b~THE ARMY",5000,4);
            ApplyAnimation(playerid,"COP_AMBIENT","Coplook_think",4.1,0,0,0,0,0);
        }
        case 13,14,15:
        {
            gTeam[playerid] = TEAM_MEDIC;
            GameTextForPlayer(playerid,"~p~MEDIC",5000,4);
        }
        case 16,17,1819,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100:
        {
            gTeam[playerid] = TEAM_CIVILIAN;
            GameTextForPlayer(playerid,"~w~~h~CIVILIAN",5000,4);
            ApplyAnimation(playerid,"GHANDS","gsign4",4.1,0,0,0,0,0);
        }
    }
    return 1;
}



public SetPlayerTeamFromClass(playerid, classid)
{
    return 1;
}

public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == TEAM_COPS)
    {
        SetPlayerColor(playerid, BLUE);
    }
    else if(gTeam[playerid] == TEAM_CIVILIAN)
    {
        SetPlayerColor(playerid, WHITE);
    }
    else if(gTeam[playerid] == TEAM_MEDIC)
    {
        SetPlayerColor(playerid, PURPLE);
    }
}
Reply
#4

Yeah i remember i had the same prob when i was coding a TDM... Just delete SetPlayerToTeamColor and add SetPlayerColor under cases... It should work
Reply
#5

nvm fixed.ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)