[FilterScript] Polis vs Lads
#1

Sin mucho que decir... Otro script mas.

pawn Код:
/*
Hola gente! Les dejo otro de mis scripts.
Creditos:
Scripting: rooT.
Beta-Testing:
-BlacKJacK
-Krasic
-Dbz
-Makaveli

*/

#define FILTERSCRIPT
#include <a_samp>
#pragma tabsize 0

#define COLOR_RED 0xFF0000AA     // Red
#define COLOR_YELLOW 0xFFFF00AA // Yellow
#define COLOR_GREEN 0x66CC99AA // Green
#define COLOR_BLUE 0x0000BBAA // Blue
#define COLOR_WHITE 0xFFFFFFAA // White
#define COLOR_INV 0xFFFFFFAA   // INV

#define TEAM_LADS 0
#define TEAM_POLIS 1


new swat1, swat2, swat3, swat4;
new patru1, patru2, patru3, patru4, patru5;
new lads2, lads3, lads4, lads5, lads6;
new Sniper;
new PlayerTeam[MAX_PLAYERS];
new TDM[MAX_PLAYERS];
new TDM1[MAX_PLAYERS];
new TDM2[MAX_PLAYERS];
new Killed[MAX_PLAYERS];

new Float:RandomSpawnsPolis[4][4] = {
{1543.8296, -1631.9487, 13.3828, 95.2594},
{1560.1558, -1606.2255, 13.3828, 86.4861},
{1587.1034, -1605.0848, 13.3828, 66.1192},
{1604.2037, -1635.0360, 13.7188, 75.8173}
};

new Float:RandomSpawnsLads[5][5] = {
{1429.3523, -1654.3447, 13.3828, 0.9474},
{1403.3287, -1506.6328, 13.5722, 163.3854},
{1362.5299, -1671.4095, 13.5741, 114.6207},
{1341.3228, -1674.5718, 17.7159, 1.8196},
{1366.9677, -1686.4739, 13.3900, 7.7731}
};

stock Polis(playerid)
{
    PlayerTeam[playerid] = 1;
    TDM2[playerid] = 1;
    TDM1[playerid] = 0;
    TDM[playerid] = 1;
    ResetPlayerMoney(playerid);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid,100);
    SendClientMessage(playerid, COLOR_BLUE,"Elimina a los Ladrones!");
    SetPlayerColor(playerid, COLOR_BLUE);
    SetPlayerTeam(playerid, TEAM_POLIS);
    TogglePlayerControllable(playerid, 1);
    SetPlayerVirtualWorld(playerid, 10);
    SetPlayerSkin(playerid, 286);
}

