All pastes #243747 Raw Edit

Mine

public text v1 · immutable
·published 2006-11-08 21:14 UTC
rendered paste body
#include <a_samp>
#include <core>
#include <float>
static gHour;

//Global stuff and defines for our gamemode
new gTeam[MAX_PLAYERS];

//Color Defines
#define COLOR_GREEN 0x33AA33AA
#define COLOR_GREY 0xAFAFAFAA

//Team Defines
#define TEAM_GROVE 0

main()
{
	print("\n---------------------------------------");
	print("  The Gangs of Los Santos by [NR]Luke");
	print("---------------------------------------\n");
}


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

public OnGameModeInit()
{
	SetGameModeText("The Gangs of Los Santos");
	SetTimer("ChangeTime", 60000,1);
	AddPlayerClass(107,2449.7056,-1692.3264,1013.5078,167.8490,0,0,0,0,0,0); // grove int 2
  	AddPlayerClass(0,2536.0571,-1674.5150,1015.4986,91.8100,0,0,0,0,0,0); // sweets int 1
	return 1;
}

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

public OnPlayerRequestClass(playerid, classid)
{
    SetupPlayerForClassSelection(playerid);
    SetPlayerTeamFromClass(playerid, classid);
	return 1;
}

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

public SetupPlayerForClassSelection(playerid)
{
	SetPlayerInterior(playerid,3);
	SetPlayerPos(playerid, -2666.9583,1428.6624,906.4609);
	SetPlayerFacingAngle(playerid, 180.0);
	SetPlayerCameraPos(playerid, -2666.9807,1425.2913,907.0000);
	SetPlayerCameraLookAt(playerid, -2666.9583,1428.6624,906.4609);
}

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

public SetPlayerTeamFromClass(playerid, classid)
{
	if(classid == 0)
	{
		gTeam[playerid] = TEAM_GROVE;
	}
	if(classid == 1)
	{
		gTeam[playerid] = TEAM_GROVE;
	}
}

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

public SetPlayerToTeamColor(playerid)
{
	if (gTeam[playerid] == TEAM_GROVE)
	{
		SetPlayerColor(playerid, COLOR_GREEN);
	}
}

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

public SetTeamSpawnToInterior(playerid)
{
    if (gTeam[playerid] == TEAM_GROVE)
    {
    SetPlayerInterior(playerid,2);
    }
    if (gTeam[playerid] == TEAM_GROVE)
    {
    SetPlayerInterior(playerid,1);
    }
}

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

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

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

public OnPlayerConnect(playerid)
{
	GameTextForPlayer(playerid, "~w~Welcome to ~n~~g~The Gangs of Los Santos",3000,3);
	SetPlayerColor(playerid, COLOR_GREY); // Set the player's color to inactive
	return 1;
}

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

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

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

public OnPlayerSpawn(playerid)
{
	SetPlayerToTeamColor(playerid);
 	SetTeamSpawnToInterior(playerid);
	return 1;
}

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

public OnPlayerDeath(playerid, killerid, 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, "/mycommand", true)==0)
	{
	    /* Do something here */
	    return 1;
	}
	return 0;
}

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

public TimeUpdate()
{
	static vartime = 12;
	vartime++;
	vartime %= 24;
	return SetWorldTime(vartime);
}

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

public ChangeTime(){
	if(gHour<24){
		gHour++;
	}
	else{
		gHour=1;
	}
	SetWorldTime(gHour);
}

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

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;
}

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