All pastes #585469 Raw Edit

Error mode

public text v1 · immutable
·published 2007-06-23 08:47 UTC
rendered paste body
//------------------------------------------------------------------------------

//

// 0.2 script by Evgeni

//

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



#include <a_samp>

#include <core>

#include <float>

//Global stuff and defines for our gamemode

static gTeam[MAX_PLAYERS]; // Tracks the team assignment for each player

new gPlayerClass[MAX_PLAYERS];

//Color Defines

#define COLOR_GREY 0xAFAFAFAA

#define COLOR_GREEN 0x97C82EAA

#define COLOR_RED 0xAA3333AA

#define COLOR_YELLOW 0xFFFF00AA

#define COLOR_PINK 0xFF66FFAA

#define COLOR_BLUE 0x5C92BFAA

#define COLOR_LIGHTBLUE 0x33CCFFAA

#define COLOR_DARKRED 0x660000AA

#define COLOR_ORANGE 0xFF9900AA

#define myMenu

//Team Defines

#define TEAM_GOOD 0

#define TEAM_EVIL 1

// Round duration

new gRoundTime = 3600000; // 60 mins

//new gRoundTime = 900000; //15 mins

//new gRoundTime = 300000; // 5 mins



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



main()

{

	print("\n----------------------------------");

	print("  TDM by Evgeni (2007)\n");

	print("----------------------------------\n");

}



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



public OnGameModeInit()


