SA-MP Forums Archive
SERVER: Unknown Command. - Can't figure out the reason for it.. - 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: SERVER: Unknown Command. - Can't figure out the reason for it.. (/showthread.php?tid=184791)



[SOLVED] SERVER: Unknown Command. - Can't figure out the reason for it.. - Castle - 21.10.2010

I know I'm scripting in very old fashion, but for testing stuff especially gate and shit i prefer that way.
here's my command: http://pastebin.com/HNd11L9r
Could someone point me to the reason that is causing that shit?


Re: SERVER: Unknown Command. - Can't figure out the reason for it.. - Mauzen - 21.10.2010

pawn Code:
if(pdss!=1)//LSPD Garage Shutter
       {
                if(PlayerToPoint(10,playerid,1592.720337,-1638.043579,14.911348))
                {
                        MoveObject(pds,1592.720337,-1638.043579,9.612303,3);
                        pdss=1;
                        SetTimer("AutoClose",5000,0);
                }
                return 1;
        }
        else return SendClientMessage(playerid,COLOR_GREY,"The gate is already open or you are too far.");
Do it like this for all cmds. The problem is, if pdss!=1, but the playertopoint stuff is false, it also wont call the else stuff, so it wont return anything.


Re: SERVER: Unknown Command. - Can't figure out the reason for it.. - CJ101 - 21.10.2010

You are not returning 1 when you close the command.


Re: SERVER: Unknown Command. - Can't figure out the reason for it.. - HrvojeCro - 21.10.2010

pawn Code:
if(pdss!=1)//LSPD Garage Shutter
       {
                if(PlayerToPoint(10,playerid,1592.720337,-1638.043579,14.911348))
                {
                        MoveObject(pds,1592.720337,-1638.043579,9.612303,3);
                        pdss=1;
                        SetTimer("AutoClose",5000,0);
                }
                return 1;
        }
        else SendClientMessage(playerid,COLOR_GREY,"The gate is already open or you are too far.");
return 1;
}
I edited 4 you
but heres how i do with commands
pawn Code:
if(strcmp("/openirtgrg", cmdtext, true, 10) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 25.0, 755.948486, -1337.448364, 15.041857))
    {
        if(gTeam[playerid] != TEAM_IRT)
            return SendClientMessage(playerid, 0xEF994300, "you dont work in Interglobal Radio-Television!");
        MoveObject(irtgarage, 755.948486, -1337.448364, 10.816921, 1);
        SendClientMessage(playerid, 0xEF994300, "garage is opening...");
    }
    else
    {
        SendClientMessage(playerid, 0xEF994300, "youre not near garage!");
    }
    return 1;
    }



Re: SERVER: Unknown Command. - Can't figure out the reason for it.. - Castle - 21.10.2010

Thanks guys, it works now.