All pastes #461757 Raw Edit

Unnamed

public text v1 · immutable
#461757 ·published 2007-04-27 21:33 UTC
rendered paste body
#include <a_samp>
#include <core>
#include <float>


#define TEAM_Epsilon 0
#define TEAM_FBI 1
#define TEAM_Epsilon_COLOR 0x33CCFFAA
#define TEAM_FBI_COLOR 0xAA3333AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTBLUE 0x33CCFFAA

new spawn[MAX_PLAYER_NAME];

new gTeam[MAX_PLAYERS];






main()
{
	print("\n----------------------------------");
	print("  Epsilon mode");
	print("----------------------------------\n");
}

new Float:gFBIPlayerSpawns[7][3] = {
{1422.1351,-1868.4408,13.3828},
{1431.6660,-1870.6359,13.3828},
{1425.8152,-1879.8623,13.3828},
{1432.7731,-1889.7814,13.6977},
{1417.5549,-1903.7083,13.9272},
{1403.1667,-1875.5649,13.3828},
{1414.2617,-1880.0059,13.5469}
};

new Float:gRandomSpawns[10][3] = {
{230.6167,1033.9188,1084.0160},
{240.2970,1030.3428,1084.0078},
{243.4144,1027.5930,1084.0078},
{240.7879,1025.0343,1084.0078},
{239.6635,1047.9120,1084.0000},
{229.2859,1048.3597,1084.0116},
{253.8993,1034.9791,1084.7371},
{239.0930,1027.4656,1088.3044},
{237.9771,1033.9716,1088.3125},
{230.8094,1031.7358,1088.3125}
};


public SetPlayerRandomSpawn(playerid)
{
	if (iSpawnSet[playerid] == 1);
	{
		new rand = random(sizeof(gFBIPlayerSpawns);
		SetPlayerPos(playerid, gFBIPlayerSpawns[rand][0], gFBIPlayerSpawns[rand][1], gFBIPlayerSpawns[rand][2]);
		SetPlayerFacingAngle(playerid, 270.0);
    }
    else if (iSpawnSet[playerid] == 0);
    {
		new rand = random(sizeof(gRandomPlayerSpawns);
		SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]);
	}
	return 1;
}

public OnGameModeInit()
{
	print("GameModeInit()");
	SetGameModeText("Epsilon Base");
	AddPlayerClass(26, 0, 0, 0, 0, 30, 500, 24, 50, 27, 50);
	AddPlayerClass(280, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
	AddPlayerClass(281, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(282, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(283, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(284, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(285, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(286, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    AddPlayerClass(288, 0, 0, 0, 0, 31, 500, 29, 250, 25, 50);
    
    //Cars
	AddStaticVehicle(528,1428.5653,-1899.4232,13.7828,155.9713,0,0); // FBI car
	AddStaticVehicle(427,1437.6167,-1873.5525,13.5188,109.5754,0,1); // Police car
	AddStaticVehicle(599,1421.3270,-1893.7269,13.9016,183.8044,0,1); // Police car
	AddStaticVehicle(598,1418.0800,-1866.8085,13.2516,231.2445,0,1); // police car
	AddStaticVehicle(597,1403.8585,-1871.4176,13.1419,242.9625,0,1); // police car
	AddStaticVehicle(582,1294.3265,-2037.4415,58.2412,107.4483,114,118); // ped car
	AddStaticVehicle(575,1243.2711,-2039.5317,59.5764,16.3428,66,96); // epsilon car
	AddStaticVehicle(575,1243.6029,-2034.0355,59.5670,163.3846,51,96); // epsilon car
	AddStaticVehicle(555,1277.2831,-2012.0912,58.6153,269.6451,36,1); // epsilon car
	AddStaticVehicle(555,1277.2953,-2008.8119,58.6088,270.1413,13,1); // epsilon car
	return 1;
}



public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerTeamFromClass(playerid, classid);
	printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
	SetPlayerPos(playerid, 1121.4463,-2036.9719,78.2060);
	SetPlayerFacingAngle(playerid, 78.7500);
	SetPlayerInterior(playerid, 0);
	SetPlayerCameraPos(playerid, 1118.4375,-2037.1813,78.7500);
	SetPlayerCameraLookAt(playerid, 1121.4463,-2036.9719,78.2060);
	
	
	switch (classid) {
    case 0: 
        {
GameTextForPlayer(playerid, "~b~Epsilon", 1000, 6);
}
    case 1, 2, 3, 4, 5, 6, 7: 
        {
        
GameTextForPlayer(playerid, "~r~FBI", 1000, 6);

}
	}
	
	return 1;
}

public SetPlayerTeamFromClass(playerid, classid)
{
if(classid == 0 )
{

gTeam[playerid] = TEAM_Epsilon;
}
else if(classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8   ) { //Riffs
gTeam[playerid] = TEAM_FBI;
}
}

public SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_Epsilon)
	{
		SetPlayerColor(playerid, TEAM_Epsilon_COLOR);
	}
	else if (gTeam[playerid] == TEAM_FBI)
	{
		SetPlayerColor(playerid, TEAM_FBI_COLOR);
	}
}

public SetPlayerRandomSpawn(playerid)
{



}


public OnGameModeExit()
{
	print("GameModeExit()");
	return 1;
}

public OnPlayerConnect(playerid)
{
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Welcome To the Epsilon Clan server.");
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Type /help to get more info about this game mode.");
	printf("OnPlayerConnect(%d)", playerid);
	return 1;
}

public OnPlayerDisconnect(playerid)
{
	printf("OnPlayerDisconnect(%d)", playerid);
	return 1;
}

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

public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
 	if(killerid != INVALID_PLAYER_ID) Kills[killerid]++;
   	SendDeathMessage(killerid,playerid,reason);
	printf("OnPlayerDeath(%d, %d, %d)", playerid, killerid, reason);
	return 1;
}


public OnVehicleSpawn(vehicleid)
{
	printf("OnVehicleSpawn(%d)", vehicleid);
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	printf("OnVehicleDeath(%d, %d)", vehicleid, killerid);
	return 1;
}

public OnPlayerText(playerid)
{
	printf("OnPlayerText(%d)", playerid);
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp(cmdtext, "/help", true)==0)
	{
	     SendClientMessage(playerid, COLOR_LIGHTBLUE, "This mode is A (Attack and defend) mode");
         SendClientMessage(playerid, COLOR_LIGHTBLUE, "The Epsilon Must protect their base while the FBI try to over run them.");
	    return 1;
	}
	return 0;
}

public OnPlayerInfoChange(playerid)
{
	printf("OnPlayerInfoChange(%d)");
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	printf("OnPlayerEnterVehicle(%d, %d, %d)", playerid, vehicleid, ispassenger);
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	printf("OnPlayerExitVehicle(%d, %d)", playerid, vehicleid);
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	printf("OnPlayerStateChange(%d, %d, %d)", playerid, newstate, oldstate);
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	printf("OnPlayerEnterCheckpoint(%d)", playerid);
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	printf("OnPlayerLeaveCheckpoint(%d)", playerid);
	return 1;
}