Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*---------------------------------------------------------------------------------------------------\*
- || ||
- || | | | _____| | \ / | ||
- || | | | |_____ | |\ \ / /| | ||
- || | | | _____ | | | \ \ / / | | ||
- || | |_____ ______| | | | \ \ / | | ||
- || |_______| |________| |_| \__/ |_| ||
- || ||
- ||-------------------------------------------------------------------------------------------------- ||
- ||===================================================================================================||
- || Los Santos Madness has been created by Matthias aka GTA_Rules ||
- || You are not allowed to edit and republish it without my permission! ||
- \*===================================================================================================*/
- #include <a_samp>
- #include <core>
- #include <float>
- #pragma tabsize 0
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_BRIGHTRED 0xFF0000AA
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_GRAD1 0xB4B5B7FF
- #define INACTIVE_PLAYER_ID 255
- #define NUMVALUES 4
- #define TEAM_GROVE 1
- #define TEAM_BALLA 2
- #define TEAM_GROVE_COLOR 0x33AA33AA
- #define TEAM_BALLA_COLOR 0x800080AA
- forward SetupPlayerForClassSelection(playerid);
- forward GameModeExitFunc();
- forward SendPlayerFormattedText(playerid, const str[], define);
- forward public SendAllFormattedText(playerid, const str[], define);
- forward GetPlayersScores();
- forward ResetScore();
- forward BlastBomb();
- forward gmxtimer();
- forward GlobalAnnouncement();
- new Float:X, Float:Y, Float:Z;
- new gClass[MAX_PLAYERS];
- new gTeam[MAX_PLAYERS];
- new Text:Textdraw0;
- new Text:Score;
- new GroveVeh;
- new BallasVeh;
- new grovescore;
- new ballasscore;
- new dynamite;
- new Msg;
- new Announcements[5][128] = {
- "| Announcement: | This gamemode has been created by Matthias aka GTA_Rules!",
- "| Announcement: | Feel like blowing something? Use /bomb!",
- "| Announcement: | To fully enjoy LSM, read /help!",
- "| Announcement: | Make sure you check /goal!",
- "| Announcement: | Check /info if you have any questions about the gamemode!"
- };
- main()
- {
- print("\n|---------------------------------------------|");
- print("\n|------- Los Santos Madness - [ V 1.0 ] ------|");
- print("\n|---- Scripted by Matthias aka. GTA_Rules ----|");
- print("\n|---------------------------------------------|");
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerConnect(playerid)
- {
- new string[64], name[24];
- SendClientMessage(playerid, COLOR_YELLOW, "Welcome to Los Santos Madness, make sure you check out /help!");
- GameTextForPlayer(playerid,"~g~Los Santos Madness ~r~ ~n~ [V 1.0] ~n~ ~b~ by ~w~ Matthias Van Eeghem!",5000,5);
- ScoreUpdate();
- GetPlayerName( playerid, name, 24 );
- format( string, sizeof( string ), "%s (ID: %d) has joined the server.", name, playerid );
- SendClientMessageToAll( COLOR_GRAD1, string );
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerDisconnect(playerid,reason)
- {
- new string[64], name[24];
- GetPlayerName( playerid, name, 24 );
- switch (reason)
- {
- case 0: { format(string, 256, "*** %s has left the server (Timeout)", name); SendClientMessageToAll(COLOR_GRAD1, string); }
- case 1: { format(string, 256, "*** %s has left the server (Leaving)", name); SendClientMessageToAll(COLOR_GRAD1, string); }
- case 2: { format(string, 256, "*** %s has left the server (Kicked)", name); SendClientMessageToAll(COLOR_GRAD1, string); }
- }
- TextDrawHideForPlayer(playerid, Textdraw0);
- TextDrawHideForPlayer(playerid, Score);
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new cmd[256];
- new idx, tString[256];
- new tmp[256];
- cmd = strtok(cmdtext, idx);
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/help", true) == 0) {
- SendClientMessage(playerid, COLOR_YELLOW, "--- Los Santos Madness: Help ---");
- SendClientMessage(playerid, COLOR_WHITE, "Make sure you follow all the /rules");
- SendClientMessage(playerid, COLOR_WHITE, "Have any questions about the gamemode? Read /info!");
- SendClientMessage(playerid, COLOR_WHITE, "Read the commandlist in /commands!");
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/info", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp))
- {
- SendClientMessage(playerid,COLOR_YELLOW, "Usage: /info [info topic]");
- SendClientMessage(playerid,COLOR_BRIGHTRED, "Info topics: goal, bomb, ending, credits, gangcar.");
- return 1;
- }
- if(strcmp(tmp, "goal", true) == 0){
- SendClientMessage(playerid, COLOR_YELLOW, "--- Goal info ---");
- SendClientMessage(playerid, COLOR_WHITE, "Your goal is to kill as much enemy gang members as possible.");
- SendClientMessage(playerid, COLOR_WHITE, "For any info about the gang car check /info gangcar!");
- }else if(strcmp(tmp, "bomb", true) == 0){
- SendClientMessage(playerid, COLOR_YELLOW, "--- Bomb info ----");
- SendClientMessage(playerid, COLOR_WHITE, "Use /bomb to create a bomb. It will set a timer from 10 seconds.");
- SendClientMessage(playerid, COLOR_WHITE, "Afer those seconds it will blow anything in that area. You need 10.000$ to buy a bomb!");
- }else if(strcmp(tmp, "ending", true) == 0){
- SendClientMessage(playerid, COLOR_YELLOW, "--- Ending of the gamemode ---");
- SendClientMessage(playerid, COLOR_WHITE, "The gamemode ends when one of the teams has 50 kills. It will automatically restart after that.");
- }else if(strcmp(tmp, "credits", true) == 0){
- SendClientMessage(playerid, COLOR_YELLOW, "--- Credits ---");
- SendClientMessage(playerid, COLOR_WHITE, "The gamemode and its idea has been created by GTA_Rules aka Matthias");
- SendClientMessage(playerid, COLOR_WHITE, "I would like to thank a few people for their help though:");
- SendClientMessage(playerid, COLOR_WHITE, "Fireburn, Marcel, Wesley, Boylett, Westie, MenaceX, Pandabeer, TheAlpha, Pugwipe, Ry5a.");
- }else if(strcmp(tmp, "gangcar", true) == 0){
- SendClientMessage(playerid, COLOR_YELLOW, "--- Gang car info ---");
- SendClientMessage(playerid, COLOR_WHITE, "It's quite simple, you just need to steal the other gang's car and get it to the checkpoint.");
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/rules", true) == 0) {
- SendClientMessage(playerid, COLOR_RED, "--- The rules ---");
- SendClientMessage(playerid, COLOR_WHITE,"1. Do not flame any other player / admin.");
- SendClientMessage(playerid, COLOR_WHITE,"2. Don't cheat or you'll get banned.");
- SendClientMessage(playerid, COLOR_WHITE,"3. Do not bug abuse.");
- SendClientMessage(playerid, COLOR_WHITE,"4. Make sure you only speak English in mainchat!");
- SendClientMessage(playerid, COLOR_WHITE,"5. Do not teamkill!");
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/commands", true) == 0) {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_YELLOW, "--- Commands ---");
- SendClientMessage(playerid, COLOR_WHITE,"/kill /switchteam /help /info /bomb /adminhelp");
- }
- else
- {
- SendClientMessage(playerid, COLOR_YELLOW, "--- Commands ---");
- SendClientMessage(playerid, COLOR_WHITE,"/kill /switchteam /help /info /bomb");
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/adminhelp", true) == 0) {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, COLOR_YELLOW, "Admin commands:");
- SendClientMessage(playerid, COLOR_WHITE, "/resetgrove /resetballas /resetscores /givegrove /giveballas");
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- new playercash;
- playercash = GetPlayerMoney(playerid);
- if(strcmp(cmd, "/bomb", true) == 0) {
- if (playercash < 10000) {
- SendClientMessage(playerid, COLOR_BRIGHTRED, "You need at least 10.000$ to buy a bomb!");
- }
- else
- {
- GetPlayerPos(playerid, X, Y, Z);
- dynamite = CreateObject( 1654, X, Y, Z, 0, 0, 96 );
- GivePlayerMoney(playerid,-10000);
- SendClientMessage(playerid, COLOR_BRIGHTRED, "Bomb planted! 10 seconds till detonation!");
- SetTimer("BlastBomb", 10000, 0);
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/announce", true) == 0)
- {
- if(IsPlayerAdmin(playerid))
- {
- new length = strlen(cmdtext);
- while ((idx < length) && (cmdtext[idx] <= ' '))
- {
- idx++;
- }
- new offset = idx;
- new result[64];
- while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
- {
- result[idx - offset] = cmdtext[idx];
- idx++;
- }
- result[idx - offset] = EOS;
- if(!strlen(result))
- {
- SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /announce [TEXT]");
- return 1;
- }
- format(tString,sizeof(tString), "| Announcement: | %s", result);
- SendClientMessageToAll(COLOR_YELLOW,tString);
- return 1;
- }
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/resetgrove", true) == 0) {
- {
- if(IsPlayerAdmin(playerid))
- {
- grovescore = 0;
- ScoreUpdate();
- SendClientMessage(playerid, COLOR_GREEN, "You have reset the Grove's score!");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/resetballas", true) == 0) {
- {
- if(IsPlayerAdmin(playerid))
- {
- ballasscore = 0;
- ScoreUpdate();
- SendClientMessage(playerid, COLOR_GREEN, "You have reset the Ballas' score!");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/giveballas", true) == 0) {
- {
- if(IsPlayerAdmin(playerid))
- {
- ballasscore ++;
- ScoreUpdate();
- SendClientMessage(playerid, COLOR_GREEN, "You haven given the Ballas gang one point!");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/givegrove", true) == 0) {
- {
- if(IsPlayerAdmin(playerid))
- {
- grovescore ++;
- ScoreUpdate();
- SendClientMessage(playerid, COLOR_GREEN, "You haven given the Grove gang one point!");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/resetscores", true) == 0) {
- {
- if(IsPlayerAdmin(playerid))
- {
- grovescore = 0, ballasscore = 0;
- ScoreUpdate();
- SendClientMessage(playerid, COLOR_GREEN, "You have reset the team scores!");
- SendClientMessageToAll(0xFF0000AA, "An admin has reset the team scores!");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if(strcmp(cmd, "/kill", true) == 0) {
- {
- SetPlayerHealth(playerid,0.0);
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- if (strcmp(cmdtext, "/changeteam", true) == 0)
- {
- ForceClassSelection(playerid);
- SetPlayerHealth(playerid,0);
- return 1;
- }
- return 0;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerSpawn(playerid)
- {
- new Data[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Data, sizeof(Data));
- if(strcmp(Data, "adminname1") == 0)
- // This function gives admins special spawnstuff, now he spawns with another colour (yellow) and the same weapons as players have.
- // Add or changes names here EG: Uncomment the line below if you want to add another admin's name.
- // if(strcmp(Data, "adminname2") == 0)
- {
- SetPlayerColor(playerid,0xFFFF00AA);
- GivePlayerWeapon(playerid, 24, 500);
- GivePlayerWeapon(playerid, 27, 500);
- GivePlayerWeapon(playerid, 29, 500);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 34, 500);
- SetPlayerHealth(playerid, 100.0);
- SetPlayerArmour(playerid, 100.0);
- }
- else
- {
- GivePlayerWeapon(playerid, 24, 500);
- GivePlayerWeapon(playerid, 27, 500);
- GivePlayerWeapon(playerid, 29, 500);
- GivePlayerWeapon(playerid, 31, 500);
- GivePlayerWeapon(playerid, 34, 500);
- SetPlayerHealth(playerid, 100.0);
- SetPlayerArmour(playerid, 100.0);
- SetPlayerToTeamColor(playerid);
- }
- if(gTeam[playerid] == TEAM_GROVE)
- {
- SetPlayerTeam(playerid, 1 );
- }
- if(gTeam[playerid] == TEAM_BALLA)
- {
- SetPlayerTeam(playerid, 2 );
- }
- Textdraw0 = TextDrawCreate(455.000000,6.000000,"Los Santos Madness");
- TextDrawAlignment(Textdraw0,0);
- TextDrawBackgroundColor(Textdraw0,0x000000ff);
- TextDrawFont(Textdraw0,3);
- TextDrawLetterSize(Textdraw0,0.499999,1.500000);
- TextDrawColor(Textdraw0,0xffffffff);
- TextDrawSetOutline(Textdraw0,1);
- TextDrawSetProportional(Textdraw0,1);
- TextDrawSetShadow(Textdraw0,7);
- for(new i=0; i<MAX_PLAYERS; i++ )
- {
- TextDrawShowForPlayer( i , Textdraw0);
- }
- SetPlayerMapIcon( playerid, 0, 2529.4207,-1667.4916,15.1687, 62, 0 );
- SetPlayerMapIcon( playerid, 1, 2277.2932,-1644.9403,15.2888, 59, 0 );
- SetVehicleParamsForPlayer(GroveVeh,playerid,1,0);
- SetVehicleParamsForPlayer(BallasVeh,playerid,1,0);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerDeath(playerid, killerid, reason)
- {
- // ----------------------------------------------------------------------------------------------------------------------//
- // The killboard on the right side of your screen.
- new playercash;
- if(killerid == INVALID_PLAYER_ID) {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
- ResetPlayerMoney(playerid);
- }
- else
- {
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- playercash = GetPlayerMoney(playerid);
- if (playercash > 0) {
- GivePlayerMoney(killerid, playercash);
- ResetPlayerMoney(playerid);
- }
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // Anti-Team kill.
- if(gTeam[killerid] == gTeam[playerid])
- {
- SetPlayerHealth(killerid,0.0);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // Score board.
- if (gTeam[playerid] == TEAM_GROVE)
- {
- ballasscore++;
- ScoreUpdate();
- if (ballasscore > 49)
- {
- GameTextForAll("~w~Team: ~r~ Ballas ~g~ has won the battle!",5000,5);
- SendClientMessageToAll(COLOR_BRIGHTRED, "-------------------------------------------------");
- SendClientMessageToAll(COLOR_YELLOW, "*** The ballas have won the battle! ***");
- SendClientMessageToAll(COLOR_BRIGHTRED, "-------------------------------------------------");
- SendClientMessageToAll(COLOR_GREEN, "The gamemode will restart in 10 seconds!");
- SetTimer("gmxtimer", 10000, 0);
- }
- }
- else if(gTeam[playerid] == TEAM_BALLA)
- {
- grovescore++;
- ScoreUpdate();
- if (grovescore > 49)
- {
- GameTextForAll("~w~Team: ~r~ Grove ~g~ has won the battle!",5000,5);
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------");
- SendClientMessageToAll(COLOR_YELLOW, "*** Grove Street has won the battle! ***");
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------");
- SendClientMessageToAll(COLOR_GREEN, "The gamemode will restart in 10 seconds!");
- SetTimer("gmxtimer", 10000, 0);
- }
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // Give money to the killer and send him a message telling him he's real pro.
- new name[MAX_PLAYER_NAME];
- new string[256];
- GetPlayerName(playerid, name, sizeof(name));
- GivePlayerMoney(killerid, 2500);
- format(string, sizeof(string), "You have recieved 2500$ because you have killed %s", name);
- SendClientMessage(killerid, COLOR_GREEN, string);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerText(playerid, text[])
- {
- new string[256];
- new playername[MAX_PLAYER_NAME];
- if(text[0] == '!' && text[1] != 0)
- {
- GetPlayerName( playerid, playername, MAX_PLAYER_NAME );
- format( string, 128, "(Team) %s: %s", playername, text[1] );
- for(new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected(i) && gTeam[playerid] == gTeam[i] )
- SendClientMessage( i, COLOR_LIGHTBLUE, string );
- }
- return 0;
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerTeamFromClass(playerid, classid);
- {
- if(classid == 0 || classid == 1 || classid == 2)
- {
- gTeam[playerid] = TEAM_GROVE;
- }
- if(classid == 3 || classid == 4 || classid == 5)
- {
- gTeam[playerid] = TEAM_BALLA;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- }
- SetupPlayerForClassSelection(playerid);
- gClass[playerid] = classid;
- if(classid==0||classid==1||classid==2) {
- SetPlayerTeam( playerid, 1 );
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,2473.2205,-1686.0530,13.5078);
- SetPlayerFacingAngle(playerid,140.4312);
- SetPlayerCameraPos(playerid,2470.3530,-1689.5225,15.0139);
- SetPlayerCameraLookAt(playerid,2473.2205,-1686.0530,13.5078);}
- else if(classid==3||classid==4||classid==5){
- SetPlayerTeam( playerid, 2 );
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,2304.0139,-1666.7949,14.6378);
- SetPlayerFacingAngle(playerid, 234.2924);
- SetPlayerCameraPos(playerid,2306.7917,-1668.7916,16.1490);
- SetPlayerCameraLookAt(playerid,2304.0139,-1666.7949,14.6378);
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,2304.0139,-1666.7949,14.6378);
- SetPlayerFacingAngle(playerid, 234.2924);
- SetPlayerCameraPos(playerid,2306.7917,-1668.7916,16.1490);
- SetPlayerCameraLookAt(playerid,2304.0139,-1666.7949,14.6378);
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public GameModeExitFunc()
- {
- GameModeExit();
- TextDrawDestroy(Score);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnGameModeInit()
- {
- UsePlayerPedAnims();
- DisableInteriorEnterExits();
- SetTeamCount( 2 );
- SetGameModeText("LSM [V 1.0]");
- Msg = 0;
- SetTimer("GlobalAnnouncement",240000,true);
- {
- Score = TextDrawCreate(430.000000,426.000000,"Grove: 0 Ballas: 0");
- TextDrawUseBox(Score,1);
- TextDrawBoxColor(Score,0x000000ff);
- TextDrawTextSize(Score,630.000000,-63.000000);
- TextDrawAlignment(Score,0);
- TextDrawBackgroundColor(Score,0x000000ff);
- TextDrawFont(Score,3);
- TextDrawLetterSize(Score,0.499999,1.600000);
- TextDrawColor(Score,0xffffffff);
- TextDrawSetOutline(Score,1);
- TextDrawSetProportional(Score,1);
- TextDrawSetShadow(Score,1);
- }
- SetDisabledWeapons( 35, 36, 37, 38 );
- // ----------------------------------------------------------------------------------------------------------------------//
- AddPlayerClass(105,2522.6033,-1686.5757,13.5559,129.4222,0,0,0,0,0,0); // Class 0
- AddPlayerClass(106,2510.7986,-1652.9185,13.7826,129.4222,0,0,0,0,0,0); // Class 1
- AddPlayerClass(107,2505.8765,-1671.9095,13.3707,129.4222,0,0,0,0,0,0); // Class 2
- AddPlayerClass(102,2317.2354,-1641.3617,18.5078,129.4222,0,0,0,0,0,0); // Class 3
- AddPlayerClass(103,2286.0066,-1677.5298,14.4154,129.4222,0,0,0,0,0,0); // Class 4
- AddPlayerClass(104,2282.0984,-1646.5436,15.1955,129.4222,0,0,0,0,0,0); // Class 5
- // Ballas vehicles
- AddStaticVehicle(487,2315.7729,-1638.7750,18.5078,129.4222,5,5);
- AddStaticVehicle(492,2304.7229,-1644.6184,14.5144,177.9258,5,5);
- AddStaticVehicle(466,2289.6328,-1677.7441,14.3119,0.2875,5,5);
- AddStaticVehicle(474,2281.3538,-1676.5109,14.6565,357.4675,5,5);
- AddStaticVehicle(463,2271.2124,-1645.9006,15.3752,176.6958,5,5);
- AddStaticVehicle(474,2326.4841,-1665.2937,13.5664,356.7219,5,5);
- AddStaticVehicle(474,2327.5735,-1651.6378,13.5306,181.8045,5,5);
- // Grove Vehicles
- AddStaticVehicle(487,2530.3992,-1677.9027,20.1067,89.1924,16,16);
- AddStaticVehicle(492,2505.9202,-1694.8972,13.5577,2.6050,16,16);
- AddStaticVehicle(466,2509.5576,-1672.7853,13.3953,358.0190,16,16);
- AddStaticVehicle(474,2502.4800,-1655.3014,13.4876,96.0932,16,16);
- AddStaticVehicle(463,2472.8840,-1691.9714,13.5145,358.0189,16,16);
- AddStaticVehicle(474,2462.9023,-1665.8018,13.2103,1.1254,16,16);
- AddStaticVehicle(466,2463.9902,-1653.0697,13.1279,179.8575,16,16);
- AddStaticVehicle(474,2494.6772,-1683.8680,13.1655,95.1767,16,16);
- // The important black cars
- GroveVeh = AddStaticVehicleEx(529,2529.4207,-1667.4916,15.1687,89.9236,0,0,90);
- BallasVeh = AddStaticVehicleEx(529,2277.2932,-1644.9403,15.2888,176.8414,0,0,90);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- new numero = GetPlayerVehicleID(playerid);
- if(numero == BallasVeh)
- {
- if(gTeam[playerid] == TEAM_BALLA)
- {
- SendClientMessage(playerid,0xFF0000AA, "You can't steal your own gang car!");
- RemovePlayerFromVehicle(playerid);
- }
- else if(gTeam[playerid] == TEAM_GROVE)
- {
- new grovename[MAX_PLAYER_NAME];
- new str[256];
- GetPlayerName(playerid, grovename, sizeof(grovename));
- SetPlayerCheckpoint(playerid, 2412.2483,-1854.1670,1.1559, 6.5);
- SendClientMessage(playerid, 0x33AA33AA, "You have stolen Ballas' gang vehicle! Get it to the checkpoint!");
- format(str, sizeof(str), "*** %s (Gang Grove) is stealing Ballas' gang vehicle! ***", grovename);
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------------------------------------------");
- SendClientMessageToAll(COLOR_YELLOW, str);
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------------------------------------------");
- }
- }
- else if(numero == GroveVeh)
- {
- if(gTeam[playerid] == TEAM_GROVE)
- {
- SendClientMessage(playerid,0xFF0000AA, "You can't steal your own gang car!");
- RemovePlayerFromVehicle(playerid);
- }
- else if(gTeam[playerid] == TEAM_BALLA)
- {
- new ballasname[MAX_PLAYER_NAME];
- new str[256];
- GetPlayerName(playerid, ballasname, sizeof(ballasname));
- SendClientMessage(playerid, 0x33AA33AA, "You have stolen the Grove's gang vehicle! Get it to the checkpoint!");
- SetPlayerCheckpoint(playerid, 2412.2483,-1854.1670,1.1559, 6.5);
- format(str, sizeof(str), "*** %s (Gang Ballas) is stealing Grove's gang vehicle! ***", ballasname);
- SendClientMessageToAll(COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------");
- SendClientMessageToAll(COLOR_YELLOW, str);
- SendClientMessageToAll(COLOR_BRIGHTRED, "-----------------------------------------------------------------------------------------");
- }
- }
- }
- else if(newstate == PLAYER_STATE_ONFOOT)
- {
- DisablePlayerCheckpoint(playerid);
- SetVehicleParamsForPlayer(GroveVeh,playerid,0,0);
- SetVehicleParamsForPlayer(BallasVeh,playerid,0,0);
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public SendPlayerFormattedText(playerid, const str[], define)
- {
- new tmpbuf[256];
- format(tmpbuf, sizeof(tmpbuf), str, define);
- SendClientMessage(playerid, 0xFF004040, tmpbuf);
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public SendAllFormattedText(playerid, const str[], define)
- {
- new tmpbuf[256];
- format(tmpbuf, sizeof(tmpbuf), str, define);
- SendClientMessageToAll(0xFFFF00AA, tmpbuf);
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public OnPlayerEnterCheckpoint(playerid)
- {
- new currentveh;
- new str[256];
- new playername[MAX_PLAYER_NAME];
- if(IsPlayerInAnyVehicle(playerid)){
- {
- GivePlayerMoney(playerid, 10000);
- GetPlayerName(playerid, playername, sizeof(playername));
- SendClientMessage(playerid, 0x33AA33AA, "You have succesfully stolen the other gang's vehicle and therefore you earned 10.000$!");
- currentveh = GetPlayerVehicleID(playerid);
- SetVehicleToRespawn(currentveh);
- DisablePlayerCheckpoint(playerid);
- PlayerPlaySound(playerid, 1058, 2412.2483,-1854.1670,1.1559);
- format(str, sizeof(str), "*** %s has stolen the other gang's vehicle! ***", playername);
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------------------------------");
- SendClientMessageToAll(COLOR_YELLOW, str);
- SendClientMessageToAll(COLOR_BRIGHTRED, "----------------------------------------------------------------------------");
- }
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- SetPlayerTeamFromClass(playerid, classid)
- {
- if(classid == 0 || classid == 1 || classid == 2)
- {
- gTeam[playerid] = TEAM_GROVE;
- }
- if(classid == 3 || classid == 4 || classid == 5)
- {
- gTeam[playerid] = TEAM_BALLA;
- }
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- SetPlayerToTeamColor(playerid)
- {
- if (gTeam[playerid] == TEAM_GROVE)
- {
- SetPlayerColor(playerid, TEAM_GROVE_COLOR);
- }
- else if (gTeam[playerid] == TEAM_BALLA)
- {
- SetPlayerColor(playerid, TEAM_BALLA_COLOR);
- }
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- ScoreUpdate()
- {
- new string[256];
- format(string, sizeof(string), "Grove: %d Ballas: %d", grovescore, ballasscore);
- TextDrawSetString(Score, string);
- TextDrawShowForAll(Score);
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public BlastBomb() // The /bomb timer
- {
- CreateExplosion(X, Y, Z, 10, 38.0);
- DestroyObject(dynamite);
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public gmxtimer() // Server restart timer after one of the teams reaches 50 points.
- {
- SendRconCommand("gmx");
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- public GlobalAnnouncement()
- {
- switch (Msg)
- {
- case 0: {SendClientMessageToAll(COLOR_YELLOW,Announcements[0]); Msg++;}
- case 1: {SendClientMessageToAll(COLOR_YELLOW,Announcements[1]); Msg++;}
- case 2: {SendClientMessageToAll(COLOR_YELLOW,Announcements[2]); Msg++;}
- case 3: {SendClientMessageToAll(COLOR_YELLOW,Announcements[3]); Msg++;}
- case 4: {SendClientMessageToAll(COLOR_YELLOW,Announcements[4]); Msg = 0;}
- }
- return 1;
- }
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------- End of the Gamemode -------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
- // ----------------------------------------------------------------------------------------------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment