Command gone rong - 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: Command gone rong (
/showthread.php?tid=64651)
Command gone rong -
JoeDaDude - 06.02.2009
Ok i made two commands, And one is set to say: TXS Usage: /requestland [LS/LV/SF]
And the others supposed to say: %s to LS ATC, Requesting runway clear.
But the first one says: TXS Usage: /requestland [LS/LV/SF] like its supposed to.
But the second one says: TXS Usage: /requestland [LS/LV/SF] when it shouldnt
Why is this?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, COLOR_GREY, "TXS Usage: /requestland[LS/LV/SF]");
return 1;
}
if (strcmp("/mycommand1", cmdtext, true, 10) == 0)
{
SendClientMessageToAll(COLOR_GREY, "to LS ATC, is requesting landing.");
return 1;
}
return 0;
}
Re: Command gone rong -
Auto-Sized - 06.02.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)//<-------->count /mycommand
{
SendClientMessage(playerid, COLOR_GREY, "TXS Usage: /requestland[LS/LV/SF]");
return 1;
}
if (strcmp("/mycommand1", cmdtext, true, 10) == 0)//<-------->count /mycommand1 then look at 10
{
SendClientMessageToAll(COLOR_GREY, "to LS ATC, is requesting landing.");
return 1;
}
return 0;
}
Re: Command gone rong -
JoeDaDude - 06.02.2009
I dnt understand
Re: Command gone rong -
Auto-Sized - 06.02.2009
1 2 3 4 5 6 7 8 9 10
/ m y c o m m a n d
1 2 3 4 5 6 7 8 9 10 11
/ m y c o m m a n d 1
its 10 in each command so you still using first command.
Re: Command gone rong -
JoeDaDude - 06.02.2009
ahh
Re: Command gone rong -
JoeDaDude - 06.02.2009
Advice was helpless, Still does it, Even does it for commands that dont exist, Whats the problem.
It dosent do it for commands that dont use SendClientMessage,
Just ones that have the code
in
Re: Command gone rong -
Lazarus - 06.02.2009
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true) == 0)
{
SendClientMessage(playerid, COLOR_GREY, "TXS Usage: /requestland[LS/LV/SF]");
return 1;
}
if (strcmp("/mycommand1", cmdtext, true) == 0)
{
SendClientMessageToAll(COLOR_GREY, "to LS ATC, is requesting landing.");
return 1;
}
return 0;
}
Re: Command gone rong -
Auto-Sized - 06.02.2009
The point is the commands are so similar. You should have renamed that second command to anything
pawn Код:
if (strcmp("/second", cmdtext, true, 7) == 0)
then changed the number accordingly this you did not do. You will find it works.
Re: Command gone rong -
kaisersouse - 06.02.2009
dcmd for the win
Re: Command gone rong -
JoeDaDude - 07.02.2009
the commands need to be the same,
There for diffrent islands and the others a usage