stock Lads(playerid)
{
    PlayerTeam[playerid] = 0;
    TDM1[playerid] = 1;
    TDM2[playerid] = 0;
    TDM[playerid] = 1;
    ResetPlayerMoney(playerid);
    SetPlayerArmour(playerid,100);
    SendClientMessage(playerid,COLOR_RED,"Acaba con los Polis!");
    SetPlayerColor(playerid, COLOR_RED);
    SetPlayerTeam(playerid, TEAM_LADS);
    TogglePlayerControllable(playerid, 1);
    SetPlayerVirtualWorld(playerid, 10);
    SetPlayerSkin(playerid, 247);
}

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("-----TDM Polis vs Ladrones by rooT.-----");
    print("--------------------------------------\n");
    swat1 = AddStaticVehicle(427,1599.8903,-1626.2255,13.6132,89.2149,0,1); // Swat1
    swat2 = AddStaticVehicle(427,1600.0530,-1619.9767,13.6200,89.6605,0,1); // Swat2
    swat3 = AddStaticVehicle(427,1599.9832,-1613.6184,13.6084,89.1376,0,1); // Swat3
    swat4 = AddStaticVehicle(427,1600.4666,-1607.5629,13.6163,88.2506,0,1); // Swat4
   
    SetVehicleVirtualWorld(swat1, 10);
    SetVehicleVirtualWorld(swat2, 10);
    SetVehicleVirtualWorld(swat3, 10);
    SetVehicleVirtualWorld(swat4, 10);
   
    patru1 = AddStaticVehicle(596,1575.5439,-1615.0793,13.0980,142.9991,0,1); // LSPD1
    patru2 = AddStaticVehicle(596,1570.3971,-1615.1447,13.0602,142.9999,0,1); // LSPD2
    patru3 = AddStaticVehicle(596,1565.3557,-1615.1234,13.0591,142.9996,0,1); // LSPD3
    patru4 = AddStaticVehicle(596,1560.2750,-1614.7295,13.0960,143.0001,0,1); // LSPD4
    patru5 = AddStaticVehicle(596,1554.5686,-1615.1038,13.0941,143.2581,0,1); // LSPD5
   
    SetVehicleVirtualWorld(patru1, 10);
    SetVehicleVirtualWorld(patru2, 10);
    SetVehicleVirtualWorld(patru3, 10);
    SetVehicleVirtualWorld(patru4, 10);
    SetVehicleVirtualWorld(patru5, 10);
   
    lads2 = AddStaticVehicle(533,1362.5640,-1652.5863,13.1064,277.0966,0,1); // LadsC2
    lads3 = AddStaticVehicle(535,1362.9873,-1659.5433,13.1519,270.2731,32,92); // LadsC3
    lads4 = AddStaticVehicle(496,1373.6730,-1634.1742,13.2882,271.5004,8,17); // LadsC4
    lads5 = AddStaticVehicle(602,1359.9921,-1589.3655,8.5177,348.2739,8,17); // LadsC5
    lads6 = AddStaticVehicle(439,1401.3662,-1507.1177,13.5017,163.3856,67,8); // LadsC6
   
    SetVehicleVirtualWorld(lads2, 10);
    SetVehicleVirtualWorld(lads3, 10);
    SetVehicleVirtualWorld(lads4, 10);
    SetVehicleVirtualWorld(lads5, 10);
    SetVehicleVirtualWorld(lads6, 10);

   
    Sniper = CreatePickup(358, 3, 1579.2949, -1635.2092, 13.5617, -1);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
    {
        if(pickupid == Sniper)
        {
            SendClientMessage(playerid, COLOR_YELLOW, "Obtuviste un Sniper!");
            GivePlayerWeapon(playerid, 34, 30);
        }
    return 1;
}
public OnPlayerSpawn(playerid)
    {
        if(Killed[playerid] == 1)
            {
                if(PlayerTeam[playerid] == 0)
                    {
                        ResetPlayerWeapons(playerid);
                        Polis(playerid);
                        new rand=random(sizeof(RandomSpawnsPolis));
                        SetPlayerPos(playerid, RandomSpawnsPolis[rand][0], RandomSpawnsPolis[rand][1], RandomSpawnsPolis[rand][2]);
                        GivePlayerWeapon(playerid, 31, 500);
                        GivePlayerWeapon(playerid, 29, 500);
                        new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
                        GetPlayerName(playerid, pname, sizeof(pname));
                        format(string, sizeof(string), "%s ingreso al TDM /polis!", pname);
                        SendClientMessageToAll(COLOR_BLUE, string);
                        PlayerTeam[playerid] = 1;
                    }
                else if(PlayerTeam[playerid] == 1)
                    {
                        ResetPlayerWeapons(playerid);
                        Lads(playerid);
                        new rand=random(sizeof(RandomSpawnsLads));
                        SetPlayerPos(playerid, RandomSpawnsLads[rand][0], RandomSpawnsLads[rand][1], RandomSpawnsLads[rand][2], RandomSpawnsLads[rand][3], RandomSpawnsLads[rand][4]);
                        GivePlayerWeapon(playerid, 30, 500);
                        GivePlayerWeapon(playerid, 21, 500);
                        new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
                        GetPlayerName(playerid, pname, sizeof(pname));
                        format(string, sizeof(string), "%s ingreso al TDM /lads!", pname);
                        SendClientMessageToAll(COLOR_RED, string);
                        PlayerTeam[playerid] = 0;
                    }
            }
            Killed[playerid] = 0;
    }

