Moving gates
#1

pawn Код:
forward gate();
public gate()
{
    new mygate_status2;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(IsPlayerInRangeOfPoint(i,10.0,1800.99133301,695.87310791,15.11301613))mygate_status2=1;

    }
    if(mygate_status2)MoveObject(mygate2, 1800.99133301,695.87310791,10.11301613,3);
    else MoveObject(mygate2, 1800.99133301,695.87310791,15.11301613, 3);
}
I want that it gets 30 dollar if he passes but how? :S
Reply
#2

Why exactly do you have a loop inside there, when your callback header contains playerid?
Reply
#3

That was for the GivePlayerMoney but that failed
Reply
#4

Help me lal! this is a easy question i think!
Reply
#5

You need to give us some more information... Your code doesn' make any sense at all.
Reply
#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
#7

This doesnt work
It doesnt go up OR down :S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)