How to change a variable?
#4

Try this

pawn Код:
/*
new GateOpenStatus;
//You don't have to do this, you can give them the value of 0 when you declare them like i did under here
new DoorStatus;
*/


new bool:GateOpenStatus;
new bool:DoorStatus;

// ^^ OnGameModeInit //

if(!strcmp(cmdtext, "/", true))//you need to put the command name here ^^
{
    if(IsPlayerInRangeOfPoint(playerid, 10, 1410.19995117, -1650.09997559, 13.80000019))
    {
        if(!GateOpenStatus)
        {
            MoveObject(GateOpen, 1410.09997559, -1650.09997559, 10.80000019, 3);
            SendClientMessage(playerid, 0xEF994300, "You have opened the gate.");
            GateOpenStatus = true;
        }
        else
        {
            MoveObject(GateOpen, 1410.19995117, -1650.09997559, 13.80000019, 3);
            SendClientMessage(playerid, 0xEF994300, "You have closed the gate.");
            GateOpenStatus = false;
        }
    }
    else if(IsPlayerInRangeOfPoint(playerid, 10, 955.70001221,-50.70000076,1002.00000000))
    {
        if(!DoorStatus)
        {
            MoveObject(Door, 955.70001221,-50.59999847,998.20001221, 3);
            DoorStatus = true;
        }
        else
        {
            MoveObject(Door, 955.70001221,-50.70000076,1002.00000000, 3);
            DoorStatus = false;
        }
    }
    return true;
}
Reply


Messages In This Thread
How to change a variable? - by Rabbayazza - 17.07.2012, 23:13
Re: How to change a variable? - by Ranama - 17.07.2012, 23:26
Re: How to change a variable? - by Rabbayazza - 18.07.2012, 01:10
Re: How to change a variable? - by ViniBorn - 18.07.2012, 01:43

Forum Jump:


Users browsing this thread: 1 Guest(s)