AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Dropped weapons (https://forums.alliedmods.net/showthread.php?t=93883)

Debesėlis 06-03-2009 17:11

Dropped weapons
 
PHP Code:

public rifles(id)
{
    if(
rifles_active[id] == 1)
    {
        
dropPrimaryWeapons(id)
        
dropSecondaryWeapons(id)

        
fm_give_item(id"weapon_usp")
        
fm_give_item(id"weapon_deagle")
        
fm_give_item(id"weapon_ak47")
        
fm_give_item(id"weapon_m4a1")
    }
}

dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)


How do you make all weapons except the usp, deagle, m4a1 and ak47 drop at the start of a new round and stop people from buying anything.

Debesėlis 06-04-2009 07:30

Re: Dropped weapons
 
up

joaquimandrade 06-04-2009 08:08

Re: Dropped weapons
 
Try this. I know that it is not what you want completely but check if you like it.

PHP Code:

#include <amxmodx>
#include <fakemeta_util>
#include <hamsandwich>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Unknown"
#define VERSION    "1.0"

new rifles_active[33]
new 
HamHook:AddPlayerItemHook

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("rifles","rifles")

    
AddPlayerItemHook RegisterHam(Ham_AddPlayerItem,"player","playerAddItem")
}

public 
playerAddItem(id,itemID)
{
    return 
HAM_SUPERCEDE;
}

public 
rifles(id)
{
    
rifles_active[id] = 1;
    
    if(
rifles_active[id])
    {
        
DisableHamForward(AddPlayerItemHook);
        
        
fm_give_item(id"weapon_usp")
        
fm_give_item(id"weapon_deagle")
        
fm_give_item(id"weapon_ak47")
        
fm_give_item(id"weapon_m4a1")
        
        
EnableHamForward(AddPlayerItemHook);
    }
    
    return 
PLUGIN_HANDLED;



Debesėlis 06-04-2009 08:48

Re: Dropped weapons
 
Thank you, maybe you have some another ideas ?

joaquimandrade 06-04-2009 09:10

Re: Dropped weapons
 
Quote:

Originally Posted by Debesėlis (Post 841384)
Thank you, maybe you have some another ideas ?

Tell exactly what you want. Like:

None item/weapon can be bought (That includes armor / defuser)
None weapon can be caught from the floor (There are maps that have weapons on the floor)

Debesėlis 06-04-2009 10:14

Re: Dropped weapons
 
Rifle is one of the functions of admin menu, I turn it on and have the M3 weapon. When I spawn in the next round rifles function give me weapons but the M3 stay, overall player have 3 weapons Ak47, M4A1 and M3 I want that he would have only 2 weapons. I want to strip all weapons of those who give emphasis.

I hope you understand me :)

joaquimandrade 06-04-2009 10:23

Re: Dropped weapons
 
Quote:

Originally Posted by Debesėlis (Post 841425)
Rifle is one of the functions of admin menu, I turn it on and have the M3 weapon. When I spawn in the next round rifles function give me weapons but the M3 stay, overall player have 3 weapons Ak47, M4A1 and M3 I want that he would have only 2 weapons. I want to strip all weapons of those who give emphasis.

I hope you understand me :)

Sorry but i don't understand what spawn has to do with this.

What you want is the thing from the other thread but with strip instead of drop?

Debesėlis 06-04-2009 10:34

Re: Dropped weapons
 
PHP Code:

dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)


This code is drop weapons. I need to strip all the weapons except c4, m4a1, ak47 and usp.


joaquimandrade 06-04-2009 10:53

Re: Dropped weapons
 
Quote:

Originally Posted by Debesėlis (Post 841443)
PHP Code:

dropPrimaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastPrimaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
         
weaponID get_pdata_cbase(idm_pLastPrimaryItem)
    }
}

dropSecondaryWeapons(id)
{
    new 
weaponID get_pdata_cbase(idm_pLastSecondaryItem)

    while(
weaponID != -1)
    {
        
dropWeapon(idweaponID)    
        
weaponID get_pdata_cbase(idm_pLastSecondaryItem)
    }        
}

dropWeapon(playerIDweaponID)
{
    static 
weaponName[32]
    
pev(weaponIDpev_classnameweaponNamecharsmax(weaponName))

    
engclient_cmd(playerID"drop"weaponName)


This code is drop weapons. I need to strip all the weapons except c4, m4a1, ak47 and usp.

Tell me one thing.

In this code: http://forums.alliedmods.net/showpos...5&postcount=12

What is missing except the part of changing drop to strip?

Debesėlis 06-04-2009 10:55

Re: Dropped weapons
 
block buy weapons on respawn.


All times are GMT -4. The time now is 13:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.