Moving gates
#6

Try this:
pawn Код:
#include <a_samp>

#define CB:%0(%1) forward %0(%1); public %0(%1)
#define loop:%0(%1) for(new %1; %1 < %0; %1++)

new mygate2, gate_status;

public OnFilterScriptInit()
{
    mygate2 = CreateObject...; //Gate closed
    gate_status = 0;
    return 1;
}

CB:gate()
{
    loop:MAX_PLAYERS(i){
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i, 10, 1800.99133301, 695.87310791, 15.11301613)){
            if(gate_status == 0){
                MoveObject(mygate2...... //Move object to OPEN
                gate_status = 1;
                GivePlayerMoney(i, -30); //Remove 10 bucks
            }
        }
        else{
            if(gate_status == 1){
                MoveObject(mygate2..... //Move object to CLOSE
                gate_status = 0;
             }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Moving gates - by thimo - 23.01.2011, 12:00
Re: Moving gates - by Not available - 23.01.2011, 12:01
Re: Moving gates - by thimo - 23.01.2011, 12:02
Re: Moving gates - by thimo - 23.01.2011, 12:22
Re: Moving gates - by Not available - 23.01.2011, 12:43
Re: Moving gates - by Kwarde - 23.01.2011, 12:51
Re: Moving gates - by thimo - 23.01.2011, 14:42

Forum Jump:


Users browsing this thread: 1 Guest(s)