Teams problem.
#1

Hi, I've got this teams FS from a website and I've made it too what I need.
The problem with it is when I go into my server too make sure the name colors are right Team Police and Team Trucker both have the default SAMP orange, I don't think it's putting them into their teams.

TEAM_TRUCKER = Yellow
TEAM_POLICE = Blue

Thanks for your help, please give me a solution.

Код:
#include <a_samp>
#define TEAM_TRUCKER 1
#define TEAM_POLICE 2
#define TEAM_TRUCKER_COLOUR 0xFFFF00AA // Yellow
#define TEAM_POLICE_COLOUR 0x0000BBAA // Blue
new gTeam[MAX_PLAYERS];

main()
{
    print("\n----------------------------------");
    print(" Teams");
    print("----------------------------------\n");
}

public OnGameModeInit()
{
    AddPlayerClass(16,-1542.9456,-2742.9224,48.5385,70.0556,0,0,0,0,0,0); // TEAM_TRUCKER 1
	AddPlayerClass(283,-2167.1899,-2382.9033,30.6172,142.7763,0,0,0,0,0,0); // TEAM_POLICE 2
    return 1;
}

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

public OnPlayerSpawn(playerid)
{
    SetPlayerToTeamColour(playerid);
    return 1;
}

SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = TEAM_TRUCKER;
    }
    else if(classid == 0)
    {
        gTeam[playerid] = TEAM_POLICE;
    }

}

SetPlayerToTeamColour(playerid)
{
    if(gTeam[playerid] == TEAM_TRUCKER)
    {
        SetPlayerColor(playerid,TEAM_TRUCKER_COLOUR);
    }
    else if(gTeam[playerid] == TEAM_POLICE)
    {
        SetPlayerColor(playerid,TEAM_POLICE_COLOUR);
    }

}
Reply
#2

don't use OnGameModeInit() if its a FS
Reply
#3

That will fix it?
Reply
#4

Take away OnGameModeInIt()
Transfer into OnFilterScriptInIt()

But this looks more like a Gamemode.
Why did you say it was a Filterscript?
Reply
#5

It is a FS. :S
Reply
#6

change from:
pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(16,-1542.9456,-2742.9224,48.5385,70.0556,0,0,0,0,0,0); // TEAM_TRUCKER 1
    AddPlayerClass(283,-2167.1899,-2382.9033,30.6172,142.7763,0,0,0,0,0,0); // TEAM_POLICE 2
    return 1;
}
to

pawn Код:
public OnFilterScriptInIt()
{
    AddPlayerClass(16,-1542.9456,-2742.9224,48.5385,70.0556,0,0,0,0,0,0); // TEAM_TRUCKER 1
    AddPlayerClass(283,-2167.1899,-2382.9033,30.6172,142.7763,0,0,0,0,0,0); // TEAM_POLICE 2
    return 1;
}
sorry for the previous quote, i hited post lol...
Reply
#7

fixed this for you
pawn Код:
SetPlayerTeamFromClass(playerid, classid)
{
    if(classid == 0)
    {
        gTeam[playerid] = TEAM_TRUCKER;
    }
    else if(classid == 1)
    {
        gTeam[playerid] = TEAM_POLICE;
    }

}
Reply
#8

I have a question, how does this script actuall determin what skin is for TEAM_TRUCKER or TEAM_POLICE?
Reply
#9

Quote:
Originally Posted by cessil
Посмотреть сообщение
don't use OnGameModeInit() if its a FS
Don't talk trash, this isn't causing any problems at all.
Reply
#10

[[[[REMOVED]]]]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)