IFG : Insane Family Gangsters Forum Index
IFG : Insane Family Gangsters
Server Team DeathMatch : 188.138.79.5:8500
 
IFG : Insane Family Gangsters Forum IndexFAQSearchRegisterLog in

:: bring mw2 to samp xD ::

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    IFG : Insane Family Gangsters Forum Index -> IFG : English Part -> Bug/Idea Server
Previous topic :: Next topic  

yes or no?
yes
100%
 100%  [ 6 ]
no
0%
 0%  [ 0 ]
Total Votes : 6

Author Message
[IFG]Joekey
IFG Member
IFG Member

Offline

Joined: 11 Jun 2010
Posts: 836

PostPosted: Fri 8 Oct - 16:02 (2010)    Post subject: bring mw2 to samp xD Reply with quote

i have a idea for our server
is CTF "capture the flag" possible in our server?

how does it work?
basiclly, if you play CTF in MW2 you should know how to play xD


more info: http://wiki.sa-mp.com/wiki/Capture_the_Flag
http://il.youtube.com/watch?v=dTw2hIr4U9Y
http://il.youtube.com/watch?v=8A5DaGhJMxI&feature=related
_________________


Last edited by [IFG]Joekey on Mon 6 Dec - 21:43 (2010); edited 1 time in total
Back to top
Visit poster’s website
Publicité






PostPosted: Fri 8 Oct - 16:02 (2010)    Post subject: Publicité

PublicitéSupprimer les publicités ?
Back to top
[IFG]YaRecon
IFG Member
IFG Member

Offline

Joined: 24 Mar 2010
Posts: 1,206
Localisation: Apple Universe
Masculin Poissons (20fev-20mar)

PostPosted: Fri 8 Oct - 19:56 (2010)    Post subject: bring mw2 to samp xD Reply with quote

Just found that on samp forums ( a gamemode!)
Just must be fitted into a simple filterscript huhm

 
Quote:

/*
                                {{//]]]]           ---    Vehicle Capture The Flag    ---          [[[[\\}}

                                                             // Scripted by \\
                                                                  Assyria
                                                        ===========================


                                                       
***** This script is in 5 days & scripted 100% by Assyria
**** Inspired by Unreal Tournament 2004 CTF, Instabig CTF & Vehicle CTF
*** Basic idea is to steal enemys flag and return it to your base
** Scripted using dcmd & sscanf
* Lines 1617


+-+-+-+-+-+-+-+-:

- You have all rights to modify & use this script.
- It is recommended to use some premade admin script while using this.
- Removing /credits command will destroy the script and it is not usable if you delete it.
- You can think yourself if that is a fact or lie Wink


Note:

This script is scripter when I had scripted only two months.
Credits to Jochemd for learning me the basics of pawn scripting two months ago.

*/
                                                             
#include <a_samp>

#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ERROR 0x870000FF
#define DARK_RED 0xC30000FF
#define COLOR_BLUE 0x5676BEFF
#define COLOR_GREEN 0x46A184FF
#define LightBlue 0x00B9FFFF
#define NiceOrange 0xFFBE00FF

#define MoonGravity 0.005 // Change this to 0.008 for normal gravity.
#define MaxScore 3 // Change this to max amount of scores you want.
#define RedTeamSkin 34 // Change this to any skin ID what you want to team red to have.
#define BlueTeamSkin 217 // Chage this to any skin ID what you want to team blue to have.
#define WorldBounds -782.4177, -1634.903, -770.7397, -1775.037 // You can disable world boundaries, by setting the parameters to 20000, -20000, 20000, -20000

//===      TEAM COLORS    === ///

#define RED_TEAM_COLOR 0xAF0000FF
#define RED_TEAM_FLAGHOLDER 0xFFFA00FF // Blue Flagholders radar color
#define BLUE_TEAM_COLOR 0x004BFFFF
#define BLUE_TEAM_FLAGHOLDER 0xC800FFFF // Red Flagholders radar color


//===         Flag Things        === ///

new RedFlagStolen;
new BlueFlagStolen;
new RedFlagDropt;
new BlueFlagDropt;
new RedFlag;
new BlueFlag;
new RedFlagOnGround;
new BlueFlagOnGround;
new ReturnBlueFlagHere;
new ReturnRedFlagHere;
new Redflagp;
new Blueflagp;

// - Player stuff

new HoldingRedFlag[MAX_PLAYERS];
new HoldingBlueFlag[MAX_PLAYERS];
new PlayerKills[MAX_PLAYERS];
new PlayerDeaths[MAX_PLAYERS];
new PlayerCapturedFlags[MAX_PLAYERS];
new StatsHelper[MAX_PLAYERS];
new IsSpectating[MAX_PLAYERS];
new TeamSwitchv[MAX_PLAYERS];
new IsInTour[MAX_PLAYERS];

// - Score stuff

new RedTeamScore;
new BlueTeamScore;
new RedGameScore[10];
new BlueGameScore[10];
new StatsTimer;

// - TextDraws

new Text:ScoreTextDraw;
new Text:RedTextDraw;
new Text:BlueTextDraw;
new Text:EnemyTextDraw;

// - Gang zones & something

new RedArea;
new BlueArea;
new FReturn;

// - Pickups

new RedAmmoAssaultRifle;
new RedAmmoAssaultRifle2;
new RedAmmoShotgun;
new RedAmmoShotgun2;
new BlueAmmoAssaultRifle;
new BlueAmmoAssaultRifle2;
new BlueAmmoCombatShotgun;
new SniperPickup1;
new SniperPickup2;
new SniperPickup3;
new SniperPickup4;
new TowerPickup;
new Rocket;
new Adrenaline1;
new Adrenaline2;
new Adrenaline3;
new Adrenaline4;
new Adrenaline5;
new Adrenaline6;
new Adrenaline7;
new Adrenaline8;
new Adrenaline9;
new Armour;
new Armour2;

// Spawns

new Float:TeamRedSpawn[][4] = {
{-1431.9561, -1504.0321, 101.7216, 183.0},
{-1435.8563, -1542.6812, 101.7578, 90.0}
};

new Float:TeamBlueSpawn[][4] = {
{-1099.1714, -1081.1549, 129.2188},
{-1085.2618, -1147.9940, 129.2188}
};

//

new Float:tX,Float:tY,Float:tZ;

main()
{
    print("\n~~~~~~~~~~-----***-----~~~~~~~~~~");
    print(" Assyria's Vehicle Capture The Flag ");
    print("_____________________________________\n");
}

