Why this CMD crash my pawno ?
#1

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

Reply
#2

i think "GateClose = false;" is wrong.
Reply
#3

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

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;
}
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)