SA-MP Forums Archive
Gates don't open - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gates don't open (/showthread.php?tid=417313)



Gates don't open - dusk - 20.02.2013

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.


Re: Gates don't open - Saw® - 20.02.2013

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;
}



Re: Gates don't open - dusk - 20.02.2013

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