public OnGameModeInit()
{
    SetGravity(MoonGravity);
    DisableInteriorEnterExits();
    RedArea = GangZoneCreate(-1473.1564, -1603.1145, -1396.3658, -1439.1011);
     BlueArea = GangZoneCreate(-1214.499, -1214.499, -945.9079, -1062.687);
    AddPlayerClass(RedTeamSkin,-1423.3628,-1504.3754,105.0391,202.1755,0,0,0,0,0,0);
    AddPlayerClass(BlueTeamSkin,-1110.7806,-1097.1586,129.2188,190.1447,0,0,0,0,0,0);
    RedFlag = CreateObject(2993,-1423.013549,-1502.117065,101.123245,0.000000,0.000000,5.654280);
    Redflagp = CreatePickup(0,23,-1423.013549,-1502.117065,101.123245, 0);
    BlueFlag = CreateObject(2993,-1111.215,-1093.225,129.218,0.000000,0.000000,5.654280);
    Blueflagp = CreatePickup(0,23,-1111.215,-1093.225,129.218, 0);
    ReturnRedFlagHere = CreatePickup(1277, 23, -1111.1620,-1090.4094,129.2188, 0);
    ReturnBlueFlagHere = CreatePickup(1277, 23, -1423.1871,-1499.5109,101.6719, 0);
    RedTeamScore = 0;
    BlueTeamScore = 0;
   
    ScoreTextDraw = TextDrawCreate(291.000000, 11.000000, "Score");
    TextDrawBackgroundColor(ScoreTextDraw, 255);
    TextDrawFont(ScoreTextDraw, 1);
    TextDrawLetterSize(ScoreTextDraw, 0.659999, 2.000000);
    TextDrawColor(ScoreTextDraw, -1);
    TextDrawSetOutline(ScoreTextDraw, 0);
    TextDrawSetProportional(ScoreTextDraw, 1);
    TextDrawSetShadow(ScoreTextDraw, 1);
   
    // Red Team Score
    format(RedGameScore,sizeof(RedGameScore),"%d",RedTeamScore);
    RedTextDraw = TextDrawCreate(261.000000, 27.000000, RedGameScore);
    TextDrawBackgroundColor(RedTextDraw, 255);
    TextDrawFont(RedTextDraw, 1);
    TextDrawLetterSize(RedTextDraw, 0.659999, 2.000000);
    TextDrawColor(RedTextDraw, -16776961);
    TextDrawSetOutline(RedTextDraw, 0);
    TextDrawSetProportional(RedTextDraw, 1);
    TextDrawSetShadow(RedTextDraw, 1);

    // Blue Team Score
    format(BlueGameScore,sizeof(BlueGameScore),"%d",BlueTeamScore);
    BlueTextDraw = TextDrawCreate(363.000000, 27.000000, BlueGameScore);
    TextDrawBackgroundColor(BlueTextDraw, 255);
    TextDrawFont(BlueTextDraw, 1);
    TextDrawLetterSize(BlueTextDraw, 0.659999, 2.000000);
    TextDrawColor(BlueTextDraw, 65535);
    TextDrawSetOutline(BlueTextDraw, 0);
    TextDrawSetProportional(BlueTextDraw, 1);
    TextDrawSetShadow(BlueTextDraw, 1);
   
    EnemyTextDraw = TextDrawCreate(323.000000, 122.000000, "Enemy has your flag, recover it!");
    TextDrawBackgroundColor(EnemyTextDraw, 255);
    TextDrawFont(EnemyTextDraw, 2);
    TextDrawLetterSize(EnemyTextDraw, 0.390000, 1.600000);
    TextDrawColor(EnemyTextDraw, -1694498561);
    TextDrawSetOutline(EnemyTextDraw, 1);
    TextDrawSetProportional(EnemyTextDraw, 1);
   
    SetTimer("EnemyTextDrawf",3000,true);
   
    // ===                            Red Team Vehicles                         === //
    AddStaticVehicle(468,-1448.1558,-1517.6805,101.4600,194.5347,58,58); // RedTeamBike
    AddStaticVehicle(468,-1434.6736,-1537.2805,101.4611,91.1105,58,58); //  RedTeamBike
    AddStaticVehicle(468,-1435.1124,-1538.8169,101.4607,96.9524,58,58); //  RedTeamBike
    AddStaticVehicle(468,-1408.0072,-1519.2443,101.4053,4.6100,58,58); //   RedTeamBike
    AddStaticVehicle(468,-1430.6207,-1465.5865,101.4057,186.0469,58,58); // RedTeamBike
    AddStaticVehicle(468,-1418.3604,-1532.2045,101.4569,1.6608,58,58); //   RedTeamBike
    AddStaticVehicle(482,-1438.6785,-1521.7466,101.9272,271.6359,58,58); //    RedVan
    AddStaticVehicle(482,-1415.6345,-1515.8035,101.8636,315.3989,58,58); //   RedVan
   
    // ===                           Blue Team Vehicles                         === //
    AddStaticVehicle(482,-1079.4905,-1137.7628,129.3900,67.2661,7,7); //     BlueVan
    AddStaticVehicle(482,-1127.5129,-1139.0736,129.3821,310.3000,7,7); //     BlueVan
    AddStaticVehicle(468,-1092.3387,-1095.6649,128.9220,90.9748,7,7); //   BlueBike
    AddStaticVehicle(468,-1106.6384,-1078.0540,128.9241,194.0329,7,7); //  BlueBike
    AddStaticVehicle(468,-1122.6327,-1084.9277,128.9214,258.9965,7,7); //  BlueBike
    AddStaticVehicle(468,-1123.3169,-1095.6969,128.9216,255.0335,7,7); //  BlueBike
    AddStaticVehicle(468,-1105.4862,-1143.6036,128.9170,52.2066,7,7); //   BlueBike
   
    // ===                          " Hidden Vehicles "                         === //
    AddStaticVehicle(432,-1109.1323,-1622.1588,76.4169,271.1433,43,0); // HiddenRhino
    AddStaticVehicle(415,-1112.2841,-1675.1475,76.1680,0.3354,25,1); //   HiddenSportCar
   
    // ===                    " Gun & Armor & Adrenaline Pickups "               === //
    RedAmmoAssaultRifle = CreatePickup(356, 2, -1428.0146,-1507.3102,101.7150, -1);
    RedAmmoAssaultRifle2 = CreatePickup(356, 2, -1430.2186,-1527.8234,101.7489, -1);
    RedAmmoShotgun = CreatePickup(349, 2, -1419.1010,-1472.5802,101.6024, -1);
    RedAmmoShotgun2 = CreatePickup(351, 2, -1447.7269,-1527.1750,101.7578, -1);
    BlueAmmoAssaultRifle = CreatePickup(356, 2, -1089.1141,-1101.2532,129.2188, -1);
    BlueAmmoAssaultRifle2 = CreatePickup(356, 2, -1089.3928,-1138.6069,129.2188, -1);
    BlueAmmoCombatShotgun = CreatePickup(351, 2, -1119.2892,-1079.9797,129.2188, -1);
    SniperPickup1 = CreatePickup(358, 2, -1408.5126,-1542.4154,117.7724, -1);
    SniperPickup2 = CreatePickup(358, 2, -1445.9600,-1473.9596,117.7669, -1);
    SniperPickup3 = CreatePickup(358, 2, -1109.2906,-1147.4196,145.2419, -1);
    SniperPickup4 = CreatePickup(358, 2, -1051.1464,-1104.7876,145.3249, -1);
    TowerPickup = CreatePickup(1318, 23, -1416.9982,-1521.7203,101.7249, -1);
    Rocket = CreatePickup(359, 22, -1386.1842,-1207.6501,153.8270, -1);
    Adrenaline1 = CreatePickup(1241,2,-1371.4967,-1478.0889,102.1685);
    Adrenaline2 = CreatePickup(1241,2,-1367.2520,-1478.0248,102.3804);
    Adrenaline3 = CreatePickup(1241,2,-1362.9568,-1477.9598,102.5797);
    Adrenaline4 = CreatePickup(1241,2,-1359.2281,-1477.9034,102.7514);
    Adrenaline5 = CreatePickup(1241,2,-1204.4238,-1193.1554,129.2188);
    Adrenaline6 = CreatePickup(1241,2,-1204.3077,-1191.7084,129.2188);
    Adrenaline7 = CreatePickup(1241,2,-1204.0776,-1188.8322,129.2188);
    Adrenaline8 = CreatePickup(1241,2,-1203.8959,-1186.5613,129.2188);
    Adrenaline9 = CreatePickup(1241,2,-1179.0939,-1139.4683,129.2188);
    Armour = CreatePickup(1242,2,-1316.8533,-1445.1981,103.6572);
    Armour2 = CreatePickup(1242,2,1318.4407,-1334.9824,147.2611);
   
    // ===                              " Objects "                             === //
    CreateObject(3279,-1109.067749,-1147.366699,128.163742,0.000000,0.000000,177.797378);
    CreateObject(3279,-1050.937133,-1104.676635,128.246765,0.000000,0.000000,185.902160);
    CreateObject(3279,-1446.349243,-1473.793457,100.688774,0.000000,0.000000,-48.575485);
    CreateObject(3279,-1408.585693,-1542.404052,100.694229,0.000000,0.000000,177.928985);
    CreateObject(989,-1110.988281,-1088.670288,129.218750,0.000000,0.000000,108.317146);
    CreateObject(989,-1114.425537,-1091.438720,129.218750,0.000000,0.000000,2.677882);
    CreateObject(989,-1107.785888,-1091.265258,129.218750,0.000000,0.000000,27.677883);
    CreateObject(3749,-1392.588623,-1422.983764,111.035087,0.000000,-2.000000,346.607757);
    CreateObject(989,-1425.836059,-1497.121582,101.671875,0.000000,0.000000,19.304916);
    CreateObject(989,-1425.558959,-1502.524291,101.671875,0.000000,0.000000,19.304916);
    CreateObject(989,-1423.195190,-1494.172729,100.253906,0.000000,0.000000,-67.695083);
    CreateObject(989,-1419.065429,-1493.882202,100.261245,0.000000,0.000000,-67.695083);
    CreateObject(1652,-921.406066,-1392.642944,126.104072,0.000000,0.000000,-33.456085);
    CreateObject(1652,-921.406066,-1392.642944,127.378746,0.000000,0.000000,-33.456085);
    CreateObject(1652,-921.406066,-1392.642944,128.635559,0.000000,0.000000,-33.456085);
    CreateObject(1652,-921.406066,-1392.642944,129.873977,0.000000,0.000000,-33.456085);
    CreateObject(634,-931.098266,-1387.515502,126.074745,0.000000,0.000000,340.616241);
    CreateObject(976,-1061.132080,-1313.600708,128.197677,0.000000,0.000000,358.161926);//Blue team gate
    CreateObject(976,-1042.115966,-1314.543090,128.197677,0.000000,0.000000,358.161926);// Blue team gate
    CreateObject(3279,-1381.249633,-1207.643432,105.069244,0.000000,0.000000,-84.000000);
    CreateObject(3279,-1384.235107,-1203.170776,120.640357,0.000000,0.000000,5.000000);
    CreateObject(3279,-1386.250976,-1207.369262,136.748901,0.000000,0.000000,-266.000000);
    CreateObject(1829,-1079.816894,-1295.745361,129.218750,0.000000,0.000000,90.563529);
    CreateObject(6312,-1414.174316,-1598.339965,108.669235,0.000000,0.000000,-91.669311);
    CreateObject(6312,-1358.964111,-1556.882324,108.669235,0.000000,0.000000,-61.669311);
    CreateObject(6312,-1343.196533,-1522.020019,108.669235,0.000000,0.000000,-41.669311);
    CreateObject(17134,-1195.997070,-1025.068115,142.259613,0.000000,0.000000,-90.000000);
    CreateObject(17134,-1118.092773,-1024.505371,134.044799,0.000000,0.000000,-98.000000);
    CreateObject(17134,-1016.325622,-1011.273742,111.813606,200.000000,100.000000,311.000000);
    CreateObject(744,-1220.050537,-1069.183227,127.545494,0.000000,0.000000,11.653784);
    CreateObject(744,-1217.898437,-1067.862304,127.545494,0.000000,0.000000,-100.346206);
    CreateObject(744,-1212.553100,-1068.555541,127.545494,0.000000,0.000000,39.653793);
    CreateObject(744,-1207.993286,-1068.555541,127.545494,0.000000,0.000000,-5.346206);
    CreateObject(744,-1208.976928,-1065.982666,127.545494,0.000000,0.000000,-5.346206);
    CreateObject(744,-1204.067504,-1068.971069,127.545494,0.000000,0.000000,79.653793);
    CreateObject(744,-1200.022216,-1070.796264,127.545494,0.000000,0.000000,29.653793);
    CreateObject(750,-1210.339721,-1072.180664,127.180786,0.000000,0.000000,353.401611);
    CreateObject(700,-1190.444824,-1088.532348,128.572784,0.000000,0.000000,267.234191);
    CreateObject(703,-1212.629028,-1073.664062,127.038871,0.000000,0.000000,59.890380);
    CreateObject(703,-1212.882812,-1126.285278,128.174148,0.000000,0.000000,192.169937);
    CreateObject(3525,-1111.369384,-1093.188720,127.482543,0.000000,0.000000,8.975855);
    CreateObject(3525,-1423.098632,-1502.094116,99.887229,0.000000,0.000000,1.081045);
    CreateObject(6312,-1268.828979,-1492.237548,101.706558,0.000000,0.000000,243.500000);
    CreateObject(3436,-1068.935546,-1206.336425,133.033889,0.000000,0.000000,-93.000000);
    CreateObject(3436,-1026.790039,-1205.188232,133.033889,0.000000,0.000000,-93.000000);
    CreateObject(2799,-1055.724487,-1187.720947,128.665176,0.000000,0.000000,60.953956);
    CreateObject(14401,-1056.700195,-1202.959472,128.404815,0.000000,0.000000,356.303497);
    CreateObject(14401,-1038.833984,-1212.489379,128.404815,0.000000,0.000000,536.303466);
    CreateObject(808,-1038.439453,-1231.687622,129.172378,0.000000,0.000000,236.474899);
    CreateObject(800,-1059.494750,-1224.454956,129.173431,0.000000,0.000000,77.532318);
    CreateObject(800,-1037.500000,-1199.987670,129.218750,0.000000,0.000000,319.425415);
    CreateObject(3776,-1108.757446,-1219.623168,137.236373,0.000000,0.000000,-273.000000);

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnFilterScriptInit()
{
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
    if(classid == 0)
    {
        SetPlayerWeather(playerid,46);
        SetPlayerPos(playerid, -1423.3628,-1504.3754,105.0391);
        SetPlayerFacingAngle(playerid,202.1755);
        SetPlayerCameraPos(playerid, -1420.3561,-1507.4291,106.3);
        SetPlayerCameraLookAt(playerid, -1423.3628,-1504.3754,105.0391);
        GameTextForPlayer(playerid,"~r~ Red Team",3000,6);
        SetPlayerTeam(playerid,1);
        PlayerPlaySound(playerid,1068,0,0,0);
        return 1;
    }
    if(classid == 1)
    {
        SetPlayerWeather(playerid,30);
        SetPlayerPos(playerid, -1110.7806,-1097.1586,129.2188);
        SetPlayerFacingAngle(playerid,190.1447);
        SetPlayerCameraPos(playerid, -1108.7574,-1100.8881,130.2188);
        SetPlayerCameraLookAt(playerid, -1110.7806,-1097.1586,129.2188);
        GameTextForPlayer(playerid,"~b~ Blue Team",3000,6);
        SetPlayerTeam(playerid,2);
        PlayerPlaySound(playerid,1068,0,0,0);
        return 2;
    }
    return 0;
}

public OnPlayerConnect(playerid)
{
    ClearChat(playerid);
    SendClientMessage(playerid,COLOR_GREEN," .: Smile )* Welcome to the vehicle capture the flag *((::. ");
    SendClientMessage(playerid,COLOR_WHITE,"* To get started type: /commands, /help, /helptour, /objective");
    SendClientMessage(playerid,COLOR_WHITE,"_________________________________________________");
    ResetStats(playerid);
    TextDrawShowForPlayer(playerid,ScoreTextDraw);
    TextDrawShowForPlayer(playerid,RedTextDraw);
    TextDrawShowForPlayer(playerid,BlueTextDraw);
    GangZoneShowForAll(RedArea,RED_TEAM_COLOR);
    GangZoneShowForAll(BlueArea,BLUE_TEAM_COLOR);
    SetPlayerMapIcon(playerid, 3, -1087.1572,-1629.6427,76.0710, 37, 0);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    SetPlayerWorldBounds(playerid, WorldBounds);
    if(GetPlayerTeam(playerid) == 1)
    {
        GivePlayerWeapon(playerid,24,50);
        new randomm = random(sizeof(TeamRedSpawn));
        SetPlayerPos(playerid,TeamRedSpawn[randomm][0],TeamRedSpawn[randomm][1],TeamRedSpawn[randomm][2]);
        SetCameraBehindPlayer(playerid);
        SetPlayerColor(playerid,RED_TEAM_COLOR);
        SetPlayerSkin(playerid,RedTeamSkin);
        SetPlayerFacingAngle(playerid,TeamRedSpawn[randomm][3]);
        return 1;
    }
    if(GetPlayerTeam(playerid) == 2)
    {
        GivePlayerWeapon(playerid,23,50);
        new randomm = random(sizeof(TeamBlueSpawn));
        SetPlayerPos(playerid,TeamBlueSpawn[randomm][0],TeamBlueSpawn[randomm][1],TeamBlueSpawn[randomm][2]);
         SetPlayerFacingAngle(playerid,TeamBlueSpawn[randomm][3]);
         SetCameraBehindPlayer(playerid);
         SetPlayerColor(playerid,BLUE_TEAM_COLOR);
         SetPlayerSkin(playerid,BlueTeamSkin);
         return 2;
    }
    return 0;
}


public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
     if(HoldingRedFlag[playerid] == 1)
    {
        GetPlayerPos(playerid,x,y,z);
        DestroyObject(RedFlag);
        RedFlag = CreateObject(2993,x,y+3,z+0.5,0.000000,0.000000,5.654280);
        RedFlagOnGround = CreatePickup(0,2,x,y+3,z,0);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[45];
        format(string,sizeof(string),"~r~ %s has dropped the red flag!",PlayerName);
        GameTextForAll(string,3000,4);
        PlaySoundForAll(1055);
        HoldingRedFlag[playerid] = 0;
        SetMapIconForAll(1, x,y, z, 37, 0);
        RedFlagDropt = 1;
        SetPlayerColor(playerid,BLUE_TEAM_COLOR);
        FReturn = SetTimer("FlagReturner",50000,false);
        return 1;
     }
    if(HoldingBlueFlag[playerid] == 1)
    {
        GetPlayerPos(playerid,x,y,z);
        DestroyObject(BlueFlag);
        BlueFlag = CreateObject(2993,x,y+3,z+0.5,0.000000,0.000000,5.654280);
        BlueFlagOnGround = CreatePickup(0,2,x,y+3,z,0);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[128];
        format(string,sizeof(string),"~b~ %s has dropped the blue flag!",PlayerName);
        GameTextForAll(string,3000,4);
        PlaySoundForAll(1055);
        HoldingBlueFlag[playerid] = 0;
        SetMapIconForAll(2, x,y, z, 30, 0);
        BlueFlagDropt = 1;
        SetPlayerColor(playerid,RED_TEAM_COLOR);
        FReturn = SetTimer("FlagReturner",50000,false);
        return 2;
    }
       if(killerid != INVALID_PLAYER_ID)
       {
           PlayerKills[killerid] += 1;
          PlayerDeaths[playerid] += 1;
          return 3;
       }
       else
       {
           PlayerDeaths[playerid] += 1;
           return 0;
       }
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(dropflag, 8, cmdtext);
    dcmd(stats, 5, cmdtext);
    dcmd(kill, 4, cmdtext);
    dcmd(spectate, 8, cmdtext);
    dcmd(specoff, 7, cmdtext);
    dcmd(switchteam, 10, cmdtext);
    dcmd(commands, 8, cmdtext);
    dcmd(help, 4, cmdtext);
    dcmd(objective, 9, cmdtext);
    dcmd(helptour, 8, cmdtext);
    dcmd(exittour, 8, cmdtext);
    dcmd(credits, 7, cmdtext);
    dcmd(forceswitch, 11, cmdtext);
    dcmd(restart, 7, cmdtext);
    dcmd(b, 1, cmdtext);
    dcmd(r, 1, cmdtext);
    dcmd(ahelp, 5, cmdtext);
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new bike = GetPlayerVehicleID(playerid);
    if(GetVehicleModel(bike) == 468 || GetVehicleModel(bike) == 482 || GetVehicleModel(bike) == 432 || GetVehicleModel(bike) == 415)
    {
    if(newstate == PLAYER_STATE_DRIVER)
    {
    if(HoldingBlueFlag[playerid] == 1 || HoldingRedFlag[playerid] == 1)
    {
        OnPlayerCommandText(playerid,"/dropflag");
    }
    }
    }
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    SetPlayerWeather(playerid,12);
    PlayerPlaySound(playerid,1063,0.0,0.0,0.0);
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Redflagp) if(GetPlayerTeam(playerid) == 2) if(RedFlagStolen == 0)
    {
        AttachObjectToPlayer(RedFlag, playerid, 0.13, 0, 0, 0, 0, 0);
        DestroyPickup(Redflagp);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~r~ %s took the red flag!",PlayerName);
        PlaySoundForAll(1137);
        GameTextForAll(string,3000,4);
        SetPlayerColor(playerid,BLUE_TEAM_FLAGHOLDER);
        HoldingRedFlag[playerid] = 1;
        RedFlagStolen = 1;
    }
    if(pickupid == ReturnBlueFlagHere) if(GetPlayerTeam(playerid) == 1) if(HoldingBlueFlag[playerid] == 1) if(RedFlagStolen == 0)
    {
        DestroyObject(BlueFlag);
        DestroyPickup(Blueflagp);
        BlueFlag = CreateObject(2993,-1111.215,-1093.225,129.218,0.000000,0.000000,5.654280);
        Blueflagp = CreatePickup(0,23,-1111.215,-1093.225,129.218, 0);
        GameTextForAll("~r~ Red team scores",3000,6);
        PlaySoundForAll(1058);
        PlaySoundForAll(1039);
        PlayerCapturedFlags[playerid] += 1;
        RedTeamScore++;
        format(RedGameScore,sizeof(RedGameScore),"%d",RedTeamScore);
        TextDrawSetString(RedTextDraw,RedGameScore);
        HoldingBlueFlag[playerid] = 0;
        BlueFlagStolen = 0;
        SetPlayerColor(playerid,RED_TEAM_COLOR);
        DestroyObject(BlueFlag);
    }
    if(pickupid == RedFlagOnGround) if(GetPlayerTeam(playerid) == 2) if(RedFlagDropt == 1)
    {
         AttachObjectToPlayer(RedFlag, playerid, 0.13, 0, 0, 0, 0, 0);
         new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~r~ %s took the red flag!",PlayerName);
        PlaySoundForAll(1137);
        GameTextForAll(string,3000,4);
        HoldingRedFlag[playerid] = 1;
        RedFlagStolen = 1;
        RedFlagDropt = 0;
        DestroyPickup(RedFlagOnGround);
        SetPlayerColor(playerid,BLUE_TEAM_FLAGHOLDER);
        HideMapIconForAll(1);
        KillTimer(FReturn);
    }
    if(pickupid == RedFlagOnGround) if(GetPlayerTeam(playerid) == 1) if(RedFlagDropt == 1)
    {
         DestroyObject(RedFlag);
         DestroyPickup(RedFlagOnGround);
         RedFlagDropt = 0;
        RedFlag = CreateObject(2993,-1423.013549,-1502.117065,101.123245,0.000000,0.000000,5.654280);
        Redflagp = CreatePickup(0,23,-1423.013549,-1502.117065,101.123245, 0);
        HideMapIconForAll(1);
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~r~ %s returned the red flag!",PlayerName);
        PlaySoundForAll(1137);
        SetPlayerColor(playerid,RED_TEAM_COLOR);
        GameTextForAll(string,3000,4);
        RedFlagStolen = 0;
        RedFlagDropt = 0;
        KillTimer(FReturn);
    }
    if(pickupid == Blueflagp) if(GetPlayerTeam(playerid) == 1) if(BlueFlagStolen == 0)
    {
        AttachObjectToPlayer(BlueFlag, playerid, 0.13, 0, 0, 0, 0, 0);
        DestroyPickup(Blueflagp);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~b~ %s took the blue flag!",PlayerName);
        PlaySoundForAll(1137);
        SetPlayerColor(playerid,RED_TEAM_FLAGHOLDER);
        GameTextForAll(string,3000,4);
        HoldingBlueFlag[playerid] = 1;
        BlueFlagStolen = 1;
    }
    if(pickupid == ReturnRedFlagHere) if(GetPlayerTeam(playerid) == 2) if(HoldingRedFlag[playerid] == 1) if(BlueFlagStolen == 0)
    {
        GameTextForAll("~b~ Blue team scores",3000,6);
        PlaySoundForAll(1058);
        PlaySoundForAll(1039);
        BlueTeamScore++;
        PlayerCapturedFlags[playerid] += 1;
        format(BlueGameScore,sizeof(BlueGameScore),"%d",BlueTeamScore);
        TextDrawSetString(BlueTextDraw,BlueGameScore);
        DestroyObject(RedFlag);
        RedFlag = CreateObject(2993,-1423.013549,-1502.117065,101.123245,0.000000,0.000000,5.654280);
        Redflagp = CreatePickup(0,23,-1423.013549,-1502.117065,101.123245, 0);
        HoldingRedFlag[playerid] = 0;
        SetPlayerColor(playerid,BLUE_TEAM_COLOR);
        RedFlagStolen = 0;
    }
    if(pickupid == ReturnBlueFlagHere) if(RedTeamScore == MaxScore)
    {
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            GameTextForAll("~r~ Red team won",4000,6);
            TogglePlayerControllable(i,0);
            PlaySoundForAll(1183);
            SetPlayerCameraPos(i,-1420.2592,-1509.0078,101.6822);
            SetPlayerCameraLookAt(i,-1423.7081,-1498.3615,101.6719);
            SetTimer("Restarter", 23000,false);
            SetTimerEx("StatsA", 6000, false, "d", i);
            DestroyPickup(ReturnBlueFlagHere);
            }
    }
    if(pickupid == ReturnRedFlagHere) if(BlueTeamScore == MaxScore)
    {
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            GameTextForAll("~b~ Blue team won",4000,6);
            PlaySoundForAll(1062);
            TogglePlayerControllable(i,0);
            SetPlayerCameraPos(i,-1103.2827,-1095.3823,129.2188);
            SetPlayerCameraLookAt(i,-1111.1594,-1092.3430,129.2188);
            SetTimer("Restarter",20000,false);
            SetTimerEx("StatsA", 10000, false, "d", i);
            DestroyPickup(ReturnRedFlagHere);
            }
    }
    if(pickupid == BlueFlagOnGround) if(GetPlayerTeam(playerid) == 1) if(BlueFlagDropt == 1)
    {
         AttachObjectToPlayer(BlueFlag, playerid, 0.13, 0, 0, 0, 0, 0);
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~b~ %s took the blue flag!",PlayerName);
        PlaySoundForAll(1137);
        SetPlayerColor(playerid,RED_TEAM_FLAGHOLDER);
        GameTextForAll(string,3000,4);
        HoldingBlueFlag[playerid] = 1;
        BlueFlagStolen = 1;
        BlueFlagDropt = 0;
        DestroyPickup(BlueFlagOnGround);
        HideMapIconForAll(2);
        KillTimer(FReturn);
    }
    if(pickupid == BlueFlagOnGround) if(GetPlayerTeam(playerid) == 2) if(BlueFlagDropt == 1)
    {
         DestroyObject(BlueFlag);
         BlueFlag = CreateObject(2993,-1111.215,-1093.225,129.218,0.000000,0.000000,5.654280);
         new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[50];
        format(string,sizeof(string),"~b~ %s returned the blue flag!",PlayerName);
        PlaySoundForAll(1137);
        SetPlayerColor(playerid,BLUE_TEAM_COLOR);
        GameTextForAll(string,3000,4);
        BlueFlagStolen = 0;
        BlueFlagDropt = 0;
        DestroyPickup(BlueFlagOnGround);
        HideMapIconForAll(2);
        KillTimer(FReturn);
        Blueflagp = CreatePickup(0,23,-1111.215,-1093.225,129.218, 0);
    }
    if(pickupid == RedAmmoAssaultRifle || pickupid == RedAmmoAssaultRifle2)
    {
        GivePlayerWeapon(playerid,31,50);
    }
    if(pickupid == RedAmmoShotgun || pickupid == RedAmmoShotgun2)
    {
        GivePlayerWeapon(playerid,26,50);
    }
    if(pickupid == BlueAmmoAssaultRifle || pickupid == BlueAmmoAssaultRifle2)
    {
        GivePlayerWeapon(playerid,31,50);
    }
    if(pickupid == BlueAmmoCombatShotgun)
    {
        GivePlayerWeapon(playerid,27,50);
    }
    if(pickupid == SniperPickup1 || pickupid == SniperPickup2 || pickupid == SniperPickup3 || pickupid == SniperPickup4)
    {
        GivePlayerWeapon(playerid,34,30);
    }
    if(pickupid == TowerPickup)
    {
        SetPlayerPos(playerid,-1413.1459,-1520.5725,124.6151);
    }
    if(pickupid == Rocket)
    {
        GivePlayerWeapon(playerid, 35, 10);
    }
    if(pickupid == Adrenaline1 || pickupid == Adrenaline2 || pickupid == Adrenaline3 || pickupid == Adrenaline4 ||
    pickupid == Adrenaline5 || pickupid == Adrenaline6 || pickupid == Adrenaline7 || pickupid == Adrenaline8 || pickupid == Adrenaline9)
    {
        GivePlayerHealth(playerid,20);
    }
    if(pickupid == Armour || pickupid == Armour2)
    {
   
    }
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}

