I need a help
#1

hello!
I made a moving object like a gate.
i want to make it move without any commands.
Is it possible? here it is the command

pawn Код:
if (strcmp("/op", cmdtext, true, 10) == 0)
    {
       
        MoveObject(Minigame, 1845.92114258,-1898.49877930,36.24028015,3);
        return 1;
    }
    if (strcmp("/cl", cmdtext, true, 10) == 0)
    {
        MoveObject(Minigame, 1877.67846680,-1875.85620117,36.24028015,3);
        return 1;
    }
Reply
#2

You could use a checkpoint to activate gate, or IsplayerInRangeOfPoint with a timer.
Just a couple of suggestions.

Peace...
Reply
#3

can you tell me with complete details
Reply
#4

pawn Код:
public OnGameModeInit( )
{
    SetTimer( "opengate", (1 * 1000), 1 );
    SetTimer( "closegate", (1 * 1000), 1 );
    return true;
}
Down somewhere...
pawn Код:
forward opengate( );
public opengate( )
{
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z
            MoveObject( Minigame, 1845.92114258,-1898.49877930,36.24028015,3 );
    }
    return true;
}
pawn Код:
forward closegate( );
public closegate( )
{
    new a = 0;
    for( new i = 0; i < MAX_PLAYERS; i++ )
    {
        if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z TOO
        {
            a++;
        }
    }
    if ( a == 0 )  // If no one is close to the gates, it will close them!
        MoveObject( Minigame, 1877.67846680,-1875.85620117,36.24028015,3 );
    return true;
}
Reply
#5

ok ty very much
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)