Pawn command error
#1

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

Can send the cmd: help line here
Reply
#3

Return 0;
at the end of OnPlayerCommandText and the lenght of the "/help" is 5, not 10.
Reply
#4

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

I used Zcmd and it worked, thanks to everyone for help.
Problem solved.
Reply
#6

use like this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
   if(!strcmp("/help",cmdtext,true)) {
      // Rest of your codes
      return 1;
   }
   return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)