All pastes #133025 Raw Edit

Y_Less

public javascript v1 · immutable
#133025 ·published 2006-08-15 16:24 UTC
rendered paste body
#include <a_samp>#define ROUND_TIME 600000 // 10 minutes#define COLOR_YELLOW 0xFFFF00AAmain(){	print("\n====================================");	print("|                                  |");	print("|            Level Lord!           |");	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("Level Lord!");	AddPlayerClass(144, 2377.3127, 1953.8379, 6.0156, 217.2261, 5, 1, 24, 100, 0, 0);	AddPlayerClass(222, 2376.5540, 1899.3405, 6.0156, 269.4488, 2, 1, 24, 100, 0, 0);	AddPlayerClass(214, 2373.4443, 1825.4421, 6.0156, 322.5071, 6, 1, 24, 100, 0, 0);	AddPlayerClass(260, 2410.8357, 1839.2723, 6.0156, 5.9563, 3, 1, 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	SetWorldTime(12);	ShowNameTags(1);	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);	return 1;}public OnPlayerConnect(playerid){	SetPlayerScore(playerid, 0);	return 1;}public OnPlayerSpawn(playerid){	GameTextForPlayer(playerid, "~r~Get as high as you can to increase your score", 1000, 3);	SetPlayerWorldBounds(playerid, 2497.9, 2371.2, 1963.6, 1782.8);	return 1;}public OnPlayerDeath(playerid, killerid, reason){	SendDeathMessage(killerid, playerid, reason);	new score = GetPlayerScore(playerid);	score /= 2;	SetPlayerScore(playerid, score);	if (killerid != INVALID_PLAYER_ID)	{		SetPlayerScore(killerid, GetPlayerScore(killerid) + score);	}	return 1;}public OnPlayerCommandText(playerid, text[]){	if (strcmp(text, "/help", true) == 0)	{		SendClientMessage(playerid, COLOR_YELLOW, "   ");		SendClientMessage(playerid, COLOR_YELLOW, "Level Lord, by Alex \"Y_Less\" Cole");		SendClientMessage(playerid, COLOR_YELLOW, "   ");		SendClientMessage(playerid, COLOR_YELLOW, "- Get as high as you can in the time provided.");		SendClientMessage(playerid, COLOR_YELLOW, "- The higher you get the more points you get.");		SendClientMessage(playerid, COLOR_YELLOW, "- Killing other players also give you half their points.");		SendClientMessage(playerid, COLOR_YELLOW, "- There are no other commands, this is a simple yet fun mode.");		return 1;	}	return 0;}public LoopFunc(){	static Float:levels[] = {10.3, 13.1, 15.9, 18.7, 21.5, 24.3, 100.0};	static rewards[] = {-5, -10, 1, 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 = 0; j < sizeof (levels); j++)			{			    if (levels[j] > z)			    {			        SetPlayerScore(i, GetPlayerScore(i) + rewards[j]);			        break;			    }			}	    }	}}public ExitTheGameMode(){	GameModeExit();}