No commands are working :/ (ZCMD)
#1

I've been experiancing this problem, for well... a few hours. I've been trying to work constantly to fix it - no luck. I'll post my shit below...

pawn Код:
#include <zcmd>
#define ALTCOMMAND:%1->%2; COMMAND:%1(playerid, params[]) return cmd_%2(playerid, params);
Command handler:
pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(P_TEMP[playerid][loggedin] != 1) return SendClientError(playerid, "You are not logged in!");
    if(!success) return SendClientMessage(playerid, -1, "This {B9C9BF}command{ffffff} has not been found. Please use: {B9C9BF}/commands {ffffff}({B9C9BF}/cmds{ffffff})");
    return 1;
}
Command example:
pawn Код:
COMMAND:forcept(playerid)
{
    if(P_INFO[playerid][PAdmin] < 3) return SendClientError(playerid, CANT_USE_CMD);
    PlayerLoop(p) P_INFO[p][PTime] = 3599;
    return 1;
}
Although, it isn't just this command that's not working. All commands seem inactive..

When I perform a command:





Reply
#2

Is there any "/cmds" script in your GM?
Reply
#3

Of course there is.. you don't seem to understand. Every command is inactive, not just /cmds.

pawn Код:
ALTCOMMAND:cmds->commands;
Reply
#4

If a command doesn't return 1; it will not be performed.
Reply
#5

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
If a command doesn't return 1; it will not be performed.
If I didn't return 1; a error would be prompt.
Reply
#6

Quote:
Originally Posted by d3ll
Посмотреть сообщение
If I didn't return 1; a error would be prompt.
No, it wouldn't, only in some cases.


Did you try commenting out the if(!success) statement? Maybe the issue lies with your command, and not this line.
Reply
#7

pawn Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    if(P_TEMP[playerid][loggedin] != 1) return SendClientError(playerid, "You are not logged in!");
    if(!success) SendClientMessage(playerid, -1, "This {B9C9BF}command{ffffff} has not been found. Please use: {B9C9BF}/commands {ffffff}({B9C9BF}/cmds{ffffff})");
    return 1;
}
Reply
#8

Quote:
Originally Posted by d3ll
Посмотреть сообщение
If I didn't return 1; a error would be prompt.
No it will not for example.

pawn Код:
CMD:sendmsg(playerid,params[])
{
SendClientMessage(playerid,-1,"I am useless");
}
In such case the command will go successful but it will send you the !success message aswell.
Reply
#9

bump i got this same problem
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)