AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with an uwc3x item (https://forums.alliedmods.net/showthread.php?t=110078)

(--eRRoR--) 11-24-2009 20:29

Help with an uwc3x item
 
Y have made an item for the uwc3x mod that makes you for 10 seconds completly invizible but its to powerfull and y want to make it to be able to attack only with the knife while invs.
Here is the code for the item.

Activation on invizibility.
Code:

    if( playeritem3[id] == INVIS)
    {
        set_entity_visibility ( id, 0 );
        new parm[2];
        parm[0] = id;
        parm[1] = INVIS;

        //Play sound
        if( Util_Should_Msg_Client(id) )
        {
            set_hudmessage(0, 255, 255, 0.0, 0.55, 0, 6.0, 3.0, 0.1, 0.2, 1);
            show_hudmessage(id, "%L", LANG_PLAYER, "SM3_INVIS", MOD);
            if ( file_exists( "sound/uwc3x/shopmenu/sm3_inv.wav" ) == 1 )
            {
                emit_sound( id, CHAN_STATIC, "uwc3x/shopmenu/sm3_inv.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
            }
        }
       
        //reset via task in 10 seconds
        parm2[1] = 3;
        set_task( 10.0, "Task_Reset_Shopmenu3", SHOPMENU3_RESET + id, parm2, 2);   
    }

Removing the invizibility.
Code:

    else if( reset_item == 3 )
    {
        set_entity_visibility ( id, 1 );
        if( Util_Should_Msg_Client(id) )
        {
            set_hudmessage(0, 255, 255, 0.0, 0.55, 0, 6.0, 3.0, 0.1, 0.2, 1);
            show_hudmessage(id, "%L", LANG_PLAYER, "SM3_VISIBLE", MOD);
            if ( file_exists( "sound/uwc3x/shopmenu/sm3_inv_done.wav" ) == 1 )
            {
                emit_sound( id, CHAN_STATIC, "uwc3x/shopmenu/sm3_inv_done.wav", 1.0, ATTN_NORM, 0, PITCH_NORM );
            }
        }
    }


(--eRRoR--) 11-26-2009 01:15

Re: Help with an uwc3x item
 
Bump.
Y would really apreciate some help.

(--eRRoR--) 11-28-2009 17:04

Re: Help with an uwc3x item
 
Come on guys a little help please.

DarkGod 11-28-2009 17:08

Re: Help with an uwc3x item
 
if(get_user_weapon(id) != CSW_KNIFE) // user does not have knife up

...

(--eRRoR--) 11-29-2009 09:55

Re: Help with an uwc3x item
 
ok so that is for puting a knife to the user.And to remove it after the invisibiliti is gone?

(--eRRoR--) 12-02-2009 05:55

Re: Help with an uwc3x item
 
bump

One 12-02-2009 09:04

Re: Help with an uwc3x item
 
for first :

why
PHP Code:

set_entity_visibility id); ? 

and why not set_rending?

2. why you dont check the weapon and set a task for xxx sec. to setting/remove rendering?

to check the weapon :

PHP Code:

if(get_user_weapon(id) == CSW_KNIFE)
{
//set rendring
}
else
{
//remove rending


and STOP BUMPING EVERY DAY

(--eRRoR--) 05-17-2010 15:53

Re: Help with an uwc3x item
 
you guys dindt uderstood wath y want.

Y want to put when this task in activated if ( playeritem3[id] == INVIS)
that only the knife could be used and after the task expires the weapons to be given back

Jelle 05-17-2010 17:29

Re: Help with an uwc3x item
 
if ( playeritem3[id] == INVIS && get_user_weapon(id) == CSW_KNIFE)

(--eRRoR--) 05-17-2010 17:44

Re: Help with an uwc3x item
 
y tried it but it only make me invizible when if y have the knife in my hand.
Y want this item to make me invisible but while y am invisible not to be able to use anithing else then the knife and not to be able to pickup anithing.After the time of the item passes y want to be able to use my guns again.

Did you understod now?

Thanks for the help until now.


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

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