SetPlayerToTeamColor
#1

Well , Yah i am Questionable - But really , i am just trying to learn - Forgive me

Anyway.. I Did this..

PHP код:
stock SetPlayerToTeamColor(playerid)
{
    if (
gTeam[playerid] == TEAM_Mafia1)
    {
    
SetPlayerColor(playeridTCOLOR_LIGHTGREEN);
    }
    else if (
gTeam[playerid] == TEAM_Mafia2)
    {
    
SetPlayerColor(playeridTCOLOR_NAVYBLUE);
    }
    else if (
gTeam[playerid] == TEAM_Mafia3)
    {
    
SetPlayerColor(playeridTCOLOR_BEIGE);
    }

At the Bottom of the Script..It Complies without Warnings / Errors But when i Choose any of the Teams my color doesn't Change...

Any Help would be Appreciated.
Reply
#2

You forgot to define gTeam first.

Код:
stock SetPlayerToTeamColor(playerid)
{
    gTeam[playerid] = GetPlayerTeam(playerid);
    if (gTeam[playerid] == TEAM_Mafia1)
    {
    SetPlayerColor(playerid, TCOLOR_LIGHTGREEN);
    }
    else if (gTeam[playerid] == TEAM_Mafia2)
    {
    SetPlayerColor(playerid, TCOLOR_NAVYBLUE);
    }
    else if (gTeam[playerid] == TEAM_Mafia3)
    {
    SetPlayerColor(playerid, TCOLOR_BEIGE);
    }
}
Notice the GetPlayerTeam(playerid) part.
Reply
#3

Quote:
Originally Posted by Black Axe
Посмотреть сообщение
It Complies without Warnings / Errors But when i Choose any of the Teams my color doesn't Change....
Put

pawn Код:
printf("player %i team: %i", playerid, gTeam[playerid]);
on the first line and see what it prints in the server console/server_log.txt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)