// ====================                            DCMD COMMANDS                           ====================

dcmd_forceswitch(playerid, params[])
{
    new target;
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown Command Or Not.");
    if(sscanf(params, "u",target)) return SendClientMessage(playerid,COLOR_WHITE,"Use: /forceswitch [ID]");
    if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ERROR,"Invalid ID or name");
    else
        if(GetPlayerTeam(target) == 1)
        {
            SetPlayerTeam(target,2);
            SetTimerEx("TeamSwitch", 2500, false, "d", target);
            TeamSwitchv[target] = 1;
            SendClientMessage(target,COLOR_WHITE,"Your team has been changed by admin");
            SendClientMessage(target,COLOR_WHITE,"Switching team...");
            SendClientMessage(playerid,COLOR_WHITE,"Team changed");
        }
        else if(GetPlayerTeam(target) == 2)
        {
            SetPlayerTeam(target,1);
            SetTimerEx("TeamSwitch", 2500, false, "d", target);
            TeamSwitchv[target] = 2;
            SendClientMessage(target,COLOR_WHITE,"Your team has been changed by admin");
            SendClientMessage(target,COLOR_WHITE,"Switching team...");
            SendClientMessage(playerid,COLOR_WHITE,"Team changed");
        }
    return 1;
}

dcmd_ahelp(playerid, params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        ClearChat(playerid);
        SendClientMessage(playerid,COLOR_GREEN,"..::: Admin commands :::..");
        SendClientMessage(playerid,COLOR_WHITE,"/forceswitch & /restart ");
           SendClientMessage(playerid,COLOR_WHITE,"_________________________________________________");
    }
    else return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown Command.");
    return 1;
}

