Add Teams to my Script? Help please
#1

Hey

Im not very good at Pawn and most time im just editing existing game modes. but i need some help with this...
Here is my gamemode:

Код:
#include <a_samp>
#include <core>
#include <float>
#include "../include/gl_common.inc"
#include "../include/gl_spawns.inc"

#pragma tabsize 0

//----------------------------------------------------------

#define COLOR_WHITE 		0xFFFFFFFF
#define COLOR_NORMAL_PLAYER 0xFF4444FF

#define CITY_LOS_SANTOS 	0
#define CITY_SAN_FIERRO 	1
#define CITY_LAS_VENTURAS 	2
#define MAX_SLOTS 50
#define START_HEALTH 35.0
#define ORANGE 0xE75D18FF


new frags[MAX_SLOTS];
new total_vehicles_from_files=0;


// Class selection globals
new gPlayerCitySelection[MAX_PLAYERS];
new gPlayerHasCitySelected[MAX_PLAYERS];
new gPlayerLastCitySelectionTick[MAX_PLAYERS];

new Text:txtClassSelHelper;
new Text:txtLosSantos;
new Text:txtSanFierro;
new Text:txtLasVenturas;

//----------------------------------------------------------

main()
{
	print("\n---------------------------------------");
	print("Running GTA Deathmatch - by Arne\n");
	print("---------------------------------------\n");
}

//----------------------------------------------------------

public OnPlayerConnect(playerid)
{
	GameTextForPlayer(playerid,"~w~GTA Deathmatch",3000,4);
  	SendClientMessage(playerid,COLOR_WHITE,"Welcome to GTA Deathmatch");
  	EnableStuntBonusForPlayer(playerid, 1);
  	
  	// class selection init vars
  	gPlayerCitySelection[playerid] = -1;
	gPlayerHasCitySelected[playerid] = 0;
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();

	//SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
	
	return 1;
}

//----------------------------------------------------------

public OnPlayerSpawn(playerid)
{
	if(IsPlayerNPC(playerid)) return 1;
	
	new randSpawn = 0;
	
	SetPlayerInterior(playerid,0);
	TogglePlayerClock(playerid,0);
	GivePlayerWeapon(playerid, 29, 500);
 	ResetPlayerMoney(playerid);
	GivePlayerMoney(playerid, 30000);
	
	// if they ever return to class selection make them city
	// select again first
	gPlayerHasCitySelected[playerid] = 0;

	if(CITY_LOS_SANTOS == gPlayerCitySelection[playerid]) {
 	    randSpawn = random(sizeof(gRandomSpawns_LosSantos));
 	    SetPlayerPos(playerid,
		 gRandomSpawns_LosSantos[randSpawn][0],
		 gRandomSpawns_LosSantos[randSpawn][1],
		 gRandomSpawns_LosSantos[randSpawn][2]);
		SetPlayerFacingAngle(playerid,gRandomSpawns_LosSantos[randSpawn][3]);
	}
	else if(CITY_SAN_FIERRO == gPlayerCitySelection[playerid]) {
 	    randSpawn = random(sizeof(gRandomSpawns_SanFierro));
 	    SetPlayerPos(playerid,
		 gRandomSpawns_SanFierro[randSpawn][0],
		 gRandomSpawns_SanFierro[randSpawn][1],
		 gRandomSpawns_SanFierro[randSpawn][2]);
		SetPlayerFacingAngle(playerid,gRandomSpawns_SanFierro[randSpawn][3]);
	}
	else if(CITY_LAS_VENTURAS == gPlayerCitySelection[playerid]) {
 	    randSpawn = random(sizeof(gRandomSpawns_LasVenturas));
 	    SetPlayerPos(playerid,
		 gRandomSpawns_LasVenturas[randSpawn][0],
		 gRandomSpawns_LasVenturas[randSpawn][1],
		 gRandomSpawns_LasVenturas[randSpawn][2]);
		SetPlayerFacingAngle(playerid,gRandomSpawns_LasVenturas[randSpawn][3]);
	}

	//SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
	
	SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200);
    SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200);
    
    GivePlayerWeapon(playerid,WEAPON_COLT45,100);
	//GivePlayerWeapon(playerid,WEAPON_MP5,100);
	//TogglePlayerClock(playerid, 1);

	return 1;
}

//----------------------------------------------------------

