ItsMods

Full Version: [FIXED]Code problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Anybody knows whats wrong with this code?
I don't see the text and i don't get the AUG when pressing X

Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
        self takeAllWeapons();
        self thread doOMA();
        self giveWeapon("thundergun_zm");
        self giveWeapon("ray_gun_zm");
        self giveWeapon("tesla_gun_zm");
        self giveWeapon("m16_gl_upgraded_zm", 0, self calcWeaponOptions ( 15, 0, 0, 0, 0 ));
    }
}

doOMA()
{
    self endon("disconnect");
    self endon("death");

    for(;;)
    {
        self waittil("spawned_player");

        if ( self ButtonPressed( "X" , "+actionslot 1" ) )
        {
            wait .5;
            self iPrintlnBold("^2Obtaining AUG^7...");
            wait 10;
            self giveWeapon("aug_elbit_gl_mp", 0, self calcWeaponOptions ( 8, 0, 0, 0, 0 ));
            wait .5;
        }
    }
}
Does it say: "Obtaining AUG" when pressing x?
(08-22-2011, 14:41)surtek Wrote: [ -> ]Does it say: "Obtaining AUG" when pressing x?

nope
(08-22-2011, 14:45)ddaavvee Wrote: [ -> ]
(08-22-2011, 14:41)surtek Wrote: [ -> ]Does it say: "Obtaining AUG" when pressing x?

nope

are you sure that this is ok?

if ( self ButtonPressed( "X" , "+actionslot 1" ) )
Quote:are you sure that this is ok?

if ( self ButtonPressed( "X" , "+actionslot 1" ) )

yep, just checked my config_mp
(08-22-2011, 14:51)ddaavvee Wrote: [ -> ]
Quote:are you sure that this is ok?

if ( self ButtonPressed( "X" , "+actionslot 1" ) )

yep, just checked my config_mp

Dont think that this is right.
Lokk in the tut Section. There is a tutorial for how to use every Button.
you guys think i need to put while(1) somewhere?
i wouldn't know where
Code:
if ( self ButtonPressed( "X" , "+actionslot 1" ) )

There is the problem, you cannot use X in that way I think. Use this code instead: http://www.itsmods.com/forum/Thread-Moni...y-key.html
self ButtonPressed( "X" , "+actionslot 1" )

is not a valid function.
Code:
if ( self ButtonPressed( "X" , "+actionslot 1" ) )
should read
Code:
        if( self ActionSlotOneButtonPressed() )


Also remove this following line from the second part of your thread, otherwise it wont work.
Code:
self waittil("spawned_player");


Pages: 1 2