pawn Код:
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("SFH ");
DisableInteriorEnterExits(); //disables default interiors//
EnableStuntBonusForAll(0); //0 to disable, 1 to enable//
//classes//
AddPlayerClass(266,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); //Grove Street member 0 Civilian
AddPlayerClass(267,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); //Police Officer (1)
return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
switch(classid) // Switching between the classids
{
case 0/* The first classid is of the cops*/:
{
SetPlayerTeam(playerid, COP); // Setting players team
GameTextForPlayer(playerid, "~b~Cops", 1000, 3); // Screen msg for player to show what team
}
case 1/* The second classid is of the criminals*/:
{
SetPlayerTeam(playerid, CIVILIAN); // Same as above
GameTextForPlayer(playerid, "~r~Civilian, 1000", 3); // Same as above
}
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerTeam(playerid) == COP)
{
SetPlayerColor(playerid, COP_COLOUR); // Set his color to CopsColor (BLUE)
/* Any other bonus you want for Cops team! A special gun, skin, color, attachedobject, A random spawn! */
}
else if(GetPlayerTeam(playerid) ==CIVILIAN)
{
SetPlayerColor(playerid, CIVILIAN_COLOUR); // Same as above but in this case, CriminalsColor (RED)
}
return 1;
}
.