AlliedModders

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

lolzin123 06-16-2009 12:46

[HELP] Striping Weapon.
 
I need make a code to strip weapon from player and 20 seconds later give the same weapons to him again.

tpt 06-16-2009 13:07

Re: [HELP] Striping Weapon.
 
Use strip_user_weapons ( index ) and then add the 20 second delay with set_task ( Float:time, const function[], id = 0, parameter[]="", len = 0, flags[]="", repeat = 0 ). And after delay give weapons with: give_item ( index, const item[] )

lolzin123 06-16-2009 13:12

Re: [HELP] Striping Weapon.
 
Yep but how do I return the same weapons that the player was using?

AntiBots 06-16-2009 17:23

Re: [HELP] Striping Weapon.
 
PHP Code:

#include <amxmodx>
#include <fun>

new g_weapons[33][32]
new 
g_iNum[33]

public 
plugin_init() 
{
    
register_plugin("1""2""3")
    
    
register_clcmd("say test1""test1")
    
register_clcmd("say test2""test2")
}

public 
test1id )
{
    
get_user_weapons(idg_weapons[id], g_iNum[id])
    
strip_user_weapons(id)
}

public 
test2id )
{
    static 
StrData[32], i
    
for(0g_iNum[id]; i++)
    {
        
get_weaponname(g_weapons[id][i], StrData31)
        
give_item(idStrData)
    }


Fix, I do this some month ago.

lolzin123 06-16-2009 18:22

Re: [HELP] Striping Weapon.
 
How do I put this in my code?

P i x e L 06-16-2009 18:59

Re: [HELP] Striping Weapon.
 
Well what's the code you currently have?

lolzin123 06-16-2009 19:27

Re: [HELP] Striping Weapon.
 
This code:
PHP Code:

case OBJECT_FROSTBLOCK:
        {
            
set_task(0.0"tsk_add_frost"plr);
            
set_task(10.0"tsk_remove_frost"plr);
        }

public 
tsk_remove_frost(plr)
{
    
set_pev(plrpev_maxspeed250.0);
    
}

public 
tsk_add_frost(plr)
{
    
set_pev(plrpev_maxspeed0.1);
    
    
strip_user_weapons (plr);
    
    
set_hudmessage(00255,  -1.00.2006.012.00.01.03);
    
show_hudmessage(plr"Message.");




All times are GMT -4. The time now is 14:05.

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