One problem
#1

Код:
E:\ELRP\gamemodes\ELRP1.pwn(106775) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandPerformed")
my code:
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "Server unkown command. Check '/help' to get commands help");
    return 1;
}
Reply
#2

Код:
forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(!success) SendClientMessage(playerid, -1, "Server unkown command. Check '/help' to get commands help");
    return 1;
}
use it
Reply
#3

You should use y_commands or zcmd in order to use this callback, if you use a forward to resolve this error and does not use a command processor y_commands zcmd not will be called the callback.

PHP код:
#include <zcmd.inc>
//  OR
#include <YSI\y_commands> 
Reply
#4

I use the default command system.
Reply
#5

delete that and add the following code.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/mycommand"cmdtexttrue10) == 0)
    {
        
// Do something here
        
return 1;
    }
    return 
SendClientMessage(playerid, -1"Server unkown command. Check '/help' to get commands help");

Basically what you'd do would be to change the value of the last return in "OnPlayerCommandText" for your message.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)