Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*------------------------------------------------------------------------------
- ,---. ,. , ,.
- | -' ,-. ,-. ,-. `| /| / ,-. ,-.
- | ,-' ,-| | | | | | / | / ,-| |
- `---| `-^ ' ' `-| `' `' `-^ '
- ,-.| ,| basic, simple, start with this one.
- `-+' `'
- -------------------------------------------------------------------------------*/
- #include <a_samp>
- //#include "../include/gl_common.inc"
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new rconAttempts[MAX_PLAYERS];
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new gTeam[MAX_PLAYERS];
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new SpamCheck[MAX_PLAYERS];
- new FloodCheck[MAX_PLAYERS];
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- //new total_vehicles_from_files=0;
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new Text:Textdraw50,
- Text:Textdraw51,
- Text:Textdraw52,
- Text:Textdraw53,
- Text:Textdraw54;
- new Dead[MAX_PLAYERS], Killedby[MAX_PLAYERS];
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- #define BLANC 0xFFFFFFC8
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- #define TEAM_GROVE 0
- #define TEAM_BALLAS 1
- #define TEAM_VAGOS 2
- #define TEAM_AZTECAS 3
- #define TEAM_COPS 4
- #define MAX_TEAMS 5
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new Float:gRandomSpawns[][] = //Grove
- {
- {2508.1748,-1684.6676,13.5584},
- {2498.8030,-1645.4890,13.5380},
- {2489.9597,-1647.0461,14.0772},
- {2459.4673,-1689.3765,13.5363}
- };
- new Float:bRandomSpawns[][] = //Ballas
- {
- {2092.3215,-1145.3455,25.5860},
- {2143.6028,-1172.0547,23.9922},
- {2153.8694,-1241.7596,25.2327}
- };
- new Float:cRandomSpawns[][] = //Cops
- {
- {1547.8885,-1669.1351,13.5666},
- {1577.2594,-1636.5551,13.5618},
- {1565.9746,-1694.1029,5.89060},
- {1546.6296,-1682.0840,13.5583}
- };
- new Float:vRandomSpawns[][] = //Vagos
- {
- {2347.6423,-1168.7085,27.9883},
- {2319.0576,-1168.7308,27.7298},
- {2359.5972,-1170.6938,28.0039},
- {2373.6902,-1141.2670,28.4669}
- };
- new Float:aRandomSpawns[][] = //Aztecas
- {
- {1894.1813,-2030.4396,13.5469},
- {1871.8584,-2030.2926,13.5469},
- {1883.2733,-2011.0006,13.5469},
- {1896.0953,-2037.8591,13.5469}
- };
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- new randomMessages[][] =
- {
- "Gamemode : place your random message @line 92",
- "Gamemode : place your random message @line 93",
- "Gamemode : place your random message @line 94"
- };
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- main()
- {
- print("\n-------------------------------------------------------------------");
- print(" Matnix basics Gang-War Script ");
- print("-------------------------------------------------------------------\n");
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnGameModeInit()
- {
- SetGameModeText("GangWar-Base");
- UsePlayerPedAnims();
- //-----------------------------------------------------------------------[GROVE]
- AddPlayerClass(105,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(106,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(107,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(195,0,0,0,0,0,0,0,0,0,0);
- //----------------------------------------------------------------------[AZTECA]
- AddPlayerClass(114,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(115,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(116,0,0,0,0,0,0,0,0,0,0);
- //------------------------------------------------------------------------[COPS]
- AddPlayerClass(280,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(284,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(285,0,0,0,0,0,0,0,0,0,0);
- //----------------------------------------------------------------------[BALLAS]
- AddPlayerClass(102,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(103,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(104,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(13,0,0,0,0,0,0,0,0,0,0);
- //-----------------------------------------------------------------------[VAGOS]
- AddPlayerClass(108,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(109,0,0,0,0,0,0,0,0,0,0);
- AddPlayerClass(110,0,0,0,0,0,0,0,0,0,0);
- //------------------------------------------------------------------------------
- /*==============================================================================
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
- ===============================================================================*/
- //------------------------------------------------------------------------------
- Textdraw50 = TextDrawCreate(0.000000, 0.000000, "LD_SPAC:white"); // Kill-cam (by Matnix)
- TextDrawLetterSize(Textdraw50, 0.000000, 0.000000);
- TextDrawTextSize(Textdraw50, 640.000000, 59.920001);
- TextDrawAlignment(Textdraw50, 1);
- TextDrawColor(Textdraw50, 255);
- TextDrawSetShadow(Textdraw50, 0);
- TextDrawSetOutline(Textdraw50, 0);
- TextDrawFont(Textdraw50, 4);
- Textdraw51 = TextDrawCreate(641.500000, 61.420001, "usebox");
- TextDrawLetterSize(Textdraw51, 0.000000, 42.741107);
- TextDrawTextSize(Textdraw51, -2.000000, 0.000000);
- TextDrawAlignment(Textdraw51, 1);
- TextDrawColor(Textdraw51, 0);
- TextDrawUseBox(Textdraw51, true);
- TextDrawBoxColor(Textdraw51, 102);
- TextDrawSetShadow(Textdraw51, 0);
- TextDrawSetOutline(Textdraw51, 0);
- TextDrawFont(Textdraw51, 0);
- Textdraw52 = TextDrawCreate(0.000000, 423.920013, "LD_SPAC:white");
- TextDrawLetterSize(Textdraw52, 0.000000, 0.000000);
- TextDrawTextSize(Textdraw52, 640.000000, 19.600006);
- TextDrawAlignment(Textdraw52, 1);
- TextDrawColor(Textdraw52, 255);
- TextDrawSetShadow(Textdraw52, 0);
- TextDrawSetOutline(Textdraw52, 0);
- TextDrawFont(Textdraw52, 4);
- Textdraw53 = TextDrawCreate(246.000000, 11.760004, "KILL - CAM");
- TextDrawLetterSize(Textdraw53, 0.784999, 3.644000);
- TextDrawAlignment(Textdraw53, 1);
- TextDrawColor(Textdraw53, -1378294017);
- TextDrawSetShadow(Textdraw53, 0);
- TextDrawSetOutline(Textdraw53, 1);
- TextDrawBackgroundColor(Textdraw53, 51);
- TextDrawFont(Textdraw53, 3);
- TextDrawSetProportional(Textdraw53, 1);
- Textdraw54 = TextDrawCreate(54.500000, 425.599914, "Spawn in five seconds.");
- TextDrawLetterSize(Textdraw54, 0.350500, 1.488000);
- TextDrawAlignment(Textdraw54, 1);
- TextDrawColor(Textdraw54, -1378294017);
- TextDrawSetShadow(Textdraw54, 0);
- TextDrawSetOutline(Textdraw54, 1);
- TextDrawBackgroundColor(Textdraw54, 51);
- TextDrawFont(Textdraw54, 1);
- TextDrawSetProportional(Textdraw54, 1);
- SetTimer("RandomMessage",180000,1); // each 3min
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnGameModeExit()
- {
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerCameraPos(playerid, 207.1526, -39.3834, 1002.8735);
- SetPlayerCameraLookAt(playerid, 207.5223, -38.4558, 1002.6689);
- SetPlayerPos(playerid,209.20, -34.24, 1001.93);
- SetPlayerFacingAngle(playerid, 180.0);
- SetPlayerInterior(playerid,1);
- SetPlayerTeamFromClass(playerid, classid);
- switch (classid)
- {
- case 0,1,2,3://GROVE
- {
- if(classid == 0 || classid == 1 || classid == 2 || classid == 3)
- {
- GameTextForPlayer(playerid,"~g~Grove",800,6);
- }
- }
- case 4,5,6://AZTECA
- {
- if(classid == 4 || classid == 5 || classid == 6)
- {
- GameTextForPlayer(playerid,"~b~Azteca",800,6);
- }
- }
- case 7,8,9://COPS
- {
- if(classid == 7 || classid == 8 || classid == 9)
- {
- GameTextForPlayer(playerid,"~b~Police",800,6);
- }
- }
- case 10,11,12,13://BALLAS
- {
- if(classid == 10 || classid == 11 || classid == 12 || classid == 13)
- {
- GameTextForPlayer(playerid,"~p~Ballas",800,6);
- }
- }
- case 14,15,16://VAGOS
- {
- if(classid == 14 || classid == 15 || classid == 16)
- {
- GameTextForPlayer(playerid,"~y~Vagos",800,6);
- }
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- SetPlayerTeamFromClass(playerid, classid)
- {
- ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0,0,0,0,0,0);
- if (classid == 0 ||classid == 1 ||classid == 2 ||classid == 3)
- {
- gTeam[playerid] = TEAM_GROVE;
- }
- else if(classid == 4 ||classid == 5 ||classid == 6)
- {
- gTeam[playerid] = TEAM_AZTECAS;
- }
- else if(classid == 7 ||classid == 8 ||classid == 9)
- {
- gTeam[playerid] = TEAM_COPS;
- }
- else if(classid == 10 ||classid == 11 ||classid == 12 ||classid == 13)
- {
- gTeam[playerid] = TEAM_BALLAS;
- }
- else if(classid == 14 ||classid == 15 ||classid == 16)
- {
- gTeam[playerid] = TEAM_VAGOS;
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerConnect(playerid)
- {
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerText(playerid, text[])
- {
- new string[256], Nom[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nom, sizeof (Nom));
- if(text[0] == '!') // !TEXT private gang.
- {
- for(new i; i < MAX_PLAYERS; i++)
- {
- if(gTeam[playerid] == gTeam[i])
- {
- format(string,sizeof(string),"[New Gang Message] (%s) said : %s", Nom,text[1]);
- SendClientMessage(i,0x7fff00FF,string);
- }
- }
- return 0;
- }
- if(IsPlayerFlooding(playerid) && !IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid,BLANC,"Anti-Spam TEXT");
- return 0;
- }
- FloodCheck[playerid] = GetTickCount();
- if(gTeam[playerid] == TEAM_GROVE)
- {
- format(string,sizeof(string), "{80F547}Grove{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
- SendClientMessageToAll(-1, string);
- return 0;
- }
- else if(gTeam[playerid] == TEAM_BALLAS)
- {
- format(string,sizeof(string), "{9A35FF}Ballas{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
- SendClientMessageToAll(-1, string);
- return 0;
- }
- else if(gTeam[playerid] == TEAM_VAGOS)
- {
- format(string,sizeof(string), "{FECD38}Vagos{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
- SendClientMessageToAll(-1, string);
- return 0;
- }
- else if(gTeam[playerid] == TEAM_AZTECAS)
- {
- format(string,sizeof(string), "{0DFFFF}Aztecas{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
- SendClientMessageToAll(-1, string);
- return 0;
- }
- else if(gTeam[playerid] == TEAM_COPS)
- {
- format(string,sizeof(string), "{42C1FF}Cops{FFFFFF} {ABD3C5}%s{FFFFFF} says: {FFFFFF}%s", Nom, text);
- SendClientMessageToAll(-1, string);
- return 0;
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerSpawn(playerid)
- {
- SetPlayerHealth(playerid, 9999);
- SetTimer("AntiSpawnkill", 5000,1); // change it to your seconds mine is (5) 5000ms = 5scd
- if(gTeam[playerid] == TEAM_GROVE)
- {
- GivePlayerWeapon(playerid, 24, 150), GivePlayerWeapon(playerid, 27, 200),
- GivePlayerWeapon(playerid, 31, 400), GivePlayerWeapon(playerid, 32, 300),
- GivePlayerWeapon(playerid, 16, 5);
- new rand = random(sizeof(gRandomSpawns));
- SetPlayerPos(playerid, gRandomSpawns[rand][0], gRandomSpawns[rand][1], gRandomSpawns[rand][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0x2291FF90);
- return 1;
- }
- if(gTeam[playerid] == TEAM_BALLAS)
- {
- GivePlayerWeapon(playerid, 24, 200), GivePlayerWeapon(playerid, 25, 300),
- GivePlayerWeapon(playerid, 34, 50), GivePlayerWeapon(playerid, 18, 5),
- GivePlayerWeapon(playerid, 28, 400);
- new rand = random(sizeof(bRandomSpawns));
- SetPlayerPos(playerid, bRandomSpawns[rand][0], bRandomSpawns[rand][1], bRandomSpawns[rand][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0x9A35FF90);
- return 1;
- }
- if(gTeam[playerid] == TEAM_VAGOS)
- {
- GivePlayerWeapon(playerid, 24, 200), GivePlayerWeapon(playerid, 26, 210),
- GivePlayerWeapon(playerid, 33, 50), GivePlayerWeapon(playerid, 18, 5);
- new rand = random(sizeof(vRandomSpawns));
- SetPlayerPos(playerid, vRandomSpawns[rand][0], vRandomSpawns[rand][1], vRandomSpawns[rand][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0xE1C41E90);
- return 1;
- }
- if(gTeam[playerid] == TEAM_AZTECAS)
- {
- GivePlayerWeapon(playerid, 22, 250), GivePlayerWeapon(playerid, 26, 210),
- GivePlayerWeapon(playerid, 29, 300), GivePlayerWeapon(playerid, 34, 50),
- GivePlayerWeapon(playerid, 16, 5);
- new rand = random(sizeof(aRandomSpawns));
- SetPlayerPos(playerid, aRandomSpawns[rand][0], aRandomSpawns[rand][1], aRandomSpawns[rand][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0x05C5E790);
- return 1;
- }
- if(gTeam[playerid] == TEAM_COPS)
- {
- GivePlayerWeapon(playerid, 22, 250), GivePlayerWeapon(playerid, 25, 200),
- GivePlayerWeapon(playerid, 29, 300), GivePlayerWeapon(playerid, 31, 300),
- GivePlayerWeapon(playerid, 16, 5);
- new rand = random(sizeof(cRandomSpawns));
- SetPlayerPos(playerid, cRandomSpawns[rand][0], cRandomSpawns[rand][1], cRandomSpawns[rand][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerColor(playerid, 0x2291FF90);
- return 1;
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetPlayerScore(killerid,GetPlayerScore(playerid)+1);
- GivePlayerMoney(killerid, 500);
- GivePlayerMoney(playerid, -50);
- SendDeathMessage(killerid,playerid,reason);
- Dead[playerid] = 1;
- if(Dead[playerid] == 1)
- {
- Dead[playerid] = 0;
- if(Killedby[playerid] != INVALID_PLAYER_ID)
- TogglePlayerSpectating(playerid, 1);
- PlayerSpectatePlayer(playerid, killerid);
- TextDrawShowForPlayer(playerid, Textdraw50), TextDrawShowForPlayer(playerid, Textdraw51),
- TextDrawShowForPlayer(playerid, Textdraw52), TextDrawShowForPlayer(playerid, Textdraw53),
- TextDrawShowForPlayer(playerid, Textdraw54);
- SetTimerEx("KillCam", 5000, false, "i", playerid);
- }
- else
- {
- TogglePlayerSpectating(playerid, 0);
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(GetTickCount() - SpamCheck[playerid] < 10000 && SpamCheck[playerid] != 0)
- {
- SendClientMessage(playerid,BLANC,"Anti-Commands SPAMN");
- return 1;
- }
- if (strcmp("/yourcmds", cmdtext, true, 10) == 0)
- {
- SpamCheck[playerid] = GetTickCount(); //anti-commands-spam
- // if he spam this commands he will get the message "Anti-Commands SPAM"
- return 1;
- }
- return 0;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
- {
- // antiteamkill_
- new Float:Health;
- GetPlayerHealth(playerid, Health);
- if(gTeam[issuerid] == gTeam[playerid])
- {
- GetPlayerHealth(playerid, Health);
- SetPlayerHealth(playerid, Health+amount);
- }
- // damageinfo_
- if(issuerid != INVALID_PLAYER_ID)
- {
- new string[128];
- format(string, sizeof(string), "~b~+%.0f ~w~dammage", amount);
- GameTextForPlayer(issuerid, string, 5000, 1);
- PlayerPlaySound(issuerid, 1057, 0.0, 0.0, 0.0);
- format(string, sizeof(string), "~r~-%.0f ~w~dammage", amount);
- GameTextForPlayer(playerid, string, 5000, 1);
- PlayerPlaySound(playerid, 4203, 0.0, 0.0, 0.0);
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
- {
- new veh = GetPlayerVehicleID(playerid);
- new Float:x,Float:y,Float:z = GetPlayerPos(playerid,x,y,z);
- SetPlayerArmedWeapon(playerid, 0);
- for(new i;i<MAX_PLAYERS<i++;)
- {
- if(IsPlayerInVehicle(i,veh) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerTeam(i) == GetPlayerTeam(playerid))
- {
- SetPlayerPos(playerid,x,y,z+2);
- GameTextForPlayer(playerid,"~r~ANTI-TEAM JACK", 2000,4);
- }
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(!success)
- {
- new playersIP[17], playerid;
- for(; playerid < MAX_PLAYERS; playerid++)
- {
- GetPlayerIp(playerid, playersIP, 17);
- if(!strcmp(ip, playersIP))
- {
- break;
- }
- }
- rconAttempts[playerid]++;
- if(rconAttempts[playerid] >= 2)
- {
- Ban(playerid);
- }
- }
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- forward KillCam(playerid);
- public KillCam(playerid)
- {
- TogglePlayerSpectating(playerid, 0);
- TextDrawHideForPlayer(playerid, Textdraw50), TextDrawHideForPlayer(playerid, Textdraw51),
- TextDrawHideForPlayer(playerid, Textdraw52), TextDrawHideForPlayer(playerid, Textdraw53),
- TextDrawHideForPlayer(playerid, Textdraw54);
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- forward AntiSpawnkill(playerid);
- public AntiSpawnkill(playerid)
- {
- SetPlayerHealth(playerid, 100.0);
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- forward RandomMessage();
- public RandomMessage()
- {
- new randomMsg = random(sizeof(randomMessages));
- SendClientMessageToAll(BLANC, randomMessages[randomMsg]);
- return 1;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
- stock IsPlayerFlooding(playerid)
- {
- if(GetTickCount() - FloodCheck[playerid] < 2000)
- return 1;
- return 0;
- }
- //------------------------------------------------------------------------------
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement