Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- //--Start Team deathmatch--//
- //--Do what ever you want to this script i don't care if you change credits--//
- _________ __ __ ___________________ _____
- / _____// |______ ________/ |_ ___________ \__ ___/\______ \ / \
- \_____ \\ __\__ \\_ __ \ __\/ __ \_ __ \ | | | | \ / \ / \
- / \| | / __ \| | \/| | \ ___/| | \/ | | | ` \/ Y \
- /_______ /|__| (____ /__| |__| \___ >__| |____| /_______ /\____|__ /
- \/ \/ \/ \/ \/
- */
- #include <a_samp>
- #include <zcmd>
- //---Variables---//
- new bool:HasPlayerSpawned[MAX_PLAYERS];
- new Text3D:labelone[MAX_PLAYERS];
- new Text3D:labeltwo[MAX_PLAYERS];
- new Text3D:labelthree[MAX_PLAYERS];
- new PlayerKills[MAX_PLAYERS] = 0;
- new Dominating[MAX_PLAYERS] = 0;
- new Team[MAX_PLAYERS];
- new Text:STDM;
- new PickSkin[MAX_PLAYERS];
- new string[128];
- //---Defines---//
- #define TEAM_1 0
- #define TEAM_2 1
- #define TEAM_3 2 // add more like TEAM_4 3 if you want to add more teams.
- #define RULESD 4000 // dialog
- #define HELPD 4010 // dialog
- #define CMDD 4020 // dialog
- #define CREDITSD 4030 // dialog
- #define ChooseSkin 4040 // dialog
- //---Colors---//
- #define COLOR_BLUE 0x0259EAAA
- #define COLOR_RED 0xFF0000AA
- #define COLOR_GREEN 0x16EB43FF
- #define COLOR_PURPLE 0xB360FDFF
- #define COLOR_PINK 0xCCFF00FF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_GREY 0xC0C0C0FF
- #define COLOR_ORANGE 0xFFA500FF
- #define COLOR_BROWN 0x800000FF
- #define COLOR_WHITE 0xFFFFFFAA
- #define ADMIN_RED 0xFF0000AA
- #define COLOR_LIGHTRED 0xFF8080FF
- #define COLOR_LIGHTBLUE 0x00C2ECFF
- //---Team Balancer---//
- stock GetPlayersInTeamFromMaxPlayers(teamid)
- {
- new playercount = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(HasPlayerSpawned[i] == false) continue;
- if(GetPlayerState(i) == PLAYER_STATE_NONE) continue;
- if(Team[i] != teamid) continue;
- playercount++;
- }
- return playercount;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Starter Team Deathmatch by Kitten <3");
- print("----------------------------------\n");
- }
- CMD:rules(playerid,params[]) {
- new Rules[1024];
- Rules[0]='\0';
- strcat(Rules, "{FFFFFF}Rule 1:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 2:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 3:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 4:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 5:{FFAF00} Rule heres\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 6:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 7:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 8:{FFAF00} Rule here\n", 1024 );
- strcat(Rules, "{FFFFFF}Rule 9:{FFAF00} Rule here\n", 1024 );
- ShowPlayerDialog(playerid,RULESD,DIALOG_STYLE_MSGBOX,"{FFFFFF}Server Rules",Rules,"Accept","Deny");
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- return 1;
- }
- CMD:help(playerid,params[]) {
- new Help[1024];
- Help[0]='\0';
- strcat(Help, "{FFFFFF} Welcome to My Server Name\n", 1024 );
- strcat(Help, "{6EF83C} blah blah blah blah\n", 1024 );
- strcat(Help, "{FFFFFF} always check the rules at /rules\n", 1024 );
- strcat(Help, "{6EF83C} blah blah blah blah? /cmds\n", 1024 );
- strcat(Help, "{FFFFFF} blah blah blah blah\n", 1024 );
- ShowPlayerDialog(playerid,HELPD,DIALOG_STYLE_MSGBOX,"{6EF83C}Server Help",Help,"Ok","Close");
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- return 1;
- }
- CMD:cmds(playerid,params[]) {
- new CommandsD[1024];
- CommandsD[0]='\0';
- strcat(CommandsD, "{FFAF00}Server Commands add here \n", 1024 );
- strcat(CommandsD, "{FFAF00}Server Commands add here \n", 1024 );
- ShowPlayerDialog( playerid, CMDD, DIALOG_STYLE_MSGBOX , " {00FF19}Server Public Commands " , CommandsD , "Ok" , "Close " ) ;
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- return 1;
- }
- CMD:credits(playerid,params[]) {
- new Credits[1024];
- Credits[0]='\0';
- strcat(Credits, "{FFFFFF}Kitten{FFAF00} Starter TDM Script\n", 1024 );
- ShowPlayerDialog( playerid, CREDITSD, DIALOG_STYLE_MSGBOX , " {00FF19}Server official credits " , Credits , "Ok" , "Close " ) ;
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- if(dialogid == 4000) { // Rules
- if(response) {
- SendClientMessage(playerid,COLOR_WHITE,"SERVER: thanks for accepting the rules.");
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- }
- else if(response == 0) {
- SendClientMessage(playerid,COLOR_WHITE,"SERVER: You been kicked for denying our rules bye.");
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- format(string, sizeof(string), "%s has been kicked for denying the rules.", name);
- SendClientMessageToAll(COLOR_GREEN, string);
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- Kick(playerid);
- }
- }
- if(dialogid == ChooseSkin) { // Choosing skin
- if(response) {
- new skinid, message[64];
- skinid = strval(inputtext);
- if(skinid < 0 || skinid > 299) {
- SendClientMessage(playerid, COLOR_GREEN, "SERVER: Skin id may be between 0 and 299.");
- ShowPlayerDialog(playerid, ChooseSkin, DIALOG_STYLE_INPUT, "{6EF83C} Please enter a skin id to contiune", "{FFFFFF}Enter the skin id you wish to have below", "Confirm", "Cancel");
- }
- else {
- SetPlayerSkin(playerid, skinid);
- format(message, sizeof(message), "SERVER: You have changed your skin id to %d.", skinid);
- SendClientMessage(playerid, COLOR_GREEN, message);
- PickSkin[playerid] = 0;
- }
- }
- }
- return 0;
- }
- public OnGameModeInit() {
- SetGameModeText("STDM 1.0");
- AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Team 1
- AddPlayerClass(1, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Team 2
- AddPlayerClass(2, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0); // Team 3
- //---Textdraws---//
- STDM = TextDrawCreate(500.000000, 10.000000, "Starter~r~ TDM");
- TextDrawBackgroundColor(STDM, 255);
- TextDrawFont(STDM, 1);
- TextDrawLetterSize(STDM, 0.500000, 1.000000);
- TextDrawColor(STDM, -1);
- TextDrawSetOutline(STDM, 0);
- TextDrawSetProportional(STDM, 1);
- TextDrawSetShadow(STDM, 1);
- return 1;
- }
- public OnGameModeExit()
- {
- TextDrawDestroy(STDM);
- TextDrawHideForAll(STDM);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid) {
- SetPlayerPos(playerid, -1959.4025,700.4174,46.5625);
- SetPlayerCameraPos(playerid, -1958.2029,711.0995,53.6375);
- SetPlayerCameraLookAt(playerid, -1959.4025,700.4174,46.5625);
- SetPlayerFacingAngle(playerid,357.4232);
- if(classid == 0) {
- GameTextForPlayer(playerid,"~r~ Team 1~n~~w~ Objective:~r~ Troll :)",1000,4);
- Team[playerid] = TEAM_1;
- }
- if(classid == 1) {
- GameTextForPlayer(playerid,"~g~ Teal 2~n~~w~ Objective:~g~ Troll (:",1000,4);
- Team[playerid] = TEAM_2;
- }
- if(classid == 2) {
- GameTextForPlayer(playerid,"~r~ Team 3~n~~w~ Objective:~r~ Troll =D",1000,4);
- Team[playerid] = TEAM_3;
- }
- return 1;
- }
- public OnPlayerRequestSpawn(playerid) {
- new team1 = GetPlayersInTeamFromMaxPlayers(TEAM_1);
- new team2 = GetPlayersInTeamFromMaxPlayers(TEAM_2);
- new team3 = GetPlayersInTeamFromMaxPlayers(TEAM_3);
- if(team1 > team2 && Team[playerid] == TEAM_1) {
- GameTextForPlayer(playerid, "~r~Team Full!~n~~w~Choose Another Team!", 3000, 5);
- return 0;
- }
- else if(team2 > team1 && Team[playerid] == TEAM_2) {
- GameTextForPlayer(playerid, "~r~Team Full!~n~~w~Choose Another Team!", 3000, 5);
- return 0;
- }
- else if(team3 > team2 && Team[playerid] == TEAM_3) {
- GameTextForPlayer(playerid, "~r~Team Full!~n~~w~Choose Another Team!", 3000, 5);
- return 0;
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PickSkin[playerid] = 1;
- HasPlayerSpawned[playerid] = false;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PickSkin[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- if(Team[playerid] == TEAM_1) {
- SetPlayerPos(playerid,-2458.2000,134.5419,35.1719);
- SetPlayerFacingAngle(playerid,303.9446);
- GivePlayerWeapon(playerid,24,100); // deagle
- GivePlayerWeapon(playerid,31,1000); // M4-Carbine
- SetPlayerColor(playerid,COLOR_RED); // team color = red
- labelone[playerid] = Create3DTextLabel("TEAM_1",COLOR_RED, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(labelone[playerid],playerid,0.0, 0.0, 0.7);
- }
- if(Team[playerid] == TEAM_2) {
- SetPlayerPos(playerid,-2796.6589,219.5733,7.1875);
- SetPlayerFacingAngle(playerid,88.8288);
- GivePlayerWeapon(playerid,24,100); // deagle
- GivePlayerWeapon(playerid,30,1000); // AK47
- SetPlayerColor(playerid,COLOR_WHITE); // team color = white
- labeltwo[playerid] = Create3DTextLabel("TEAM_2",COLOR_WHITE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(labeltwo[playerid],playerid,0.0, 0.0, 0.7);
- }
- if(Team[playerid] == TEAM_3) {
- SetPlayerPos(playerid,-2706.5261,397.7129,4.3672);
- SetPlayerFacingAngle(playerid,179.8611);
- GivePlayerWeapon(playerid,24,100); // deagle
- GivePlayerWeapon(playerid,25,1000); // Shotgun
- SetPlayerColor(playerid,COLOR_BLUE); // team color = blue
- labelthree[playerid] = Create3DTextLabel("TEAM_3",COLOR_BLUE, 30.0, 40.0, 50.0, 40.0, 0);
- Attach3DTextLabelToPlayer(labelthree[playerid],playerid,0.0, 0.0, 0.7);
- }
- //---Choosing your skin---//
- if(PickSkin[playerid] == 1) {
- ShowPlayerDialog(playerid, ChooseSkin, DIALOG_STYLE_INPUT, "{6EF83C} Please enter a skin id to contiune", "{FFFFFF}Enter the skin id you wish to have below", "Confirm", "Cancel");
- PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetPlayerScore(killerid,GetPlayerScore(killerid) +1);
- SendDeathMessage(killerid,playerid,reason);
- GivePlayerMoney(killerid,5000);
- new kName[128];
- GetPlayerName(killerid, kName, sizeof(kName));
- PlayerKills[killerid] = PlayerKills[killerid] + 1;
- PlayerKills[playerid] = 0;
- if (PlayerKills[killerid] == 4 && Dominating[killerid] == 1) {
- format(string, sizeof(string), "~r~%s is dominating!", kName);
- GivePlayerMoney(playerid,5000);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 6) {
- format(string, sizeof(string), "~r~%s is on rampage!", kName);
- GameTextForAll(string, 1000, 1);
- GivePlayerMoney(playerid,5000);
- return 1;
- }
- if (PlayerKills[killerid] == 8) {
- format(string, sizeof(string), "~r~%s is on killing spree!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 10) {
- format(string, sizeof(string), "~r~monster kill %s!", kName);
- GameTextForAll(string, 1000, 1);
- GivePlayerMoney(playerid,5000);
- return 1;
- }
- if (PlayerKills[killerid] == 12) {
- format(string, sizeof(string), "~r~%s is unstoppable!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 14) {
- format(string, sizeof(string), "~r~ultra kill %s!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 16) {
- format(string, sizeof(string), "~r~%s is godlike!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 18) {
- format(string, sizeof(string), "~r~wicked sick %s!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- if (PlayerKills[killerid] == 20) {
- format(string, sizeof(string), "~r~ludicrous kill %s!", kName);
- GameTextForAll(string, 1000, 1);
- GivePlayerMoney(playerid,50000);
- return 1;
- }
- if (PlayerKills[killerid] == 24) {
- format(string, sizeof(string), "~r~holy shit %s!", kName);
- GameTextForAll(string, 1000, 1);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment