Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // |------------------------------------|
- // | |
- // | Military Operations |
- // | A Warzone RP Script |
- // | By Chris Bluman |
- // | http://theasylumhangout.com |
- // | |
- // |------------------------------------|
- #include <a_samp>
- #include <core>
- #include <float>
- #define SANG 0 // San Andreas National Guard
- #define APLF 1 // Andrean Public Liberation Front
- #define COLOR_GAME 0xFFFFFFFF
- #define COLOR_CHAT 0xCCFFCCAA
- #define COLOR_ADMIN 0x0000FFAA
- #define COLOR_COMMAND 0x800000AA
- #define COLOR_SANG 0x4CBB17AA
- #define COLOR_APLF 0x008080AA
- #define COLOR_BROWN 0x964B00AA
- #define DIALOG_LOCKER 1
- new gTeam[MAX_PLAYERS];
- main()
- {
- print("\n------------------------");
- print("Military Operations v0.09");
- print("------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("CBCWAR v0.09");
- ShowPlayerMarkers(0);
- ShowNameTags(1);
- AddPlayerClass(287,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
- AddPlayerClass(285,-183.5194,1090.8673,19.7422,52.6484,0,0,0,0,0,0); // Revise Coords
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid,COLOR_GAME,"Welcome to Military Operations.");
- SendClientMessage(playerid,COLOR_GAME,"Military Operations is a warzone roleplay server.");
- SendClientMessage(playerid,COLOR_GAME,"Use {FF0000}/help {FFFFFF}and {FF0000}/commands {FFFFFF}for more help.");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/credits", true))
- {
- SendClientMessage(playerid,COLOR_GAME, "SERVER: Created by Chris Bluman with assistance from Brian Wright of The Asylum.");
- return 1;
- }
- if(strcmp(cmdtext, "/locker", true))
- {
- if(IsPlayerInRangeOfPoint(playerid, 5,2497.2693,-1676.9578,13.3398)) // Revise Coords
- {
- ShowPlayerDialog(playerid, DIALOG_LOCKER, DIALOG_STYLE_LIST, "Armory Locker", "First Aid Kit\nKevlar Armour\nSilenced Pistol\nDesert Eagle\nPump Shotgun\nSpas 12\nMP5\nAK47\nM4A1\nSniper Rifle\nRPG\nHS-RPG\nGrenade\nC4\nBinoculars\nParachute", "Add to Gear", "Close Locker");
- return 1;
- }
- }
- if(strcmp(cmdtext, "/enter", true) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2,-179.8969,1087.9668,19.7422)) // Revise Coords
- {
- if(gTeam[playerid] == 1)
- {
- SetPlayerInterior(playerid, 11);
- SetPlayerPos(playerid, 501.980987,-69.150199,988.757812); // Revise Coords
- SendClientMessage(playerid, COLOR_SANG, "Welcome to the Barracks");
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_BROWN, "This door is restricted to SANG.");
- return 1;
- }
- }
- }
- if(strcmp(cmdtext, "/exit", true) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 2,501.980987,-69.150199,988.757812)) // Revise Coords
- {
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, -179.8969,1087.9668,19.7422); // Revise Coords
- return 1;
- }
- }
- return 0;
- }
- SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,14);
- SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
- SetPlayerFacingAngle(playerid,360.0);
- SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
- SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234); // Revise Coords
- }
- SetPlayerTeamFromClass(playerid, classid)
- {
- if(classid == 0)
- {
- gTeam[playerid] = SANG;
- }
- if(classid == 1)
- {
- gTeam[playerid] = APLF;
- }
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetupPlayerForClassSelection(playerid);
- SetPlayerTeamFromClass(playerid, classid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(gTeam[playerid] == SANG)
- {
- SetPlayerInterior(playerid,0);
- TogglePlayerClock(playerid,0);
- SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
- SetPlayerColor(playerid, COLOR_SANG);
- return 1;
- }
- else if(gTeam[playerid] == APLF)
- {
- SetPlayerInterior(playerid,0);
- TogglePlayerClock(playerid,0);
- SetPlayerPos(playerid,2497.2693,-1676.9578,13.3398); // Revise Coords
- SetPlayerColor(playerid, COLOR_APLF);
- return 1;
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_LOCKER)
- {
- if(response) // Selected an object
- {
- if(listitem == 0) // First Aid Kit
- {
- SetPlayerHealth(playerid, 100.0);
- return 1;
- }
- if(listitem == 1) // Kevlar Armour
- {
- SetPlayerArmour(playerid, 100.0);
- return 1;
- }
- if(listitem == 2) // Silenced Pistol
- {
- GivePlayerWeapon(playerid, 23, 50);
- }
- if(listitem == 3) // Desert eagle
- {
- GivePlayerWeapon(playerid, 24, 50);
- }
- if(listitem == 4) // Pump Shotgun
- {
- GivePlayerWeapon(playerid, 25, 50);
- }
- if(listitem == 5) // Spas-12
- {
- GivePlayerWeapon(playerid, 27, 57);
- }
- if(listitem == 6) // MP5
- {
- GivePlayerWeapon(playerid, 29, 200);
- }
- if(listitem == 7) // AK47
- {
- GivePlayerWeapon(playerid, 30, 200);
- }
- if(listitem == 8) // M4A1
- {
- GivePlayerWeapon(playerid, 31, 200);
- }
- if(listitem == 9) // Sniper Rifle
- {
- GivePlayerWeapon(playerid, 34, 75);
- }
- if(listitem == 10) // RPG
- {
- GivePlayerWeapon(playerid, 35, 5);
- }
- if(listitem == 11) // HS-RPG
- {
- GivePlayerWeapon(playerid, 36, 5);
- }
- if(listitem == 12) // C4
- {
- GivePlayerWeapon(playerid, 39, 5);
- }
- if(listitem == 13) // Binoculars
- {
- GivePlayerWeapon(playerid, 43, 1);
- }
- if(listitem == 14) // Parachute
- {
- GivePlayerWeapon(playerid, 46, 1);
- }
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement