Example of what you can do.
static gTeam[MAX_PLAYERS];
Under Script includes.
Example:
Код:
// Script Includes
#include <a_samp>
#include <core>
#include <float>
#include <time>
#include <file>
#include <utils>
#include <morphinc>
#pragma tabsize 0
static gTeam[MAX_PLAYERS];
Make sure you define the team!
#define TEAM_POLICE
Place this somewhere bellow the Script includes!
Also put this under request class
"SetPlayerTeamFromClass(playerid)"
Example:
Код:
public OnPlayerRequestClass(playerid, classid)
SetPlayerTeamFromClass(playerid)"
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
Example of a setting a team:
Код:
SetPlayerTeamFromClass(playerid)
{
if (GetPlayerTeam(playerid) == 1)
{
gTeam[playerid] = TEAM_UNEMPLOYED;
}
if (GetPlayerTeam(playerid) == 2)
{
gTeam[playerid] = TEAM_PILOTS;
}
}
Hope this help's.