public OnPlayerDeath(playerid, killerid, reason)
    {
            {

                    SendDeathMessage(killerid, playerid, reason);
                    SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
                    frags[killerid]++;
            if(frags[playerid] >= 5) // Death reason: killed
                    {
                        new string[128], playername[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME];
                        GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
                        GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                        format(string, 128, "%s's killing streak ended by %s. (%i kills)", playername, killername, frags[playerid]);
                        SendClientMessageToAll(ORANGE, string);
                    }
                    switch(frags[killerid])
                    {
                        case 5:
                        {
                                new string[128], killername[MAX_PLAYER_NAME];
                                GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                                format(string, 128, "%s is on a Killing Spree!!", killername);
                                SendClientMessageToAll(ORANGE, string);
                                GameTextForPlayer(killerid, "~r~~h~~h~KILLING SPREE", 2000, 4);
                                SetPlayerHealth(playerid, START_HEALTH);
                        }
                        case 10:
                        {
                                new string[128], killername[MAX_PLAYER_NAME];
                                GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                                format(string, 128, "%s is on a Rampage!!", killername);
                                SendClientMessageToAll(ORANGE, string);
                                GameTextForPlayer(killerid, "~r~~h~~h~RAMPAGE", 2000, 4);
                                SetPlayerHealth(playerid, START_HEALTH);
                        }
                        case 15:
                        {
                                new string[128], killername[MAX_PLAYER_NAME];
                                GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                                format(string, 128, "%s is Dominating!!", killername);
                                SendClientMessageToAll(ORANGE, string);
                                GameTextForPlayer(killerid, "~r~~h~~h~DOMINATING", 2000, 4);
                                SetPlayerHealth(playerid, START_HEALTH);
                        }
                        case 20:
                        {
                                new string[128], killername[MAX_PLAYER_NAME];
                                GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                                format(string, 128, "%s is Unstoppable!!!", killername);
                                SendClientMessageToAll(ORANGE, string);
                                GameTextForPlayer(killerid, "~r~~h~~h~UNSTOPPABLE", 2000, 4);
                                SetPlayerHealth(playerid, START_HEALTH);
                        }
                        case 25:
                        {
                                new string[128], killername[MAX_PLAYER_NAME];
                                GetPlayerName(killerid, killername, MAX_PLAYER_NAME);
                                format(string, 128, "%s is GODLIKE!!!1!!!1!1!11!!!!!", killername);
                                SendClientMessageToAll(ORANGE, string);
                                GameTextForPlayer(killerid, "~r~~h~~h~GODLIKE", 2000, 4);
                                SetPlayerHealth(playerid, START_HEALTH);
                        }
                    }
            }
            frags[playerid] = 0;
            return 1;
    }
    
    public OnPlayerCommandText(playerid, cmdtext[])
    {
            if (strcmp("/kill", cmdtext, true, 5) == 0)
            {
                    SetPlayerHealth(playerid, 0.0);
                    return 1;
            }
            return 0;
    }
//----------------------------------------------------------

ClassSel_SetupCharSelection(playerid)
{
   	if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
		SetPlayerInterior(playerid,11);
		SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
		SetPlayerFacingAngle(playerid,0.0);
    	SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
		SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
	}
	else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
		SetPlayerInterior(playerid,3);
		SetPlayerPos(playerid,-2673.8381,1399.7424,918.3516);
		SetPlayerFacingAngle(playerid,181.0);
    	SetPlayerCameraPos(playerid,-2673.2776,1394.3859,918.3516);
		SetPlayerCameraLookAt(playerid,-2673.8381,1399.7424,918.3516);
	}
	else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
		SetPlayerInterior(playerid,3);
		SetPlayerPos(playerid,349.0453,193.2271,1014.1797);
		SetPlayerFacingAngle(playerid,286.25);
    	SetPlayerCameraPos(playerid,352.9164,194.5702,1014.1875);
		SetPlayerCameraLookAt(playerid,349.0453,193.2271,1014.1797);
	}
	
}

//----------------------------------------------------------
// Used to init textdraws of city names

ClassSel_InitCityNameText(Text:txtInit)
{
  	TextDrawUseBox(txtInit, 0);
	TextDrawLetterSize(txtInit,1.25,3.0);
	TextDrawFont(txtInit, 0);
	TextDrawSetShadow(txtInit,0);
    TextDrawSetOutline(txtInit,1);
    TextDrawColor(txtInit,0xEEEEEEFF);
    TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
}

//----------------------------------------------------------

