rendered paste body#include <a_samp>
static gTeam[MAX_PLAYERS];
#define TEAM_BASEBALL 1
#define TEAM_DIEHARDFAN 2
#define TEAM_BASEBALL_COLOR 0x00FF00AA // Bright Green (in RGBA format)
#define TEAM_DIEHARDFAN_COLOR 0xFF00FFAA // Bright Purple
#define TEAM_POLICE 3
#define TEAM_POLICE_COLOR 0x1111AAFF
#define COLOR_RED 0xAA3333AA
//---------------------------------------------------------
main()
{
print("\n----------------------------------");
print(" BaseBall War");
print("----------------------------------\n");
}
//---------------------------------------------------------
public OnGameModeInit()
{
print("GameModeInit()");
SetGameModeText("BBWAR");
//BASEBALL
AddPlayerClass(195, 1380.6936, 2158.9534, 11.0234, 103.1759, 5, 0, 0, 0, 0, 0);
//DIEHARDFAN
AddPlayerClass(184, 1414.6588, 2140.0095, 19.8438, 124.8430, 3, 1, 0, 0, 0, 0);
AddPlayerClass(188, 1414.9174, 2181.6282, 19.8438, 94.4260, 3, 1, 0, 0, 0, 0);
AddPlayerClass(223, 1415.0934, 2120.3333, 19.8438, 268.9544, 3, 1, 0, 0, 0, 0);
AddPlayerClass(28, 1328.7094, 2215.1731, 19.4063, 95.3894, 3, 1, 0, 0, 0, 0);
AddPlayerClass(230, 1413.0887, 2198.6057, 12.0156, 251.1903, 3, 1, 0, 0, 0, 0);
//POLICE
AddPlayerClass(227, 1398.8644, 2173.4131, 15.0625, 230.7511, 1, 3, 22, 0, 0, 0);
AddPlayerClass(280, 2294.8701, 2460.6716, 10.5426, 359.2695, 1, 3, 22, 100, 32, 50);
AddStaticVehicle(562,2040.3105,1342.8018,10.3317,3.3304,17,1);//
AddStaticVehicle(596,2259.2422,2478.6328,10.5399,2.0418,17,1);//
AddStaticVehicle(420,2074.5378,1330.8604,10.3301,358.1079,17,1);//
GameTextForAll("Welcome to BaseBall War! Scripted by [AC]FrozenX", 1000, 1);
return 1;
}
//---------------------------------------------------------
public OnPlayerRequestClass(playerid, classid)
{
printf("OnPlayerRequestClass(%d, %d)", playerid, classid);
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
//---------------------------------------------------------
public SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 1)
{
gTeam[playerid] = TEAM_BASEBALL;
}
if (classid == 2)
{
gTeam[playerid] = TEAM_DIEHARDFAN;
}
else
{
gTeam[playerid] = TEAM_POLICE;
}
}
//---------------------------------------------------------
public OnGameModeExit()
{
print("GameModeExit()");
return 1;
}
//---------------------------------------------------------
public OnPlayerConnect(playerid)
{
printf("OnPlayerConnect(%d)", playerid);
GameTextForPlayer(playerid,"~w~SA:MP Las Ventarus Deathmatch Grove vs. Ballas!",4000,3);
return 1;
}
//---------------------------------------------------------
public OnPlayerDisconnect(playerid)
{
printf("OnPlayerDisconnect(%d)", playerid);
return 1;
}
//---------------------------------------------------------
public OnPlayerSpawn(playerid)
{
printf("OnPlayerSpawn(%d)", playerid);
SetPlayerToTeamColor(playerid);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 1000);
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, "/help", true)==0)
{
SendClientMessage(playerid, COLOR_RED, "This is the GameMode BaseBall War. There are some handy commands!");
SendClientMessage(playerid, COLOR_RED, "/duty: Let see you what you must do. /help: let see you this message.");
return 1;
}
if(strcmp(cmdtext, "/duty", true)==0)
{
if(gTeam[playerid] == TEAM_BASEBALL) {
SendClientMessage(playerid, COLOR_RED, "Stand Alive! And don't kill the police! They defend you. The Die-Hard Fans wil try to kill you!");
}
if(gTeam[playerid] == TEAM_DIEHARDFAN) {
SendClientMessage(playerid, COLOR_RED, "Kill that BaseBall Players and the Police, they want to kill you!");
}
if(gTeam[playerid] == TEAM_POLICE) {
SendClientMessage(playerid, COLOR_RED, "Kill the Die-Hard Fans, and defend the BaseBall Players!");
}
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;
}
//---------------------------------------------------------
public SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_BASEBALL) SetPlayerColor(playerid, TEAM_BASEBALL_COLOR);
if (gTeam[playerid] == TEAM_DIEHARDFAN) SetPlayerColor(playerid, TEAM_DIEHARDFAN_COLOR);
if (gTeam[playerid] == TEAM_POLICE) SetPlayerColor(playerid, TEAM_POLICE_COLOR);
}
//---------------------------------------------------------