SA-MP Forums Archive
help no minigun - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help no minigun (/showthread.php?tid=461382)



help no minigun - GrOobY - 01.09.2013

hello pooples i'm searching no minigun script to get a miniguns disarm a player (no ban)


Re: help no minigun - DanishHaq - 01.09.2013

If you want it when he kills someone:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38) ResetPlayerWeapons(killerid); // Disarm if they have a minigun
    return 1;
}
Or if you want it as soon as he gets the minigun:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38) ResetPlayerWeapons(playerid);
    return 1;
}



Re: help no minigun - Cypress - 01.09.2013

pawn Код:
stock RemovePlayerWeapon(playerid, weaponid)
{
    new WeaponData[13][2];
   
    for(new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, WeaponData[i][0], WeaponData[i][1]);

    ResetPlayerWeapons(playerid);
   
    for(new i = 0; i < 13; i++)
    {
        if(WeaponData[i][0] != 0 && WeaponData[i][0] != weaponid)
        {
            GivePlayerWeapon(playerid, WeaponData[i][0], WeaponData[i][1]);
        }
    }
    return 0;
}
You can use this stock to remove a certain weapon, so replace ResetPlayerWeapons(playerid); with RemovePlayerWeapon(playerid, 38 );

To be more helpful, I would remove player weapon when he would press the FIRE_KEY without executing this code at OnPlayerUpdate.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_FIRE)
    {
        static weapon;
        weapon = GetPlayerWeapon(playerid);
           
        if(weapon == 38) RemovePlayerWeapon(playerid, 38); 
    }
    return 1;
}
This is just an example.


Re: help no minigun - GrOobY - 01.09.2013

i'm new scripter please give me full pwn script


Respuesta: help no minigun - PabloDiCostanzo - 02.09.2013

if you want a whole script you should post this here


Re: help no minigun - GrOobY - 02.09.2013

please give me this
Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerWeapon(playerid) == 38) ResetPlayerWeapons(playerid);
    return 1;
}
to remove only minigun not all guns please use sendclientmessage "not allowed this gun"

If you have time even to Make the weapon id's 35, 36, 37, 38, 39, 40,