{

	SetGameModeText("TDM:Dockside");

	SetTeamCount(2);

	ShowNameTags(0);

	ShowPlayerMarkers(0);

	SetWorldTime(23);
	
	UsePlayerPedAnims(1);
	
	SetWeather(9);
	
	


	AddPlayerClass(79,3844.084229, 1667.803955, 3.201614,23,50,0,0,0,0); //Good

	AddPlayerClass(24,3826.850830, 1442.489746, 4.388811,23,50,0,0,0,0); //Evil
	

//Objects:
CreateObject(5145, 3871.174561, 1582.932251, -7.932874, 0, 0, 89.2776);
CreateObject(6300, 3837.625977, 1488.252808, -5.747437, 0, 0, 0);
CreateObject(5184, 3920.544678, 1510.943115, 21.256357, 0, 0, 359.1406);
CreateObject(6300, 3783.600098, 1488.233643, -5.796973, 0, 0, 0);
CreateObject(5131, 3840.062500, 1651.090332, 8.775949, 0, 0, 270);
CreateObject(10843, 3926.386963, 1518.281494, 10.592712, 0, 0, 270);
CreateObject(11543, 3862.857910, 1576.828613, 9.989149, 0, 0, 0);
CreateObject(13066, 3908.906982, 1640.569946, 7.777483, 0, 0, 180);
CreateObject(3707, 3873.494141, 1523.105713, 10.201820, 0, 0, 89.5185);
CreateObject(5129, 3840.587402, 1655.683350, 7.509954, 0, 0, 270);
CreateObject(5130, 3832.166260, 1660.637329, 6.832302, 0, 0, 315);
CreateObject(11387, 3796.783936, 1553.888062, 5.876196, 0, 0, 0);
CreateObject(11389, 3787.431885, 1569.957397, 5.757446, 0, 0, 0);
CreateObject(11388, 3787.351807, 1570.013672, 9.276066, 0, 0, 0);
CreateObject(11390, 3787.356201, 1569.614990, 6.959353, 0, 0, 0);
CreateObject(11391, 3778.517090, 1561.822144, 3.888729, 0, 0, 0);
CreateObject(11392, 3786.733398, 1571.412354, 2.638703, 0, 0, 0);
CreateObject(11393, 3792.039551, 1564.618774, 4.068728, 0, 0, 0);
CreateObject(3881, 3815.199707, 1493.574707, 4.395250, 0, 0, 180);
CreateObject(3882, 3814.958740, 1493.018433, 3.541482, 0, 0, 270);
CreateObject(9241, 3958.502441, 1554.552490, 4.084253, 0, 0, 0);
CreateObject(8493, 3816.513672, 1442.754395, 16.017496, 0, 0, 90);
CreateObject(12929, 3803.764404, 1494.000000, 2.541701, 0, 0, 359.9996);
CreateObject(5732, 3891.738770, 1584.404297, 10.149744, 0, 0, 90);
CreateObject(6283, 3823.115967, 1473.843262, 7.135685, 0, 0, 0.0001);
CreateObject(16070, 3811.166016, 1519.455566, 8.134680, 0, 0, 180);
CreateObject(18239, 3849.457520, 1609.373169, 2.535506, 0, 0, 270);
CreateObject(3707, 3954.053955, 1637.167725, 10.457062, 0, 0, 180);
CreateObject(9243, 3764.815918, 1515.178589, 7.478605, 0, 0, 0.0001);
CreateObject(9244, 3761.831055, 1563.275146, 7.895014, 0, 0, 270);
CreateObject(11010, 3810.879395, 1602.837646, 8.380873, 0, 0, 90);
CreateObject(13059, 3789.718994, 1614.307129, 6.567128, 0, 0, 90);
CreateObject(13061, 3779.320313, 1659.694092, 6.878570, 0, 0, 90);
CreateObject(13198, 3964.464355, 1513.891968, 7.634481, 0, 0, 270.0001);
CreateObject(925, 3805.439453, 1491.298950, 3.530593, 0, 0, 0);
CreateObject(925, 3797.557129, 1496.497803, 3.605593, 0, 0, 0);
CreateObject(3474, 3762.754883, 1621.324829, 9.363659, 0, 0, 0);
CreateObject(2669, 3761.686523, 1617.266724, 7.210563, 0, 0, 0);
CreateObject(3573, 3757.755615, 1600.528809, 5.235380, 0, 0, 270);
CreateObject(3575, 3758.585205, 1581.422119, 5.235379, 0, 0, 0);
CreateObject(3576, 3856.022217, 1652.863037, 4.037519, 0, 0, 0);
CreateObject(3577, 3860.562744, 1662.797241, 3.324914, 0, 0, 0);
CreateObject(3630, 3870.475098, 1674.848145, 4.032055, 0, 0, 180);
CreateObject(3630, 3861.021240, 1674.759399, 4.032107, 0, 0, 180);
CreateObject(3630, 3866.858887, 1651.247803, 4.037830, 0, 0, 270);
CreateObject(3630, 3849.073486, 1657.648804, 4.036322, 0, 0, 90);
CreateObject(3631, 3763.352783, 1599.859497, 3.121985, 0, 0, 90);
CreateObject(619, 3816.679199, 1500.849365, 2.693081, 0, 0, 135);
CreateObject(619, 3817.694824, 1532.543701, 2.693081, 0, 0, 135);
CreateObject(619, 3817.824219, 1574.711304, 2.693081, 0, 0, 135);
CreateObject(1267, 3915.947266, 1560.923706, 18.626879, 0, 0, 337.5);
CreateObject(18451, 3874.754639, 1599.137817, 3.071740, 0, 0, 180);
CreateObject(13367, 3841.496582, 1497.370483, 14.537575, 0, 0, 0);
CreateObject(923, 3873.385986, 1586.984009, 3.426461, 0, 0, 90);
CreateObject(1227, 3874.532227, 1587.151123, 3.398776, 0, 0, 90);
CreateObject(1338, 3874.345215, 1584.951538, 3.263579, 0, 0, 0);
CreateObject(1344, 3876.347900, 1585.012329, 3.360975, 0, 0, 22.5);
CreateObject(1349, 3872.868652, 1583.824951, 3.122295, 0, 0, 78.75);
CreateObject(1358, 3851.182129, 1576.402832, 3.746227, 0, 0, 0);
CreateObject(1365, 3876.697266, 1574.484009, 3.695786, 0, 0, 0);
CreateObject(1415, 3875.770508, 1587.215576, 2.663059, 0, 0, 90);
CreateObject(1429, 3877.004639, 1587.147705, 2.800464, 0, 0, 135);
CreateObject(1438, 3876.982422, 1588.568237, 2.580313, 0, 0, 22.5);
CreateObject(1439, 3878.402588, 1586.803833, 2.675018, 0, 0, 78.75);
CreateObject(1450, 3900.954346, 1589.937866, 3.161577, 0, 0, 258.75);
CreateObject(3593, 3899.469727, 1584.926514, 3.268570, 0, 0, 180);
CreateObject(3594, 3883.038818, 1574.547241, 3.185599, 0, 0, 270);
CreateObject(12957, 3899.114014, 1578.202271, 3.436553, 0, 0, 0);
CreateObject(849, 3867.943848, 1587.211914, 2.845198, 0, 0, 0);
CreateObject(1473, 3826.822754, 1450.114990, 2.800167, 0, 0, 180);
CreateObject(1473, 3826.915039, 1448.395508, 3.545985, 0, 0, 180);
CreateObject(1775, 3870.754883, 1613.482178, 3.656350, 0, 0, 180);
CreateObject(987, 3752.892578, 1489.644897, 2.543688, 0, 0, 0);
CreateObject(987, 3764.907959, 1489.549316, 2.543688, 0, 0, 0);
CreateObject(987, 3776.944336, 1489.474976, 2.543688, 0, 0, 0);
CreateObject(987, 3788.964355, 1489.465332, 2.543688, 0, 0, 0);
CreateObject(987, 3867.074219, 1488.893433, 2.307250, 0, 0, 180);
CreateObject(987, 3854.931152, 1488.901855, 2.307250, 0, 0, 180);
CreateObject(8260, 3956.541016, 1585.651245, 6.296856, 0, 0, 270);
CreateObject(3573, 3787.340576, 1549.315796, 4.760378, 0, 0, 180);
CreateObject(5262, 3870.966064, 1667.192383, 5.498658, 0, 0, 270);
CreateObject(3572, 3798.638916, 1573.651245, 3.891629, 0, 0, 90);
CreateObject(3572, 3798.565918, 1573.595215, 6.588953, 0, 0, 90);
CreateObject(3571, 3801.323730, 1573.648804, 3.891629, 0, 0, 90);
CreateObject(7025, 3782.291992, 1525.436646, 6.028823, 0, 0, 90);
CreateObject(987, 3879.188477, 1488.768433, 2.343688, 0, 0, 180);

myMenu = CreateMenu("Menu", 5, 20.0, 150.5, 100.0, 2.0);
	AddMenuItem(myMenu, 0, "Daj mi WIELKA FURE");
	AddMenuItem(myMenu, 0, "Daj KASE");
	AddMenuItem(myMenu, 0, "Daj mi CARTA");
	AddMenuItem(myMenu, 0, "Daj mi VORTEXA");
	AddMenuItem(myMenu, 0, "Daj mi NRG-500");



	
	SetTimer("GameModeExitFunc", gRoundTime, 0);

	return 1;

 }



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