ClassSel_InitTextDraws()
{
    // Init our observer helper text display
	txtLosSantos = TextDrawCreate(10.0, 380.0, "Los Santos");
	ClassSel_InitCityNameText(txtLosSantos);
	txtSanFierro = TextDrawCreate(10.0, 380.0, "San Fierro");
	ClassSel_InitCityNameText(txtSanFierro);
	txtLasVenturas = TextDrawCreate(10.0, 380.0, "Las Venturas");
	ClassSel_InitCityNameText(txtLasVenturas);

    // Init our observer helper text display
	txtClassSelHelper = TextDrawCreate(10.0, 415.0,
	   " Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select.");
	TextDrawUseBox(txtClassSelHelper, 1);
	TextDrawBoxColor(txtClassSelHelper,0x222222BB);
	TextDrawLetterSize(txtClassSelHelper,0.3,1.0);
	TextDrawTextSize(txtClassSelHelper,400.0,40.0);
	TextDrawFont(txtClassSelHelper, 2);
	TextDrawSetShadow(txtClassSelHelper,0);
    TextDrawSetOutline(txtClassSelHelper,1);
    TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
    TextDrawColor(txtClassSelHelper,0xFFFFFFFF);
}

//----------------------------------------------------------

ClassSel_SetupSelectedCity(playerid)
{
	if(gPlayerCitySelection[playerid] == -1) {
		gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
	}
	
	if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
		SetPlayerInterior(playerid,0);
   		SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0);
		SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167);
		
		TextDrawShowForPlayer(playerid,txtLosSantos);
		TextDrawHideForPlayer(playerid,txtSanFierro);
		TextDrawHideForPlayer(playerid,txtLasVenturas);
	}
	else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
		SetPlayerInterior(playerid,0);
   		SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823);
		SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589);
		
		TextDrawHideForPlayer(playerid,txtLosSantos);
		TextDrawShowForPlayer(playerid,txtSanFierro);
		TextDrawHideForPlayer(playerid,txtLasVenturas);
	}
	else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
		SetPlayerInterior(playerid,0);
   		SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390);
		SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275);
		
		TextDrawHideForPlayer(playerid,txtLosSantos);
		TextDrawHideForPlayer(playerid,txtSanFierro);
		TextDrawShowForPlayer(playerid,txtLasVenturas);
	}
}

//----------------------------------------------------------

ClassSel_SwitchToNextCity(playerid)
{
    gPlayerCitySelection[playerid]++;
	if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
	    gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
	}
	PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();
	ClassSel_SetupSelectedCity(playerid);
}

//----------------------------------------------------------

ClassSel_SwitchToPreviousCity(playerid)
{
    gPlayerCitySelection[playerid]--;
	if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
	    gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
	}
	PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
	gPlayerLastCitySelectionTick[playerid] = GetTickCount();
	ClassSel_SetupSelectedCity(playerid);
}

//----------------------------------------------------------

ClassSel_HandleCitySelection(playerid)
{
	new Keys,ud,lr;
    GetPlayerKeys(playerid,Keys,ud,lr);
    
    if(gPlayerCitySelection[playerid] == -1) {
		ClassSel_SwitchToNextCity(playerid);
		return;
	}

	// only allow new selection every ~500 ms
	if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return;
	
	if(Keys & KEY_FIRE) {
	    gPlayerHasCitySelected[playerid] = 1;
	    TextDrawHideForPlayer(playerid,txtClassSelHelper);
		TextDrawHideForPlayer(playerid,txtLosSantos);
		TextDrawHideForPlayer(playerid,txtSanFierro);
		TextDrawHideForPlayer(playerid,txtLasVenturas);
	    TogglePlayerSpectating(playerid,0);
	    return;
	}
	
	if(lr > 0) {
	   ClassSel_SwitchToNextCity(playerid);
	}
	else if(lr < 0) {
	   ClassSel_SwitchToPreviousCity(playerid);
	}
}

//----------------------------------------------------------

public OnPlayerRequestClass(playerid, classid)
{
	if(IsPlayerNPC(playerid)) return 1;

	if(gPlayerHasCitySelected[playerid]) {
		ClassSel_SetupCharSelection(playerid);
		return 1;
	} else {
		if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) {
			TogglePlayerSpectating(playerid,1);
    		TextDrawShowForPlayer(playerid, txtClassSelHelper);
    		gPlayerCitySelection[playerid] = -1;
		}
  	}
    
	return 0;
}

//----------------------------------------------------------

