01.02.2009, 00:10
Example of what you can do.
static gTeam[MAX_PLAYERS];
Under Script includes.
Example:
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:
Example of a setting a team:
Hope this help's.
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];
#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;
Код:
SetPlayerTeamFromClass(playerid) { if (GetPlayerTeam(playerid) == 1) { gTeam[playerid] = TEAM_UNEMPLOYED; } if (GetPlayerTeam(playerid) == 2) { gTeam[playerid] = TEAM_PILOTS; } }