19.03.2011, 12:44
You forgot to put SetPlayerTeamFromClass(playerid,classid); in OnPlayerRequestClass
also you need to put new gTeam[MAX_PLAYERS]; before #if defined FILTERSCRIPT
Here's the
Hope that i helped you
also you need to put new gTeam[MAX_PLAYERS]; before #if defined FILTERSCRIPT
Here's the
PHP код:
#include <a_samp>
#define TEAM_GROVE 1
#define TEAM_BALLAS 2
#define TEAM_VAGOS 3
#define TEAM_ARMY 4
#define TEAM_AIRPORT 5
#define TEAM_COPS 6
#define TEAM_LSGOVERNMENT 7
#define TEAM_DANANGBOYS 8
#define TEAM_BIKERS 9
#define TEAM_GOLFERS 10
#define TEAM_GROVE_COLOR 0x00FF00AA
#define TEAM_BALLAS_COLOR 0xFF00FFAA
#define TEAM_VAGOS_COLOR 0xFFFF00AA
#define TEAM_AMRY_COLOR 0xAFAFAFAA
#define TEAM_AIRPORT_COLOR 0x33CCFFAA
#define TEAM_COPS_COLOR 0x0000BBAA
#define TEAM_LSGOVERNMENT_COLOR 0xFFFFFFAA
#define TEAM_DANANGBOYS_COLOR 0xFF4500AA
#define TEAM_BIKERS_COLOR 0xAA3333AA
#define TEAM_GOLFERS_COLOR 0x9ACD32AA
new gTeam[MAX_PLAYERS];
#if defined FILTERSCRIPT
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid,classid);
}
public OnPlayerSpawn(playerid, classid)
{
SetPlayerToTeamColour(playerid);
}
//at the end of the script
SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0) //0 = to your first class that you made..
{
gTeam[playerid] = TEAM_GROVE;
}
if (classid == 1)//1 = to the second class that you made..
{
gTeam[playerid] = TEAM_BALLA;
}
if (classid == 2)
{
gTeam[playerid] = TEAM_VAGOS;
}
if (classid == 3)
{
gTeam[playerid] = TEAM_ARMY
}
if (classid == 4)
{
gTeam[playerid] = TEAM_AIRPORT
}
if (classid == 5)
{
gTeam[playerid] = TEAM_COPS
}
}
SetPlayerToTeamColour(playerid)
{
if(gTeam[playerid] == TEAM_COPS)
{
SetPlayerColor(playerid,TEAM_COPS_COLOR);
}
if(gTeam[playerid] == TEAM_AIRPORT)
{
SetPlayerColor(playerid,TEAM_AIRPORT_COLOR);
}