dcmd_restart(playerid, params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        SendRconCommand("gmx");
    }
    else return SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown Command.");
    return 1;
}

dcmd_credits(playerid, params[])
{
    #pragma unused params
    SendClientMessage(playerid,COLOR_WHITE,"");
    SendClientMessage(playerid,COLOR_WHITE,".:: This gamemode is scripted by Assyria ::.");
    SendClientMessage(playerid,COLOR_WHITE,"");
    return 1;
}

dcmd_exittour(playerid, params[])
{
    #pragma unused params
    if(IsInTour[playerid] == 0) return SendClientMessage(playerid,COLOR_ERROR," You are not in help tour!");
    else
    {
        IsInTour[playerid] = 0;
        SetCameraBehindPlayer(playerid);
        SendClientMessage(playerid,COLOR_WHITE,"Tour exited");
        SetPlayerPos(playerid,tX,tY,tZ);
    }
    return 1;
}

dcmd_helptour(playerid, params[])
{
    #pragma unused params
    if(IsInTour[playerid] == 0)
    {
        IsInTour[playerid] = 1;
        GetPlayerPos(playerid,tX,tY,tZ);
        SetPlayerPos(playerid,-1594.3313,-1689.2053,-4.4131);
        SetPlayerCameraPos(playerid,-1420.9856,-1510.2443,101.9);
        SetPlayerCameraLookAt(playerid,-1424.1849,-1501.3667,101.6719);
        ClearChat(playerid);
        SendClientMessage(playerid,COLOR_BLUE,"..:::////%% )) --      Help Tour      -- (( %%\\\\:::...");
        SendClientMessage(playerid,COLOR_WHITE," ** You will proceed a tutorial about capture the flag.");
        SendClientMessage(playerid,COLOR_WHITE," ____________________________");
        SendClientMessage(playerid,0xC30000FF," ** This is the Red base ** ");
        SetTimerEx("TourTimer", 6000, false, "i", playerid);
    }
    return 1;
}