public OnGameModeInit()
{
	SetGameModeText("GTA Deathmatch by Arne");
	ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
	ShowNameTags(1);
	SetNameTagDrawDistance(40.0);
	EnableStuntBonusForAll(0);
	DisableInteriorEnterExits();
	SetWeather(2);
	
	//LimitGlobalChatRadius(300.0);
	
	ClassSel_InitTextDraws();

	// Player Class
	AddPlayerClass(0,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(10,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
 	AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(3,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(249,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(272,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(287,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(288,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(292,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(296,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
   	AddPlayerClass(295,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(294,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(293,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(260,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(205,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(167,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(214,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(277,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(278,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(279,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(19,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(264,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(63,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(64,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(257,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(256,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(246,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(245,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(207,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(244,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(243,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(238,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(237,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(178,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);
	AddPlayerClass(152,1759.0189,-1898.1260,13.5622,266.4503,34,20,17,3,-1,-1);

	// SPECIAL
	total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
	total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");

   	// LAS VENTURAS
     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
    
    // SAN FIERRO
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
    
    // LOS SANTOS
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
    
    // OTHER AREAS
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
    total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");

    printf("Total vehicles from files: %d",total_vehicles_from_files);

	return 1;
}

//----------------------------------------------------------

public OnPlayerUpdate(playerid)
{
	if(!IsPlayerConnected(playerid)) return 0;
	
	// changing cities by inputs
	if( !gPlayerHasCitySelected[playerid] &&
	    GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) {
	    ClassSel_HandleCitySelection(playerid);
	    return 1;
	}
	
	// No weapons in interiors
	if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
	    SetPlayerArmedWeapon(playerid,0); // fists
	    return 0; // no syncing until they change their weapon
	}
	
	// Don't allow minigun
	if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
	    Kick(playerid);
	    return 0;
	}
	
	// No jetpacks allowed
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
	    Kick(playerid);
	    return 0;
	}

	return 1;
}

//----------------------------------------------------------
(Yes, i didnt write it all on my own, most of it is from grand larceny and some other game modes)

I want to add 2 teams and a command, which let you choose your team.
But i dont know how.
Please, i need some help.
I tried the tutorial at the wiki but there was nothing written over a command or something like that.
(sorry for bad english. )
Reply
#2

https://sampwiki.blast.hk/wiki/PAWN_tuto...eam_deathmatch

Amazing what the search button can do.
Reply
#3

thanks, but do you see there something about a command or something like this?
Reply
#4

Make 2 seperate commands, and then change their gTeam variable, or use SetPlayerTeam.
pawn Код:
gTeam[playerid] = Team1;

if( gTeam[playerid] == Team1 )
{

}
Reply
#5

Quote:
Originally Posted by core7
Посмотреть сообщение
thanks, but do you see there something about a command or something like this?
You won't need commands to make teams, just defines, functions, callbacks..
Reply
#6

@Wesley221:
Thanks
I will try with setplayerteam

But can you explain it a bit more?
Sorry, im really new to pawn

@G4M3Ov3r:
I know, but i would like it better with commands.
Reply
#7

Quote:
Originally Posted by core7
Посмотреть сообщение
@Wesley221:
Thanks
I will try with setplayerteam

But can you explain it a bit more?
Sorry, im really new to pawn

@G4M3Ov3r:
I know, but i would like it better with commands.
https://sampwiki.blast.hk/wiki/SetPlayerTeam
Reply
#8

https://sampforum.blast.hk/showthread.php?tid=117851
Use this to create a textdraw.

pawn Код:
new Team1Kills; // this will count the kills for team 1
new Team2Kills; // this for team 2

onplayerdeath
if(GetPlayerTeam(killerid) == Team1)
{
    Team1Kills++; // this will add one kill to the variable
    TextDrawSetString(); // update the datas
}
else
{
    Team2Kills++; // This will add one kill to the variable
    TextDrawSetString(); // update the datas
}
https://sampwiki.blast.hk/wiki/TextDrawCreate
Scroll down for all the textdraw functions
Reply
#9

Thank you, i ll try
Reply
#10

Ok, it seems to work.
thaank you.

Last Question:

Код:
Textdraw0 = TextDrawCreate(11.000000, 322.000000, "New Textdraw");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);

Textdraw1 = TextDrawCreate(10.000000, 300.000000, "New Textdraw");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
How do I change the "New Textdraw"-text do the points of the teams?
I already read the tutorial, but i didnt understand, sorry

(for the kills of a team i used "Team_1_Kills" and "Team_2_kills")
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)