Classifying Groups - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Classifying Groups (
/showthread.php?tid=93221)
Classifying Groups -
jamesc25313 - 23.08.2009
Is AddPlayerClassEx what Im suppose to use if I want to separate cops from robbers and civilians ect? If not then thats my intent. I want to separate police from civilians ect. Ive searched and search but maybe I dont know the exact term Im searching for? Anyway, any help or directions to help would be appreciated
Thanks
- James
Re: Classifying Groups -
LuxurioN™ - 23.08.2009
How so? Want to put separate classes? Build Teams?
Re: Classifying Groups -
Mr_Finnigan - 23.08.2009
This at top
Код:
static gTeam[MAX_PLAYERS];
#define TEAM_WORKER 0
#define TEAM_PIMP 1
#define TEAM_TRIAD 2
#define TEAM_FBI 3
then this under OnGameModeInit
Код:
AddPlayerClass(260,-2062.5583,237.4662,35.7149,268.8936,22,272,25,40,4,1); //Worker
AddPlayerClass(249,-2224.6045,-138.5713,35.3203,352.6432,0,0,0,0,0,0); //Pimp
AddPlayerClass(118,-2635.3606,1397.4556,7.0938,210.2745, 22, 100, 28, 300, 30, 350); //Triad
AddPlayerClass(286,-1635.0077,665.8105,7.1875,264.2244,29,300,22,170,3,1); //FBI
then this somewhere else
Код:
public SetupPlayerForClassSelection(playerid)
{
SetPlayerInterior(playerid,14);
SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
SetPlayerFacingAngle(playerid, 90.0);
SetPlayerCameraPos(playerid,256.0815,-43.0475,1003.0234);
SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerClass(playerid, classid);
SetupPlayerForClassSelection(playerid);
gPlayerClass[playerid] = classid;
switch (classid) {
case 0:
{
GameTextForPlayer(playerid, "~g~Worker", 500, 3);
}
case 1:
{
GameTextForPlayer(playerid, "~g~Pimp", 500, 3);
}
case 2:
{
GameTextForPlayer(playerid, "~g~Triad", 500, 3);
}
case 3:
{
GameTextForPlayer(playerid, "~g~FBI", 500, 3);
}
}
return 1;
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
SetPlayerClass(playerid, classid) {
if(classid == 0) {
gTeam[playerid] = TEAM_WORKER;
} else if(classid == 1) {
gTeam[playerid] = TEAM_PIMP;
} else if(classid == 2) {
gTeam[playerid] = TEAM_TRIAD;
} else if(classid == 3) {
gTeam[playerid] = TEAM_FBI;
}
}