Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Noob Vs Mafias Updated By Kitten
- #include <a_samp>
- // check teams
- static gTeam[MAX_PLAYERS];
- // teams
- #define TEAM_NOOB 0
- #define TEAM_MAFIA 1
- // Varaibles
- new Noobscore;
- new Mafiascore;
- new GameMinutes =9;
- new GameSeconds =59;
- new GameTimer;
- new Text:Textdraw0;
- new Text:scores;
- // GM Time
- #define MAX_GM_TIME 480000
- // TEAM COLORS
- #define TEAM_MAFIA_COLOR 0x77CC77FF
- #define TEAM_NOOB_COLOR 0x7777DDFF
- // FORWARDS
- forward ScoreUpdate();
- forward ScoreCheck(playerid);
- forward SetupPlayerForClassSelection(playerid);
- forward KillUpdate(playerid);
- forward GameTime();
- stock Noob(playerid)
- {
- SetPlayerColor(playerid,TEAM_NOOB_COLOR);
- }
- stock Mafia(playerid)
- {
- SetPlayerColor(playerid,TEAM_MAFIA_COLOR);
- }
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Noob VS Mafia Team Deathmatch By KITTEN");
- print("----------------------------------\n");
- }
- #endif
- public OnGameModeInit()
- {
- // Don't use these lines if it's a filterscript
- SetGameModeText("Noob Vs Mafia 1 by Kiten");
- AddPlayerClass(153,-783.6561,496.1938,1376.1953,88.7245,24,100,32,1000,35,1); // noobs
- AddPlayerClass(120,-831.9264,506.3343,1358.2749,255.1027,24,100,32,1000,35,1); // mafia
- ShowNameTags(1);
- SetWorldTime(0);
- UsePlayerPedAnims();
- ShowPlayerMarkers(0);
- SetTimer("Finsh",600000,true);
- GameTimer = SetTimer("GameTime",1000,1);
- SetTimer("KillUpdate", 1000, true);
- SetTimer("ScoreUpdate", 1000, true);
- SetTimer("ScoreCheck", 1000, true);
- Textdraw0 = TextDrawCreate(86.000000,427.000000,"9:00");
- TextDrawAlignment(Textdraw0,2);
- TextDrawBackgroundColor(Textdraw0,0x000000ff);
- TextDrawFont(Textdraw0,3);
- TextDrawLetterSize(Textdraw0,0.499999,2.000000);
- TextDrawColor(Textdraw0,0xffffffff);
- TextDrawSetOutline(Textdraw0,1);
- TextDrawSetProportional(Textdraw0,1);
- TextDrawSetShadow(Textdraw0,1);
- return 1;
- }
- public OnGameModeExit()
- {
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetupPlayerForClassSelection(playerid);
- switch (classid) {
- case 0:
- {
- GameTextForPlayer(playerid, "~r~Noobs", 1200, 3);
- }
- case 1:
- {
- GameTextForPlayer(playerid, "~g~ Mafias", 1200, 3);
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new string[64], pName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string,sizeof string,"%s has joined the [Test Server]!",pName);
- SendClientMessageToAll(0xFFFFFFAA,string);
- GameTextForPlayer(playerid,"~r~ Weclome choose a team",6000,5);
- return 1;
- }
- public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,11);
- SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
- SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
- SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
- SetPlayerFacingAngle(playerid,0.0);
- }
- public OnPlayerSpawn(playerid)
- {
- if(gTeam[playerid] == TEAM_NOOB)
- {
- SendClientMessage(playerid,0xFFFFFFAA,"TEAM:Noob: You objective to beat the Mafias to 20 kills first team to win");
- GivePlayerWeapon(playerid,29,600);
- SetPlayerTeam(playerid,0);
- Noob(playerid);
- SetPlayerInterior(playerid,1);
- TextDrawShowForPlayer(playerid, Textdraw0);
- }
- else if(gTeam[playerid] == TEAM_MAFIA)
- {
- SendClientMessage(playerid,0xFFFFFFAA,"TEAM:Mafia: You objective to beat the Noob to 20 kills first team to win");
- GivePlayerWeapon(playerid,29,600);
- SetPlayerTeam(playerid,0);
- SetPlayerInterior(playerid,1);
- Mafia(playerid);
- TextDrawShowForPlayer(playerid, Textdraw0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid == TEAM_MAFIA)
- {
- Mafiascore += 1;
- }
- if(killerid == TEAM_NOOB)
- {
- Noobscore += 1;
- }
- SendDeathMessage(killerid,playerid,reason);
- SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public ScoreUpdate()
- {
- new string[100];
- TextDrawHideForAll(Text:scores);
- format(string,sizeof(string),"~w~Mafia:%d ~w~Noobs:%d", Mafiascore,Noobscore);
- scores = TextDrawCreate(271.000000,400.000000,string);
- TextDrawTextSize(scores,200.000000,0.000000);
- TextDrawSetOutline(scores,1);
- TextDrawSetShadow(scores,1);
- TextDrawShowForAll(Text:scores);
- }
- public ScoreCheck(playerid)
- {
- if (Noobscore >= 20) {
- Noobscore = 0;
- Mafiascore = 0;
- GameTextForAll("~g~Noobs has won",6000,5);
- SetPlayerHealth(playerid, 0);
- SetTimer("Finsh",MAX_GM_TIME,true);
- }
- if (Mafiascore >= 25) {
- Noobscore = 0;
- Mafiascore = 0;
- GameTextForAll("~r~Mafias has won",6000,5);
- SetPlayerHealth(playerid, 0);
- }
- }
- forward Finsh();
- public Finsh()
- {
- SendRconCommand("gmx");
- return 1;
- }
- public GameTime()
- {
- if(GameSeconds || GameMinutes)
- {
- GameSeconds--;
- if(GameSeconds <= -1)
- {
- GameMinutes--;
- GameSeconds=59;
- }
- new TimeString[14];
- format(TimeString,sizeof(TimeString),"%02d:%02d",GameMinutes,GameSeconds);
- TextDrawSetString(Textdraw0,TimeString);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement