HELP! Commands not working at all
#1

Hello.

I've got a major problem.
My commands won't work. Here's the example of samp wiki:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(!strcmp(cmdtext, "/help", true))
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
    return 1;
    /* Returning '1' is used to notify the server that the command
    has successfully been processed. If you return true here you won't
    get that 'SERVER: Unknown Command.', and any conflicts will be
    avoided.
    */

  }
  return 0;
/* Returning '0' is used to inform the server that the command
has not been successfully processed, and passes it to other scripts.
If there hasn't been a successful process, then you will get that
'SERVER: Unknown Command.' error.
*/

}
Everything I try, I get the message 'SERVER: Unknown Command'.
Tried changing returns to 0, all way around, tried everything.
Just can't make the commands work.


HELP?
Reply
#2

[10:38:21] filterscripts = "" (string)
[10:38:21]
[10:38:21] Server Plugins
[10:38:21] --------------
[10:38:21] Loading plugin: Whirlpool
[10:38:21]
[10:38:21] ==================
[10:38:21]
[10:38:21] Whirlpool loaded
[10:38:21]
[10:38:21] ==================
[10:38:21]
[10:38:21] Loaded.
[10:38:21] Loading plugin: irc
[10:38:21]

*** IRC Plugin v1.3.5 by Incognito loaded ***


[10:38:21] Loaded.
[10:38:21] Loaded 2 plugins.

[10:38:21]
[10:38:21] Ban list
[10:38:21] --------
[10:38:21] Loaded: samp.ban
[10:38:21]
[10:38:21]
[10:38:21] Filter Scripts
[10:38:21] ---------------
[10:38:21] Loaded 0 filter scripts.

[10:38:21]



That's all it says in server log for server startup
Reply
#3

Idk if it is any help but I removed Whirlpool and irc from plugins.
Also I had fixed
Код:
[10:38:21] filterscripts = "" (string)
Doesn't show that anymore, it was because I had some filterscripts commented
Reply
#4

Help please
Reply
#5

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  if(strcmp(cmdtext, "/help", true))
  {
    SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
    return 1;
    /* Returning '1' is used to notify the server that the command
    has successfully been processed. If you return true here you won't
    get that 'SERVER: Unknown Command.', and any conflicts will be
    avoided.
    */

  }
  return 0;
/* Returning '0' is used to inform the server that the command
has not been successfully processed, and passes it to other scripts.
If there hasn't been a successful process, then you will get that
'SERVER: Unknown Command.' error.
*/

}
What i done?
I removed the
pawn Код:
!
From:
pawn Код:
if(!strcmp(cmdtext, "/help", true))

Reply
#6

I'm pretty sure that won't fix it, just by looking at it.

I'll try
Reply
#7

I knew it, it didn't work
Reply
#8

Mistake! I Forgot to edit it..
Reply
#9

Quote:
Originally Posted by Wasim_Cortez
Should fix it.. Buh meh have a go at it, If not.. Then ill just use this one:

pawn Код:
if(strcmp(cmdtext, "/help", true) == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
return 1;
}
Edit: Add that under "OnPlayerCommandText" In your Game Mode.
Reply
#10

Never mind. I got it solved. :P

Zcmd has: #define OnPlayerCommandText zcmd_OnPlayerCommandText
Causing the OnPlayerCommandText in the game mode not to work.

I basically changed zcmd's OnPlayerCommandText to: OnCommandText and forwarded it: forward OnCommandText(playerid, cmdtext[]);

Thanks for your effort anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)