AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Weapon Set (https://forums.alliedmods.net/showthread.php?t=305710)

soumyadip77 03-01-2018 11:05

[HELP] Weapon Set
 
i want to set all players weapon to knife.

remove c4 and all weapons and he dont pickup or buy weapons.

me make it
PHP Code:

RegisterHam(Ham_Spawn"player""KnifeRoundStart"1);

public 
KnifeRoundStart() 
{
    for ( new 
<= gMaxPlayers i++ )
    {
        if (
is_user_alive(i))
        {
            
cs_set_user_money(i0)
            
rg_give_item(i"wepon_knife")
            
rg_remove_all_items(i)
            
engclient_cmd(i"weapon_knife")
        }
    }
    


please help

WhiteFang1319 03-01-2018 11:23

Re: [HELP] Weapon Set
 
Code:

native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND);

Use with rg_give_item
enum GiveType {    GT_APPEND,          // Just give item    GT_REPLACE,        // Give the item and remove all other weapons from the slot    GT_DROP_AND_REPLACE // Give the item and drop all other weapons from the slot };

A quicksearch always helps you. If this is you want.

E1_531G 03-01-2018 17:47

Re: [HELP] Weapon Set
 
Quote:

Originally Posted by WhiteFang1319 (Post 2580855)
Code:

native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND);

Use with rg_give_item
enum GiveType {    GT_APPEND,          // Just give item    GT_REPLACE,        // Give the item and remove all other weapons from the slot    GT_DROP_AND_REPLACE // Give the item and drop all other weapons from the slot };

A quicksearch always helps you. If this is you want.

There is no guarantee that he uses Re products. This is the forum for AMX not Re*.

OciXCrom 03-01-2018 19:51

Re: [HELP] Weapon Set
 
Quote:

Originally Posted by E1_531G (Post 2580913)
There is no guarantee that he uses Re products. This is the forum for AMX not Re*.

The code he posted containing "Re products" definitely doesn't guarantee he's using them.

PS - this forum isn't for AMX.
PS2 - Re is officially supported in AMXX's core.

soumyadip77 03-01-2018 20:01

Re: [HELP] Weapon Set
 
Quote:

Originally Posted by WhiteFang1319 (Post 2580855)
Code:

native rg_give_item(const index, const pszName[], GiveType:type = GT_APPEND);

Use with rg_give_item
enum GiveType {    GT_APPEND,          // Just give item    GT_REPLACE,        // Give the item and remove all other weapons from the slot    GT_DROP_AND_REPLACE // Give the item and drop all other weapons from the slot };

A quicksearch always helps you. If this is you want.

i cant under stand can you edit on this file and hamspawn is right for set every ones weapon to knife

WhiteFang1319 03-01-2018 20:57

Re: [HELP] Weapon Set
 
rg_give_item(index, "weapon_knife", GT_DROP_AND_REPLACE)
Though I'm not sure if the item( weapon) class name is correct or not

OciXCrom 03-02-2018 09:43

Re: [HELP] Weapon Set
 
Quote:

Originally Posted by WhiteFang1319 (Post 2580924)
rg_give_item(index, "weapon_knife", GT_DROP_AND_REPLACE)
Though I'm not sure if the item( weapon) class name is correct or not

What are you exactling dropping and replacing from the knife slot?!

WhiteFang1319 03-02-2018 10:38

Re: [HELP] Weapon Set
 
Quote:

Originally Posted by OciXCrom (Post 2580987)
What are you exactling dropping and replacing from the knife slot?!

My bad


All times are GMT -4. The time now is 20:36.

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