One DCMD Command disable all the STRCMP cmds !
#1

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
Reply
#2

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.
Reply
#3

are you using zcmd?
Reply
#4

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

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

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.
Reply
#7

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

Bump
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)