All pastes #119877 Raw Edit

Y_Less

public text v1 · immutable
·published 2006-08-07 01:04 UTC
rendered paste body
#include <a_samp>

#define ROUND_TIME 600000 // 10 minutes

main()
{
	print("\n====================================");
	print("|                                  |");
	print("|           Building Up!           |");
	print("|          --------------          |");
	print("|                                  |");
	print("| By Alex \"Y_Less\" Cole - (c) 2006 |");
	print("|                                  |");
	print("====================================\n");
	
	SetTimer("LoopFunc", 2000, true);
	SetTimer("ExitTheGameMode", ROUND_TIME, false);
}

public OnGameModeInit()
{
	SetGameModeText("Building Up!");
	AddPlayerClass(144, 2377.3127, 1953.8379, 6.0156, 217.2261, 5, 0, 24, 100, 0, 0);
	AddPlayerClass(222, 2376.5540, 1899.3405, 6.0156, 269.4488, 2, 0, 24, 100, 0, 0);
	AddPlayerClass(214, 2373.4443, 1825.4421, 6.0156, 322.5071, 6, 0, 24, 100, 0, 0);
	AddPlayerClass(260, 2410.8357, 1839.2723, 6.0156, 5.9563, 3, 0, 24, 100, 0, 0);

	AddStaticPickup(1242, 2, 2377.6072, 1886.8319, 11.6563); // Armour
	AddStaticPickup(1242, 2, 2402.5603, 1826.4650, 11.6563); // Armour

	AddStaticPickup(349, 2, 2451.3704, 1921.6823, 10.8647); // Shotgun
	AddStaticPickup(352, 2, 2459.0981, 1923.2078, 10.8647); // Micro Uzi
	AddStaticPickup(349, 2, 2459.9519, 1905.4021, 10.8647); // Shotgun
	AddStaticPickup(352, 2, 2450.9202, 1904.0183, 10.8647); // Micro Uzi
	AddStaticPickup(355, 2, 2455.2363, 1911.8583, 10.8647); // AK-47
	
	AddStaticPickup(361, 2, 2477.8452, 1921.6162, 13.4845); // Flame Thrower
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 2458.4585, 1738.9915, 21.2344);
	SetPlayerFacingAngle(playerid, 185.5126);
	SetPlayerCameraPos(playerid, 2459.0149, 1733.2311, 21.2344);
	SetPlayerCameraLookAt(playerid, 2458.4585, 1738.9915, 21.2344);
	SetWorldTime(12);
	ShowNameTags(1);
	return 1;
}

public OnPlayerConnect(playerid)
{
	SetPlayerScore(playerid, 0);
	return 1;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerWorldBounds(playerid, 2497.9, 2371.2, 1963.6, 1782.8);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	SendDeathMessage(killerid, playerid, reason);
	return 1;
}

public LoopFunc()
{
	static Float:levels[] = {10.3, 13.1, 15.9, 18.7, 21.5, 24.3, 100.0};
	static rewards[] = {0, 1, 2, 3, 5, 7, 10};
	new Float:z;
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		if (IsPlayerConnected(i))
		{
			GetPlayerPos(i, z, z, z);
			for (new j = 1; j < sizeof (levels); j++)
			{
				if (levels[j] > z)
				{
					SetPlayerScore(i, GetPlayerScore(i) + rewards[j]);
					break;
				}
			}
		}
	}
}

public ExitTheGameMode()
{
	GameModeExit();
}