dcmd_help(playerid, params[])
{
    #pragma unused params
    ClearChat(playerid);
    SendClientMessage(playerid,COLOR_BLUE,"..:::////%% )) --       Help       -- (( %%\\\\:::...");
    SendClientMessage(playerid,COLOR_WHITE,"* I suggest you to press Esc, select Map, and look where this game is located");
    SendClientMessage(playerid,COLOR_WHITE,"* To understand more about this gamemode and what capture the flag is, type in /objective");
    SendClientMessage(playerid,COLOR_WHITE,"_________________________________________________");
    return 1;
}

dcmd_objective(playerid, params[])
{
    ClearChat(playerid);
    SendClientMessage(playerid,COLOR_BLUE,"..:::////%% )) --             -             Objective             -             -- (( %%\\\\:::...");
    SendClientMessage(playerid,COLOR_WHITE,"* What is capture the flag? - It is gamemode where you are fighting for capturing flags* ");
    SendClientMessage(playerid,COLOR_WHITE,"* What does that mean? - Main idea is to steal enemys flag and return it to your home base* ");
    SendClientMessage(playerid,COLOR_WHITE,"***** But if your teams flag is stolen, one of your team members have to return it before you can capture the enemys flag* ");
    SendClientMessage(playerid,COLOR_WHITE,"* How do I play? - Steal enemys flag from their basement and bring it to your home base* ");
    SendClientMessage(playerid,COLOR_WHITE,"* Someones color on radar is different, why is that? - When someone is holding a flag, his color will change to a different one* ");
    SendClientMessage(playerid,COLOR_WHITE,"* I can't find flag anywhere, what to do? - When flag is dropped, there will be blue marker for blue flag on radar, same for red* ");
    SendClientMessage(playerid,COLOR_WHITE,"* What is this (flag auto returned)? - When flag is dropped on the ground for too long time, it will automaticly return to its team basement *");
    SendClientMessage(playerid,COLOR_WHITE,"* Walking with the flag is boring, what to do? - You can hop in your team mates vehicle as passanger, but if you try to drive when holding a flag, the flag get dropped *");
    SendClientMessage(playerid,COLOR_WHITE,"_________________________________________________");
    #pragma unused params
    return 1;
}

