SA-MP Forums Archive
One DCMD Command disable all the STRCMP cmds ! - 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: One DCMD Command disable all the STRCMP cmds ! (/showthread.php?tid=203412)



One DCMD Command disable all the STRCMP cmds ! - Yaszine - 26.12.2010

Hey,

I've a [FS]Car Spawner -> https://sampforum.blast.hk/showthread.php?tid=125692 (V2.0)
It's a DCMD command .. It's works very much
but the other cmds in my GM doesn't work !
PS: I've LuxAdmin FS all his cmds are DCMD but it work normal and the GM works too.

Some one can find the problem ?
Please


Re: One DCMD Command disable all the STRCMP cmds ! - admantis - 27.12.2010

I think this happens because in the end of OnPlayerCommandText you have return 0; and in main gamemode return 1; or anything different OR viceversa. Try taking a look on that.


Re: One DCMD Command disable all the STRCMP cmds ! - XePloiT - 27.12.2010

are you using zcmd?


Re : Re: One DCMD Command disable all the STRCMP cmds ! - Yaszine - 27.12.2010

Quote:
Originally Posted by admantis
Посмотреть сообщение
I think this happens because in the end of OnPlayerCommandText you have return 0; and in main gamemode return 1;
I have this in the FS:

pawn Код:
dcmd_v(playerid,params[])
{
                Blabla ...
        format(string, sizeof(string), "--> %s [Model ID: %d | Colours: %d,%d] has been spawned.", VehicleNames[car-400], car, colour1, colour2);
        return SendClientMessage(playerid, WHITE, string);
    }
in GM i have:

pawn Код:
if(strcmp(cmdtext,"/mycommand",true) == 0)
{
      //Do something here.
    return 1;
}



Re : Re: One DCMD Command disable all the STRCMP cmds ! - Yaszine - 27.12.2010

Quote:
Originally Posted by XePloiT
Посмотреть сообщение
are you using zcmd?
No, In the main GM I use STRCMP and the FS it's DCMD !


Re: One DCMD Command disable all the STRCMP cmds ! - Hiddos - 27.12.2010

At the end of OnPlayerCommandText you must always return 0, else the script thinks that the command the user typed is correct and so it won't pass information to other scripts.


Re : One DCMD Command disable all the STRCMP cmds ! - Yaszine - 27.12.2010

I have change the return 1; on the GM to return 0; (the last cmd) but still the same problem !


Re : One DCMD Command disable all the STRCMP cmds ! - Yaszine - 27.12.2010

Bump


Re: One DCMD Command disable all the STRCMP cmds ! - admantis - 27.12.2010

Don't change the return 0; from the last command, change it to the end of the callback!!


Re : Re: One DCMD Command disable all the STRCMP cmds ! - Yaszine - 27.12.2010

Quote:
Originally Posted by admantis
Посмотреть сообщение
change it to the end of the callback!!
I have at the end of callback:

pawn Код:
return SendClientMessage(playerid,RED,"ERROR: Command doesn't exist.");
}
which means, if player tape invalid command it's gives him this line, in place of SERVER: Unknown Command.