[FilterScript] Barrett
#1

What it does?, well if you pick the sniper rifle at a51, you get the hability to kill players with just one shoot...
This was easily done in 10-15 mins.

Enjoy it!

pawn Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#define pos1 225.6482,1931.3715,17.6406



new BarretPickup;
new Barret[MAX_PLAYERS];

public OnFilterScriptInit()
{
    BarretPickup = CreatePickup(358, 2, pos1, -1);
    SetTimer("Updater", 15000, true);
    print("\n--------------------------------------");
    print(" Barret .50 Caliber by strier loaded.");
    print("--------------------------------------\n");
    return 1;
}

public OnPlayerConnect(playerid)
{
    Barret[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid)
{
    Barret[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    Barret[playerid] = 0;
    return 1;
}

public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(Barret[issuerid] == 1)
    {
        if(issuerid != INVALID_PLAYER_ID && weaponid == 34)
        {
            new Float:px,Float:py,Float:pz, str[250], target[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, sizeof(pName));
            GetPlayerName(issuerid, target, sizeof(target));
            SetPlayerHealth(playerid, 0.0);
            GetPlayerPos(playerid, px, py, pz);
            CreateExplosion(px,py,pz, 2, 2.0);
            format(str, sizeof(str), "{FFFFFF}[{99FF66}BARRET KILL {FFFFFF}] {0CA2CC}Sniper {FFFFFF}%s {0CA2CC}has murdered {FFFFFF}%s {0CA2CC}with caliber .50 barret!", pName, target);
            SendClientMessageToAll(-1, str);
        }
    }
    return 1;
}



CMD:sniper(playerid, params[])
{
    GivePlayerWeapon(playerid, 34, 500);
    return 1;
}

/*CMD:enablebarret(playerid, params[])
{
    Barret[playerid] = 1;
    SendClientMessage(playerid, -1, "Barret enabled !");
    return 1;
}

CMD:disablebarret(playerid, params[])
{
    Barret[playerid] = 0;
    SendClientMessage(playerid, -1, "Barret disabled !");
    return 1;
}*/


public OnPlayerPickUpPickup(playerid, pickupid)
{
  if(Barret[playerid] == 0)
  {
        if(pickupid == BarretPickup)  // Ok so here's the pickups, wait wrong, ok so there is a lot of things response, and i got a bit confused... i don't know how to respond to those dialogs :3
        {
            Barret[playerid] = 1;
            GivePlayerWeapon(playerid, 34, 0);
            SetPlayerAmmo(playerid, 34, 20);
            SendClientMessage(playerid, -1, "You've got the barret weapon with 20 ammo, note this gun is so lethal use it wisely!");
        }

  }
  return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

CMD:teleto(playerid, params[])
{
    SetPlayerPos(playerid, 225.6482,1929.3715,17.6406);
    return 1;
}
Reply
#2

not bad, wouldn't say very useful but could be fun.
Reply
#3

Not really that interesting, But good i guess.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)