ZCMD in OnPlayerCommandText.
#1

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    CMD:rules(playerid, params[])
    {
      SendClientMessage(playerid ,1, "Rules:");
      return 1;
    }
    return SendClientMessage(playerid, 1, "Not a available command, try /help or /commands.");
}
Error:
Код:
F:\Mustafa\samp03z_svr_R1_win32\gamemodes\NL-RL.pwn(117) : error 029: invalid expression, assumed zero
F:\Mustafa\samp03z_svr_R1_win32\gamemodes\NL-RL.pwn(117) : error 017: undefined symbol "cmd_rules"
F:\Mustafa\samp03z_svr_R1_win32\gamemodes\NL-RL.pwn(117) : error 029: invalid expression, assumed zero
F:\Mustafa\samp03z_svr_R1_win32\gamemodes\NL-RL.pwn(117) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
How can I fix this? To put the ZCMD, and if the command is invalid then send a message?

Greatz,
Mey6155
Reply
#2

You should use zcmd commands outside any callback.
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
return 0;
}
CMD:rules(playerid, params[])
{
    SendClientMessage(playerid ,1, "Rules:");
    return 1;
}

try this...


+rep me if i helped
Reply
#4

But how can I make it for all my ZCMD commands if its invalid: Not a available command, try /help or /commands. ?
Reply
#5

Quote:
Originally Posted by doreto
Посмотреть сообщение
You should use zcmd commands outside any callback.
What do you understand by this
Reply
#6

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(success == 0)
    return SendClientMessage(playerid, 0xFF0000FF,  "Not a available command, try /help or /commands.");
    return 1;
}
+Rep Me if i helped
Reply
#7

Quote:

public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
if(success == 0)
return SendClientMessage(playerid, "Not a available command, try /help or /commands.");
return 1;
}

Thx +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)