Gates don't open
#1

So i'm trying to create that would move on the same command
pawn Код:
new bool:sasa;
CMD:blet(playerid,params[])
{
    if(sasa==false)
    {
        MoveObject(JailGate,-314.29998779297,1507.4000244141,77.099998474121,5.0,0,0,179.99450683594);
        sasa = true;
    }
    if(sasa==true)
    {
        MoveObject(JailGate,-302.89999389648,1507.5,77.099998474121,5.0,0,0,179.99450683594);
        sasa = false;
    }
    return 1;
}
Anyone sees the problem? coordinates are good,if they are in different commands they work.
Reply
#2

Don't know if it will fix it , but use 'else if' instead of 'if' in the second condition:
pawn Код:
new bool:sasa;
CMD:blet(playerid,params[])
{
    if(sasa==false)
    {
        MoveObject(JailGate,-314.29998779297,1507.4000244141,77.099998474121,5.0,0,0,179.99450683594);
        sasa = true;
    }
    else if(sasa==true)
    {
        MoveObject(JailGate,-302.89999389648,1507.5,77.099998474121,5.0,0,0,179.99450683594);
        sasa = false;
    }
    return 1;
}
Reply
#3

That didn't even cross my mind,Thanks! Was working on that for a while lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)