Pawn command 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: Pawn command error (
/showthread.php?tid=402927)
Pawn command error -
Vlad64 - 28.12.2012
Hi, i need some help.
I got a problem with a command, when i type /help it says unknown command and it won't do anything...
Here is the command (It's under OnPlayerCommandText of course)
Quote:
if (strcmp("/help", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid,COLOR_WHITE, "|-------------------------Help-------------------------|");
SendClientMessage(playerid,COLOR_WHITE, "General Commands: /help");
SendClientMessage(playerid,COLOR_WHITE, "Airplane Commands: /flytolv /flytols");
SendClientMessage(playerid,COLOR_WHITE, "Vehicle Commands: /engine /seatbelt");
SendClientMessage(playerid,COLOR_WHITE, "Other Commands: /renthelp");
SendClientMessage(playerid,COLOR_WHITE, "|------------------------------------------------------|");
return 1;
}
|
And this happens when i type /help
Re: Pawn command error -
aslan890 - 28.12.2012
Can send the cmd: help line here
Re: Pawn command error -
Konstantinos - 28.12.2012
Return 0;
at the end of OnPlayerCommandText and the lenght of the "/help" is 5, not 10.
Re: Pawn command error -
Vlad64 - 28.12.2012
Quote:
Originally Posted by Dwane
Return 0;
at the end of OnPlayerCommandText and the lenght of the "/help" is 5, not 10.
|
I got Return 0; at the end of OnPlayerCommandText. I changed 10 to 5 and it didn't helped.
I can send you the whole OnPlayerCommandText if u want...
Re: Pawn command error -
Vlad64 - 28.12.2012
I used Zcmd and it worked, thanks to everyone for help.
Problem solved.
Re: Pawn command error -
dr.lozer - 28.12.2012
use like this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/help",cmdtext,true)) {
// Rest of your codes
return 1;
}
return 0;
}