All pastes #509313 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-25 11:54 UTC
rendered paste body
#include <a_samp>

#define TEAM_POLI 1
#define TEAM_BALLA 2

#define TEAM_POLI_COLOR 0x00FF00AA // Verde brillante
#define TEAM_BALLA_COLOR 0xFF00FFAA // Purpura brillante

new gTeam[MAX_PLAYERS];

main()
{
	print("\n----------------------------------");
	print("      XPIEN    Server - 2007)       ");
	print("      Scripter wich helped          ");
	print("      [GM]The_Don			       ");
	print("----------------------------------\n");
}

public SetPlayerTeamFromClass(playerid, classid)
{
	if (classid == 0)
	{
		gTeam[playerid] = TEAM_POLI;
	}
	else
	{
		gTeam[playerid] = TEAM_BALLA;
	}
}

public SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_POLI)
	{
		SetPlayerColor(playerid, TEAM_POLI_COLOR);
	}
	else if (gTeam[playerid] == TEAM_BALLA)
	{
		SetPlayerColor(playerid, TEAM_BALLA_COLOR);
	}
}

public OnPlayerSpawn(playerid)
{
	printf("Esta siendo spawneado(%d)", playerid);
	SetPlayerToTeamColor(playerid);
	return 1;
}

public OnGameModeInit()
{
	AddPlayerClassEx(0, 280, 1970.86987304687, -1206.51647949219, 25.4611167907715, 90, 3, 1, 32, 900, 0, 0);
    AddPlayerClassEx(1, 102, 2042.15063476562, -1195.81811523438, 23.2837181091309, 180, 4, 1, 29, 900, 14, 1);
    AddStaticVehicleEx(522, 2023.84826660156, -1196.34594726562, 21.0418491363525, 90, 126, 126, 200);
    AddStaticVehicleEx(522, 2023.84826660156, -1190.34594726562, 21.0418491363525, 90, 3, 0, 200);
}

public OnPlayerConnect(playerid)
{
	printf("Se conecto(%d)", playerid);
	GameTextForPlayer(playerid, "by Xpien", 6000, 4);
	return 1;
}

SetupPlayerForClassSelection(playerid)
{
	SetPlayerPos(playerid,2019.0341796875,-1428.8173828125,13.5397701263428);
	SetPlayerCameraPos(playerid,2013.0341796875,-1433.8173828125,13.5397701263428);
	SetPlayerCameraLookAt(playerid,2019.0341796875,-1428.8173828125,13.5397701263428);
}

public OnPlayerRequestClass(playerid, classid)
{
    printf("Esta intentando elegir personaje(%d)", playerid);
    SetupPlayerForClassSelection(playerid);
    printf("Classid: %d", classid);
    switch (classid) {
	    case 0:
	        {
				GameTextForPlayer(playerid, "~b~Policia~n~Tiene que matar a la banda", 2000, 3);
			}
		case 1:
		    {
				GameTextForPlayer(playerid, "~r~Banda criminal~n~Tiene que escapar de la policia", 2000, 3);
			}
		}
		SetPlayerTeamFromClass(playerid, classid);
	return 1;
}