ItsMods

Full Version: player checkpoints
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
You can use this to set checkpoints and see if he completed that one already
Code:
playerCheckpoint( name )
{
    return( isDefined( self.Checkpoints[ name ] ) );
}

getPlayerCheckpoint( name )
{
    if( !isDefined( self.Checkpoints[ name ] ) )
        return undefined;
        
    return self.Checkpoints[ name ];
}

setPlayerCheckpoint( name, arg )
{
    if( !isDefined( self.Checkpoints ) )
        self.Checkpoints = [];
    
    if( !isDefined( arg ) )
        arg = true;
    
    self.Checkpoints[ name ] = arg;
}

clearPlayerCheckpoint( name )
{
    self.Checkpoints[ name ] = undefined;
}


here's an example
Code:
thing()
{
    self setPlayerCheckpoint( "thing" );
    
    while( playerCheckpoint( "thing" ) )
    {
        if( randomInt( 250 ) < 25 )
            self clearPlayerCheckpoint( "thing" );
            
        wait 1;
    }
    
    // blablabla
}
Omg nice
its like SP ?
EDIT: WTF thanks for idea (gametype for my mod :3)
(10-01-2011, 10:08)Se7en Wrote: [ -> ]Omg nice
its like SP ?

dunno what you mean but I normally use it to block something untill he has its checkpoint...

Code:
while( !playerCheckpoint( "thing" ) )
wait .05;
Why is this useful? Its much easier to just do self.shit = "bla"; .. now you have to use the function.. hmm
(10-01-2011, 10:11)Pozzuh Wrote: [ -> ]Why is this useful? Its much easier to just do self.shit = "bla"; .. now you have to use the function.. hmm

like the shit you posted is usefull
Well, yes.

:umad:
(10-01-2011, 10:11)Pozzuh Wrote: [ -> ]Why is this useful? Its much easier to just do self.shit = "bla"; .. now you have to use the function.. hmm

This.


(10-01-2011, 10:12)iAegle Wrote: [ -> ]like the shit you posted is usefull

Also this.
cool not bad
(10-01-2011, 10:11)Pozzuh Wrote: [ -> ]Why is this useful? Its much easier to just do self.shit = "bla"; .. now you have to use the function.. hmm

If you wanna make custom gametype like "race" (funny gametype from HALO) you need checkpoint, can be for example flag.

My sugestion is make race mod, when a player reach point can spawn maybe weapon or bonus perk, like old school, add spawning weapon like when using quantum device in moon map but only after grab flag.
(10-01-2011, 17:34)Gladio Wrote: [ -> ]
(10-01-2011, 10:11)Pozzuh Wrote: [ -> ]Why is this useful? Its much easier to just do self.shit = "bla"; .. now you have to use the function.. hmm

If you wanna make custom gametype like "race" (funny gametype from HALO) you need checkpoint, can be for example flag.

My sugestion is make race mod, when a player reach point can spawn maybe weapon or bonus perk, like old school, add spawning weapon like when using quantum device in moon map but only after grab flag.

but you don't need functions for that, you could just do checkpoint1 = (0,0,0);
Pages: 1 2