SA-MP Forums Archive
UNKNOWN COMMAND - WORKED BUT ERROR - 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: UNKNOWN COMMAND - WORKED BUT ERROR (/showthread.php?tid=368415)



UNKNOWN COMMAND - WORKED BUT ERROR - nGen.SoNNy - 13.08.2012

Hi all! If i type this command... i will buy the house but i will get the msg: unknown command... so.. (succes = 0 ) .. Can you help me?


pawn Код:
if( success == 0)Info( playerid, "~r~~h~Unknown Command!~n~~n~~w~These commands may help you~n~~g~~h~/help /cmds /teles /rules /credits",6000 );

pawn Код:
CMD:exithouse(playerid, params[])
{
    new pos = IsPlayerInRangeOfHouseEx(playerid);
    if(IsPlayerInRangeOfHouseEx(playerid))
    {
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerPos(playerid, HouseEnterX[playerid], HouseEnterY[playerid], HouseEnterZ[playerid]);
        return CallLocalFunction("OnPlayerExitHouse", "dd", playerid, pos);
    }
    else SendError(playerid, "You have to be in someone House!");
    return ( 1 );
}



Re: UNKNOWN COMMAND - WORKED BUT ERROR - JaKe Elite - 13.08.2012

Edit: Fail

no, not success == 0
it must be like this

pawn Код:
if(!sucess) return //do whatever you want here
put it here

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], sucess)
{
    return 1;
}



Re: UNKNOWN COMMAND - WORKED BUT ERROR - nGen.SoNNy - 13.08.2012

my problem is on that command not my command check i'm using that function on OnPlayerCommandPerformed
And i found the problem... i have to remove that return from
pawn Код:
return CallLocalFunction("OnPlayerExitHouse", "dd", playerid, pos);
I'm a little bit angry and i lost my mind on this easy thing..,


Re: UNKNOWN COMMAND - WORKED BUT ERROR - JaKe Elite - 13.08.2012

Remove the return from the CallRemoteFunction
then under the CallRemoreFunction put return 1;


Re: UNKNOWN COMMAND - WORKED BUT ERROR - nGen.SoNNy - 13.08.2012

I said: "And i found the problem... i have to remove that return" ....