SA-MP Forums Archive
ZCMD returns 0 - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ZCMD returns 0 (/showthread.php?tid=207175)



ZCMD returns 0 - hanzen - 05.01.2011

Hello, I have a problem with a command that doesn't seem to work. It's suppose to call a callback but it returns me that the command was not found. All my other commands works so... I've also tried calling the callback then returning as true, but still the same.

Well this is the BASIC code:
pawn Код:
COMMAND:gate(playerid, params[])
{
    return ToggleGates(1, 4.0);
}
If you coulden't understand:
pawn Код:
ToggleGates(gateid, Float:speed);



Re: ZCMD returns 0 - DarrenReeder - 05.01.2011

Show us the toggleGates callback


Re: ZCMD returns 0 - hanzen - 05.01.2011

pawn Код:
public ToggleGates(whatgate, Float:speed)
{
    printf("test");
    switch(Gates[whatgate][status])
    {
        case 0:
        {
            MoveDynamicObject(Gates[whatgate][gateid], Gates[whatgate][openx], Gates[whatgate][openy], Gates[whatgate][openz], speed);
            Gates[whatgate][status] = 1;
            print("Gate is closed, opening!");
        }
        case 1:
        {
            MoveDynamicObject(Gates[whatgate][gateid], Gates[whatgate][closedx], Gates[whatgate][closedy], Gates[whatgate][closedz], speed);
            Gates[whatgate][status] = 0;
            print("Gate is open, closing");
        }
    }
    print("Recieved gate");
    return 1;
}