public OnPlayerConnect(playerid)

{

	GameTextForPlayer(playerid,"TDM: ~r~Dockside",2500,5);

	GivePlayerMoney(playerid, 0);

	SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive

	return 1;

}



//------------------------------------------------------------------------------
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/menu", true)==0){
         myMenu = CreateMenu("Menu", 5, 20.0, 150.5, 100.0, 2.0);
	 AddMenuItem(myMenu, 0, "Daj mi WIELKA FURE");
	 AddMenuItem(myMenu, 0, "Daj KASE");
	 AddMenuItem(myMenu, 0, "Daj mi CARTA");
	 AddMenuItem(myMenu, 0, "Daj mi VORTEXA");
	 AddMenuItem(myMenu, 0, "Daj mi NRG-500");
	 ShowMenuForPlayer(myMenu, playerid);
	 }
         return 1;
         }


public OnPlayerSpawn(playerid)

{

	SetPlayerInterior(playerid,0);
	
	if(gTeam[playerid] == TEAM_GOOD) {
	
	SetPlayerColor(playerid,COLOR_GREEN); // Green
	SetPlayerHealth(playerid, 30);
	ResetPlayerMoney(playerid);
	SetPlayerScore(playerid,0);
	GivePlayerWeapon(playerid, 23,50);

		}

	else if(gTeam[playerid] == TEAM_EVIL) {

	SetPlayerColor(playerid,COLOR_BLUE); // Blue
	SetPlayerHealth(playerid, 30);
	ResetPlayerMoney(playerid);
	SetPlayerScore(playerid,0);
	GivePlayerWeapon(playerid, 23,50);

	}

	return 1;

}



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



public OnPlayerDeath(playerid, killerid, reason)

{

	if(killerid == INVALID_PLAYER_ID) {

        SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);

	} else {

        if(gTeam[killerid] != gTeam[playerid]) {

	    	// Valid kill

	    	SendDeathMessage(killerid,playerid,reason);

			SetPlayerScore(killerid,GetPlayerScore(killerid)+1);

			GivePlayerMoney(killerid, 1000);

}

		else {

			//Team Killer!

		new warning[256];

		format(warning, sizeof(warning), "Be careful! You have been punished for teamkilling.");

		SendClientMessage(killerid, 0xFFFF00AA, warning);

		SendDeathMessage(killerid,playerid,reason);

		SetPlayerHealth(killerid, 0);

		SetPlayerScore(killerid, GetPlayerScore(killerid) - 1);

}

	}

 	return 1;

}



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



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~Team Green", 500, 3);

			}

		case 1:

		    {

				GameTextForPlayer(playerid, "~b~Team Blue", 500, 3);

			}

		

}

	return 1;

}



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



public GameModeExitFunc()

 {

	GameModeExit();

	return 1;

 }



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



SetPlayerClass(playerid, classid) {

	if(classid == 0) {

	gTeam[playerid] = TEAM_GOOD;

	} else if(classid == 1) {

	gTeam[playerid] = TEAM_EVIL;

	

	}

}



//------------------------------------------------------------------------------
public OnPlayerSelectedMenuRow(playerid, row)
	{
    new Menu:Current = GetPlayerMenu(playerid);
  	if(Current == myMenu) {
	new Float:x;
	new Float:y;
	new Float:z;
	GetPlayerPos(playerid, x, y, z);
    switch(row)
	{
	case 0: CreateVehicle(406, x, y+10, z, 900.00, -1, -1, 90000);
	}
    switch(row)
	{
	case 1: GivePlayerMoney(playerid, 10000);
	}
    switch(row)
	{
    case 2: CreateVehicle(571, x, y+10, z, 900.00, -1, -1, 90000);
	}
	switch(row)
	{
    case 3: CreateVehicle(539, x, y+10, z, 900.00, -1, -1, 90000);
	}
	switch(row)
	{
    case 4: CreateVehicle(522, x, y+10, z, 900.00, -1, -1, 90000);
	}
	}
	}