SA-MP Forums Archive
Why this CMD crash my pawno ? - 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: Why this CMD crash my pawno ? (/showthread.php?tid=293178)



Why this CMD crash my pawno ? - -CaRRoT - 27.10.2011

here :

Quote:

if(!strcmp(cmdtext, "/gatefbi", true))
{
if(GateClose)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 126.4606, 377.1736, 9.3897)){
GateClose = false;
MoveObject(Gate, 128.0892, 376.1400, 1.4297, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0x000000FF, "Test");
}
}
else
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 126.4606, 377.1736, 9.3897)){
GateClose = true;
MoveObject(Gate, 126.4606, 377.1736, 9.3897, 3.0);
SetObjectRot(Gate, 0.0, 0.0, 0.0);
return SendClientMessage(playerid, 0xFFFFFFFF, "test Closed");
}
}
}
return 0;
}

and i defined :

Quote:

new Gate, bool:GateClose;

and added :

Quote:

{
Gate = CreateObject(971, 126.4606, 377.1736, 9.3897, 0.0, 0.0, 0.0, 100.0);
return 1;
}




Re: Why this CMD crash my pawno ? - Jesus_wow - 27.10.2011

i think "GateClose = false;" is wrong.


Re: Why this CMD crash my pawno ? - ryoere2k8 - 27.10.2011

remove some closing brackets, crashes usually happen cause of too many brackets


Re: Why this CMD crash my pawno ? - System64 - 27.10.2011

Yo've add one more bracket and use [ pawn ] tags
pawn Код:
if(!strcmp(cmdtext, "/gatefbi", true))
{
    if(GateClose)
    {
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 126.4606, 377.1736, 9.3897))
        {
            GateClose = false;
            MoveObject(Gate, 128.0892, 376.1400, 1.4297, 3.0);
            SetObjectRot(Gate, 0.0, 0.0, 0.0);
            return SendClientMessage(playerid, 0x000000FF, "Test");
        }
    }
    else
    {
        if(IsPlayerInRangeOfPoint(playerid, 15.0, 126.4606, 377.1736, 9.3897))
        {
            GateClose = true;
            MoveObject(Gate, 126.4606, 377.1736, 9.3897, 3.0);
            SetObjectRot(Gate, 0.0, 0.0, 0.0);
            return SendClientMessage(playerid, 0xFFFFFFFF, "test Closed");
        }
    }
    return 0;
}



Re: Why this CMD crash my pawno ? - |_ⒾⓇⓄN_ⒹⓄG_| - 27.10.2011

i posted the code fixed and someone deleted my post -.-