dcmd_commands(playerid, params[])
{
    #pragma unused params
    ClearChat(playerid);
    SendClientMessage(playerid,COLOR_GREEN,"..::: Vehicle Capture The Flag commands :::..");
    SendClientMessage(playerid,COLOR_WHITE,"/dropflag,      /stats,      /spectate,      /specoff,      /helptour");
    SendClientMessage(playerid,COLOR_WHITE,"/switchteam,    /kill,    /help,    /commands,    /objective");
       SendClientMessage(playerid,COLOR_WHITE,"_________________________________________________");
    if(GetPlayerTeam(playerid) == 1)
    {
        SendClientMessage(playerid,COLOR_WHITE,"Your team chat: /r [Message]");
    }
    if(GetPlayerTeam(playerid) == 2)
    {
        SendClientMessage(playerid,COLOR_WHITE,"Your team chat: /b [Message]");
    }
    return 1;
}

dcmd_switchteam(playerid, params[])
{
    #pragma unused params
    if(GetPlayerTeam(playerid) == 1)
    {
        SetTimerEx("TeamSwitch", 2500, false, "d", playerid);
        TeamSwitchv[playerid] = 1;
        ResetPlayerWeapons(playerid);
        SendClientMessage(playerid,COLOR_WHITE,"Switching team...");
    }
    else
    {
        SetTimerEx("TeamSwitch", 2500, false, "d", playerid);
        TeamSwitchv[playerid] = 2;
        ResetPlayerWeapons(playerid);
         SendClientMessage(playerid,COLOR_WHITE,"Switching team...");
    }
    return 1;
}

dcmd_spectate(playerid, params[])
{
    new target;
    if(sscanf(params,"u",target)) return SendClientMessage(playerid,COLOR_WHITE,"Use: /Spectate [ID]");
    {
    if(target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_ERROR,"Invalid playerid");
    {
    if(IsPlayerInAnyVehicle(target))
       {
           IsSpectating[playerid] = 1;
           TogglePlayerSpectating(playerid,1);
        PlayerSpectateVehicle(playerid,GetPlayerVehicleID(target));
    }
    else
    {
        IsSpectating[playerid] = 1;
        TogglePlayerSpectating(playerid,1);
        PlayerSpectatePlayer(playerid,target);
    }
    }
    }
    return 1;
}

dcmd_specoff(playerid, params[])
{
    #pragma unused params
    if(IsSpectating[playerid] != 1) return SendClientMessage(playerid,COLOR_ERROR,"You are not spectating");
    {
        TogglePlayerSpectating(playerid,0);
    }
    return 1;
}

dcmd_kill(playerid, params[])
{
    #pragma unused params
    SetPlayerHealth(playerid,0);
    return 1;
}

dcmd_r(playerid, params[])
{
    new string[128];
    if (sscanf(params,"u",string)) return SendClientMessage(playerid, COLOR_WHITE, "Use: /r [Message]");
    new Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Playername,sizeof(Playername));
    format(string,sizeof(string),"Team chat: %s: %s",Playername,params);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(GetPlayerTeam(playerid) == 1)
        {
            SendClientMessage(i,RED_TEAM_COLOR,string);
        }
    }
    return 1;
}

dcmd_b(playerid, params[])
{
    new string[128];
    if (sscanf(params,"u",string)) return SendClientMessage(playerid, COLOR_WHITE, "Use: /b [Message]");
    new Playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,Playername,sizeof(Playername));
    format(string,sizeof(string),"Team chat: %s: %s",Playername,params);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(GetPlayerTeam(playerid) == 2)
        {
            SendClientMessage(i,BLUE_TEAM_COLOR,string);
        }
    }
    return 1;
}

dcmd_stats(playerid, params[])
{
    #pragma unused params
    new kstring [20];
    format(kstring, sizeof(kstring), "~r~Kills: ~w~%d", PlayerKills);
    GameTextForPlayer(playerid,kstring,2000,1);
    StatsHelper[playerid] = 1;
    StatsTimer = SetTimerEx("Stats", 6001, true, "d", playerid);
    return 1;
}

dcmd_dropflag(playerid, params[])
{
    #pragma unused params
    new Float:x, Float:y, Float:z;
     if(HoldingRedFlag[playerid] == 1)
    {
        GetPlayerPos(playerid,x,y,z);
        DestroyObject(RedFlag);
        RedFlag = CreateObject(2993,x,y+3,z+0.5,0.000000,0.000000,5.654280);
        RedFlagOnGround = CreatePickup(0,2,x,y+3,z,0);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[45];
        format(string,sizeof(string),"~r~ %s has dropped the red flag!",PlayerName);
        GameTextForAll(string,3000,4);
        PlaySoundForAll(1055);
        HoldingRedFlag[playerid] = 0;
        SetMapIconForAll(1, x,y, z, 37, 0);
        RedFlagDropt = 1;
        SetPlayerColor(playerid,BLUE_TEAM_COLOR);
        FReturn = SetTimer("FlagReturner",50000,false);
        return 1;
     }
    if(HoldingBlueFlag[playerid] == 1)
    {
        GetPlayerPos(playerid,x,y,z);
        DestroyObject(BlueFlag);
        BlueFlag = CreateObject(2993,x,y+3,z+0.5,0.000000,0.000000,5.654280);
        BlueFlagOnGround = CreatePickup(0,2,x,y+3,z,0);
           new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
        new string[128];
        format(string,sizeof(string),"~b~ %s has dropped the blue flag!",PlayerName);
        GameTextForAll(string,3000,4);
        PlaySoundForAll(1055);
        HoldingBlueFlag[playerid] = 0;
        SetMapIconForAll(2, x,y, z, 30, 0);
        BlueFlagDropt = 1;
        SetPlayerColor(playerid,RED_TEAM_COLOR);
        FReturn = SetTimer("FlagReturner",50000,false);
        return 2;
    }
    else return SendClientMessage(playerid,COLOR_ERROR,"You aren't holding a flag!");
}