public OnPlayerText(playerid, text[])
{
    if(text[0] == '*')
        {
        if(TDM[playerid] == 0){
            SendClientMessage(playerid, COLOR_WHITE, "No estas en un TDM!");
        return 0;
        }
            new string[256];
            new name[24];
            GetPlayerName(playerid, name, 24);
            format(string, sizeof(string), "*%s: %s", name, text[1]);
            printf("%s", string);
            for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                        {
                            if(PlayerTeam[playerid] == PlayerTeam[i])
                            SendClientMessage(i, COLOR_YELLOW, string);
                        }
                }
        return 0;
        }
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/lads", cmdtext, true, 10) == 0)
        {
        if(TDM1[playerid] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "No abuses >:D!");
            ResetPlayerWeapons(playerid);
            Lads(playerid);
            new rand=random(sizeof(RandomSpawnsLads));
            SetPlayerPos(playerid, RandomSpawnsLads[rand][0], RandomSpawnsLads[rand][1], RandomSpawnsLads[rand][2], RandomSpawnsLads[rand][3], RandomSpawnsLads[rand][4]);
            GivePlayerWeapon(playerid, 30, 500);
            GivePlayerWeapon(playerid, 21, 500);
            new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "%s ingreso al TDM /lads!", pname);
            SendClientMessageToAll(COLOR_RED, string);
        return 1;
    }
    if(strcmp("/polis", cmdtext, true, 10) == 0)
        {
        if(TDM2[playerid] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "No abuses >:D!");
            ResetPlayerWeapons(playerid);
            Polis(playerid);
            new rand=random(sizeof(RandomSpawnsPolis));
            SetPlayerPos(playerid, RandomSpawnsPolis[rand][0], RandomSpawnsPolis[rand][1], RandomSpawnsPolis[rand][2]);
            GivePlayerWeapon(playerid, 31, 500);
            GivePlayerWeapon(playerid, 29, 500);
            new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "%s ingreso al TDM /polis!", pname);
            SendClientMessageToAll(COLOR_BLUE, string);
        return 1;
    }
   
return 0;
}
   
public OnPlayerDeath(playerid, killerid, reason)
{
    Killed[playerid] = 1;
    SetPlayerScore(killerid, GetPlayerScore(playerid) +1);
    SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
    return 1;
}

public OnFilterScriptExit()
    {
        print("---------------------------------------------");
        print("---Filterscript Unloaded Saisfactoriamente---");
        print("---------------------------------------------");
        DestroyVehicle(swat1);
        DestroyVehicle(swat2);
        DestroyVehicle(swat3);
        DestroyVehicle(swat4);

        DestroyVehicle(patru1);
        DestroyVehicle(patru2);
        DestroyVehicle(patru3);
        DestroyVehicle(patru4);
        DestroyVehicle(patru5);

        DestroyVehicle(lads2);
        DestroyVehicle(lads3);
        DestroyVehicle(lads4);
        DestroyVehicle(lads5);
        DestroyVehicle(lads6);
        print("----------------------------------------------");
        print("-------------Vehiculos Eliminados-------------");
        print("----------------------------------------------");
        return 1;
    }
Al compilarlo, obtendrбn 4 warnings, no se hagan problema porque funciona perfectamente.
MrDeath, si ves algun error, avisame! :P
Reply
#2

pawn Код:
// QUOTE 1:
#define FILTERSCRIPT

// QUOTE 2:
public OnFilterScriptInit()
Eso es un gamemode, no un filterscript.
Reply
#3

No, es un FilterScript xD.

Fue hecho para un GM Freeroam, pero luego lo converti en FS.
Creeme, esta probado xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)