forward Stats(playerid);
public Stats(playerid)
{
    new dstring[25];
    if(StatsHelper[playerid] == 1)
    {
        format(dstring, sizeof(dstring), "~r~Deaths: ~w~%d", PlayerDeaths);
        GameTextForPlayer(playerid,dstring,2000,1);
        StatsHelper[playerid] = 2;
        return 1;
    }
    if(StatsHelper[playerid] == 2)
    {
        format(dstring, sizeof(dstring), "~r~Captured Flags: ~w~%d", PlayerCapturedFlags);
        GameTextForPlayer(playerid,dstring,2000,1);
        StatsHelper[playerid] = 1;
        KillTimer(StatsTimer);
        return 2;
    }
    return 0;
}

forward TourTimer(playerid);
public TourTimer(playerid)
{
    if(IsPlayerConnected(playerid))
    {
        if(IsInTour[playerid] == 1)
        {
            IsInTour[playerid] = 2;
            SetPlayerCameraPos(playerid,-1115.3082,-1100.9401,129.7);
            SetPlayerCameraLookAt(playerid,-1111.0192,-1092.8358,129.2188);
            SendClientMessage(playerid,0x0037FFFF," ** This is the Blue base ** ");
            SetTimerEx("TourTimer", 3000, false, "i", playerid);
        }
        else if(IsInTour[playerid] == 2)
        {
            OnPlayerCommandText(playerid,"/objective");
            IsInTour[playerid] = 3;
            SetPlayerCameraPos(playerid,-1364.1738,-1408.4838,121.9638);
            SetPlayerCameraLookAt(playerid,-1424.5270,-1486.4302,111.7695);
            SetTimerEx("TourTimer", 20000, false, "i", playerid);
        }
        else if(IsInTour[playerid] == 3)
        {
             IsInTour[playerid] = 4;
            SetPlayerCameraPos(playerid,-1179.0443,-1183.0165,138.8210);
            SetPlayerCameraLookAt(playerid,-1104.6594,-1088.2463,132.2429);
                SetTimerEx("TourTimer", 13000, false, "i", playerid);
        }
        else if(IsInTour[playerid] == 4)
        {
            ClearChat(playerid);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid,tX,tY,tZ);
            IsInTour[playerid] = 0;
            SendClientMessage(playerid,COLOR_WHITE,"Tour complete!");
        }
    }
    return 1;
}

forward ResetStats(playerid);
public ResetStats(playerid)
{
    HoldingRedFlag[playerid] = 0;
    HoldingBlueFlag[playerid] = 0;
    PlayerKills[playerid] = 0;
    PlayerDeaths[playerid] = 0;
    PlayerCapturedFlags[playerid] = 0;
    StatsHelper[playerid] = 0;
    IsSpectating[playerid] = 0;
    TeamSwitchv[playerid] = 0;
    IsInTour[playerid] = 0;
}

forward StatsA(playerid);
public StatsA(playerid)
{
    OnPlayerCommandText(playerid,"/stats");
}

forward Restarter();
public Restarter()
{
    SendRconCommand("gmx");
}

forward ClearChat(playerid);
public ClearChat(playerid)
{
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
    SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");SendClientMessage(playerid,COLOR_GREEN,"");
}

forward FlagReturner();
public FlagReturner()
{
    if (RedFlagDropt == 1)
    {
           DestroyObject(RedFlag);
        DestroyPickup(RedFlagOnGround);
        RedFlagDropt = 0;
        RedFlag = CreateObject(2993,-1423.013549,-1502.117065,101.123245,0.000000,0.000000,5.654280);
        Redflagp = CreatePickup(0,23,-1423.013549,-1502.117065,101.123245, 0);
        HideMapIconForAll(1);
        PlaySoundForAll(1137);
           GameTextForAll("~r~~Red flag auto returned",3000,4);
           RedFlagStolen = 0;
    }
    if(BlueFlagDropt == 1)
    {
        DestroyObject(BlueFlag);
        DestroyPickup(BlueFlagOnGround);
         BlueFlag = CreateObject(2993,-1111.215,-1093.225,129.218,0.000000,0.000000,5.654280);
        Blueflagp = CreatePickup(0,23,-1111.215,-1093.225,129.218, 0);
        PlaySoundForAll(1137);
        GameTextForAll("~b~ Blue flag auto returned",3000,4);
        BlueFlagStolen = 0;
           HideMapIconForAll(2);
    }
    return 1;
}

forward EnemyTextDrawf();
public EnemyTextDrawf()
{
    if (RedFlagStolen == 1)
    {
    ShowTextDrawForRed(EnemyTextDraw);
    SetTimer("EnemyTextDrawHider",2000,false);
    }
    if(BlueFlagStolen == 1)
    {
    ShowTextDrawForBlue(EnemyTextDraw);
    SetTimer("EnemyTextDrawHider",2000,false);
    }
}

forward EnemyTextDrawHider();
public EnemyTextDrawHider()
{
    TextDrawHideForAll(EnemyTextDraw);
}

forward TeamSwitch(playerid);
public TeamSwitch(playerid)
{
    if(TeamSwitchv[playerid] == 1)
    {
        SetPlayerTeam(playerid,2);
        SpawnPlayer(playerid);
        SetPlayerSkin(playerid,BlueTeamSkin);
    }
    else if(TeamSwitchv[playerid] == 2)
    {
        SetPlayerTeam(playerid,1);
        SpawnPlayer(playerid);
        SetPlayerSkin(playerid,RedTeamSkin);
    }
    return 1;
}

stock SetMapIconForAll(iconid, Float:x, Float:y, Float:z, markertype, color)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        SetPlayerMapIcon(i,iconid, Float:x, Float:y, Float:z, markertype, color);
    }
}

stock HideMapIconForAll(iconid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        RemovePlayerMapIcon(i, iconid);
    }
}

stock ShowTextDrawForRed(Text:text)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerTeam(i) == 1)
        {
            TextDrawShowForPlayer(i,Text:text);
        }
    }
}

stock ShowTextDrawForBlue(Text:text)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(GetPlayerTeam(i) == 2)
        {
            TextDrawShowForPlayer(i,Text:text);
        }
    }
}

stock PlaySoundForAll(soundid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        PlayerPlaySound(i,soundid, 0, 0, 0);
    }
}

stock GivePlayerHealth(playerid, Float: healthh)
{
    new Float:Health;
    GetPlayerHealth(playerid, Health);
    SetPlayerHealth(playerid, Health + healthh);
}

// Credits to Y_Less for sscanf
stock sscanf(string[], format[], {Float,_}:...)
{
    #if defined isnull
        if (isnull(string))
    #else
        if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
    #endif
        {
            return format[0];
        }
    #pragma tabsize 4
    new
        formatPos = 0,
        stringPos = 0,
        paramPos = 2,
        paramCount = numargs(),
        delim = ' ';
    while (string[stringPos] && string[stringPos] <= ' ')
    {
        stringPos++;
    }
    while (paramPos < paramCount && string[stringPos])
    {
        switch (format[formatPos++])
        {
            case '\0':
            {
                return 0;
            }
            case 'i', 'd':
            {
                new
                    neg = 1,
                    num = 0,
                    ch = string[stringPos];
                if (ch == '-')
                {
                    neg = -1;
                    ch = string[++stringPos];
                }
                do
                {
                    stringPos++;
                    if ('0' <= ch <= '9')
                    {
                        num = (num * 10) + (ch - '0');
                    }
                    else
                    {
                        return -1;
                    }
                }
                while ((ch = string[stringPos]) > ' ' && ch != delim);
                setarg(paramPos, 0, num * neg);
            }
            case 'h', 'x':
            {
                new
                    num = 0,
                    ch = string[stringPos];
                do
                {
                    stringPos++;
                    switch (ch)
                    {
                        case 'x', 'X':
                        {
                            num = 0;
                            continue;
                        }
                        case '0' .. '9':
                        {
                            num = (num << 4) | (ch - '0');
                        }
                        case 'a' .. 'f':
                        {
                            num = (num << 4) | (ch - ('a' - 10));
                        }
                        case 'A' .. 'F':
                        {
                            num = (num << 4) | (ch - ('A' - 10));
                        }
                        default:
                        {
                            return -1;
                        }
                    }
                }
                while ((ch = string[stringPos]) > ' ' && ch != delim);
                setarg(paramPos, 0, num);
            }
            case 'c':
            {
                setarg(paramPos, 0, string[stringPos++]);
            }
            case 'f':
            {

                new changestr[16], changepos = 0, strpos = stringPos;
                while(changepos < 16 && string[strpos] && string[strpos] != delim)
                {
                    changestr[changepos++] = string[strpos++];
                    }
                changestr[changepos] = '\0';
                setarg(paramPos,0,_:floatstr(changestr));
            }
            case 'p':
            {
                delim = format[formatPos++];
                continue;
            }
            case '\'':
            {
                new
                    end = formatPos - 1,
                    ch;
                while ((ch = format[++end]) && ch != '\'') {}
                if (!ch)
                {
                    return -1;
                }
                format[end] = '\0';
                if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
                {
                    if (format[end + 1])
                    {
                        return -1;
                    }
                    return 0;
                }
                format[end] = '\'';
                stringPos = ch + (end - formatPos);
                formatPos = end + 1;
            }
            case 'u':
            {
                new
                    end = stringPos - 1,
                    id = 0,
                    bool:num = true,
                    ch;
                while ((ch = string[++end]) && ch != delim)
                {
                    if (num)
                    {
                        if ('0' <= ch <= '9')
                        {
                            id = (id * 10) + (ch - '0');
                        }
                        else
                        {
                            num = false;
                        }
                    }
                }
                if (num && IsPlayerConnected(id))
                {
                    setarg(paramPos, 0, id);
                }
                else
                {
                    #if !defined foreach
                        #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
                        #define __SSCANF_FOREACH__
                    #endif
                    string[end] = '\0';
                    num = false;
                    new
                        name[MAX_PLAYER_NAME];
                    id = end - stringPos;
                    foreach (Player, playerid)
                    {
                        GetPlayerName(playerid, name, sizeof (name));
                        if (!strcmp(name, string[stringPos], true, id))
                        {
                            setarg(paramPos, 0, playerid);
                            num = true;
                            break;
                        }
                    }
                    if (!num)
                    {
                        setarg(paramPos, 0, INVALID_PLAYER_ID);
                    }
                    string[end] = ch;
                    #if defined __SSCANF_FOREACH__
                        #undef foreach
                        #undef __SSCANF_FOREACH__
                    #endif
                }
                stringPos = end;
            }
            case 's', 'z':
            {
                new
                    i = 0,
                    ch;
                if (format[formatPos])
                {
                    while ((ch = string[stringPos++]) && ch != delim)
                    {
                        setarg(paramPos, i++, ch);
                    }
                    if (!i)
                    {
                        return -1;
                    }
                }
                else
                {
                    while ((ch = string[stringPos++]))
                    {
                        setarg(paramPos, i++, ch);
                    }
                }
                stringPos--;
                setarg(paramPos, i, '\0');
            }
            default:
            {
                continue;
            }
        }
        while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
        {
            stringPos++;
        }
        while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
        {
            stringPos++;
        }
        paramPos++;
    }
    do
    {
        if ((delim = format[formatPos++]) > ' ')
        {
            if (delim == '\'')
            {
                while ((delim = format[formatPos++]) && delim != '\'') {}
            }
            else if (delim != 'z')
            {
                return delim;
            }
        }
    }
    while (delim > ' ');
    return 0;
}


_________________

Back to top
Nelson
Guest

Offline




PostPosted: Sat 9 Oct - 12:12 (2010)    Post subject: bring mw2 to samp xD Reply with quote

It's very long  Mr. Green
Back to top
[IFG]Darky
Modérator
Modérator

Offline

Joined: 18 Mar 2010
Posts: 2,452
Localisation: In The Dark
Masculin Capricorne (22déc-19jan)

PostPosted: Wed 13 Oct - 07:55 (2010)    Post subject: bring mw2 to samp xD Reply with quote

It's a nice idea, I'm very okay ! 
_________________
Back to top
Visit poster’s website MSN Skype
[FAT]Ronnie
IFG Fan

Offline

Joined: 14 Aug 2010
Posts: 841
Localisation: In your computer hacking it
Masculin Gémeaux (21mai-20juin)

PostPosted: Wed 13 Oct - 12:03 (2010)    Post subject: bring mw2 to samp xD Reply with quote

Nice but we will modify the server?The TDM server will remain?
Or we will put this to gamemode1?
_________________
I'm Near You!Watch Out!
To Slow!
You're Pwned!

Back to top
Visit poster’s website Yahoo Messenger Skype
[IFG]Zer0
Leader
Leader

Offline

Joined: 27 Mar 2010
Posts: 16,777,215
Localisation: On the streets, fuckin with da livin
Masculin Cancer (21juin-23juil)

PostPosted: Wed 13 Oct - 13:29 (2010)    Post subject: bring mw2 to samp xD Reply with quote

[IFG]Ronnie wrote:
Nice but we will modify the server?The TDM server will remain?
Or we will put this to gamemode1?


On the new server we will have other worlds to play in, basically multiple GMs working at the same time.
_________________
Back to top
Visit poster’s website Yahoo Messenger
[IFG]CrIsIs
IFG Member
IFG Member

Offline

Joined: 05 Jul 2010
Posts: 590
Localisation: India
Masculin Sagittaire (22nov-21déc)

PostPosted: Wed 13 Oct - 20:25 (2010)    Post subject: bring mw2 to samp xD Reply with quote

Nice................ nice idea .....and i played this capture a flag on other server's also and its a nice idea ......
 I AM OKAY WITH IT........ Mr. Green Mr. Green Mr. Green Mr. Green
_________________
IF YoU sEe Me YoU bEtTeR rUn Or YoU wIlL bE kIlLeD....

Back to top
Yahoo Messenger MSN
Nelson
Guest

Offline




PostPosted: Tue 19 Oct - 18:03 (2010)    Post subject: bring mw2 to samp xD Reply with quote

Yep, it's a good idea.
Back to top
[IFG]Lil_Titia
Leader
Leader

Offline

Joined: 17 Mar 2010
Posts: 2,563
Localisation: Somewhere Spying You
Féminin Vierge (24aoû-22sep)

PostPosted: Thu 21 Oct - 12:37 (2010)    Post subject: bring mw2 to samp xD Reply with quote

I'd like to see that on our server with others things =D

I voted "Yes" to your poll !
_________________
Look At Your Back, You Will Die Soon !

Lil_Titia

Back to top
Visit poster’s website MSN Skype
Contenu Sponsorisé






PostPosted: Today at 10:02 (2017)    Post subject: bring mw2 to samp xD

Back to top
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    IFG : Insane Family Gangsters Forum Index -> IFG : English Part -> Bug/Idea Server All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  

Index | Create a forum | Free support forum | Free forums directory | Report a violation | Conditions générales d'utilisation
Design par Kronica

Powered by phpBB © 2001, 2005 phpBB Group