[Not Resloved] Commands calling other commands
#1

When I type /serverstats it calls /sethp
And when I type /dropgun it calls /kill
And /kill calls /skill

They are all in different parts of the script, at different distances between commands.
However, what would cause this to happen?
I am using the Pawn.cmd plugin.
However, it does the same thing with ZCMD.
I have way to many commands to list them all, so I'm looking for some general causes for this particular situation.

I am not using any alias either.
No commands are redirected to anther command. (I.E /sethealth and /sethp)
I deleted all alias in my script to see if that was the culprit with no result.

PHP код:
CMD:kill(playeridparams[])
{
    
SetPlayerHealth(playerid0);
    return 
1;

PHP код:
CMD:logscreen(playeridparams[])
{
    switch(
P_Info[playerid][LogScreen])
    {
        case 
0:
        {
            
P_Info[playerid][LogScreen] = 1;
            
SendClientMessage(playerid, -1" >> Login screen enabled ");
        }
        case 
1:
        {
            
P_Info[playerid][LogScreen] = 0;
            
SendClientMessage(playerid, -1" >> Login screen disabled ");
        }
        default:
        {
            
P_Info[playerid][LogScreen] = 0;
            
SendClientMessage(playerid, -1" >> Login screen disabled ");
        }
    }
    return 
1;

PHP код:
CMD:serverstats(playeridparams[])
{
    new 
string[128];
    
SCM(playeridCOL_WHITE"|__________________________[SERVER STATS]__________________________|");
    
format(stringsizeof(string), "Streamer Loaded: Objects: ({3399FF}%d{FFFFFF}) | Pickups: ({3399FF}%d{FFFFFF}) | 3D Text Labels: ({3399FF}%d{FFFFFF})",
    
CountDynamicObjects(),CountDynamicPickups(), CountDynamic3DTextLabels());
       
SCM(playeridCOL_WHITEstring);
    
format(stringsizeof(string), "Player Stats: Logins: ({3399FF}%d{FFFFFF}) | Registered: ({3399FF}%d{FFFFFF}) | Connections: ({3399FF}%d{FFFFFF})",\
    
TotalLoginTotalRegisterTotalConnect);
    
SCM(playeridCOL_WHITEstring);
    
format(stringsizeof(string), "Server Stats: Autobans: ({3399FF}%d{FFFFFF}) | Vehicles: ({3399FF}%d{FFFFFF}) "TotalAutoBanVehiclesLoaded);
    
SCM(playeridCOL_WHITEstring);
    
SCM(playeridCOL_WHITE"|__________________________________________________________________|");
    return 
1;

Findings:
When I add this; No commands work at all:
PHP код:
public OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)
{
    if(
result == -1)
    {
        print(
"Something");
        return 
0;
    }
    print(
"Something two");
    return 
1;
}
public 
OnPlayerCommandReceivedplayeridcmd[ ], params[ ], flags )
{
    print(
"Something four");
    return 
0;

However, when removed Commands work, but call the wrong command.
I.E
/dropgun calls /kick Command.
Reply
#2

Well, I can't really help you while i don't see codes, Just post /serverstats and /sethp

or /dropgun and /kill

or /kill and /skill.
Reply
#3

Updated
Reply
#4

The wrong might be with the version of pawn.cmd.
Reply
#5

As I stated above, it happens with ZCMD as-well.
Reply
#6

I mean, are you sure of the version of both of them?

Both might be outdated.
Reply
#7

Well as far as your code goes we can't figure out anything, it's not like its a missing bracket or sth.
but I'm guessing something is wrong with OnPlayerCommandText and the way it calls commands, did you by any chance hook it? because it might be a bad hook.
Check for your recent codes, anything player input related might have caused this (OnPlayerText, OnPlayerCommandText, OnPlayerCommandRecieved and etc.)

Edit: Yeah, I checked and it was for crashdetect's plugin
DL and use crashdetect if you don't have it already, and put these under one of your CMDs that doesn't function right.
PrintAmxBacktrace();
PrintNativeBacktrace();
Reply
#8

PHP код:
public OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)
{
    if(
result == -1)
    {
        print(
"Something");
        return 
0;
    }
    print(
"Something two");
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    print(
"Something three");
    return 
0;
}
public 
OnPlayerCommandReceivedplayeridcmd[ ], params[ ], flags )
{
    print(
"Something four");
    return 
0;

Only "Something three" prints.
Also, Now that I added OnPlayerCommandRecieved and OnPlayerCommandPerformed none of my commands work.
Reply
#9

What do you mean by "They are all in different parts of the script, at different distances between commands."? Filterscripts?

Commands in ZCMD are functions (cmd_command_name, e.g. cmd_sethp) and it calls these functions when OnPlayerCommandText is called. There's no way for it to call cmd_sethp if you entered /severstats. Other than having a lot of filterscripts, and some things just bug out (it happens sometimes).

Redownload the include?
Reply
#10

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
What do you mean by "They are all in different parts of the script, at different distances between commands."? Filterscripts?

Commands in ZCMD are functions (cmd_command_name, e.g. cmd_sethp) and it calls these functions when OnPlayerCommandText is called. There's no way for it to call cmd_sethp if you entered /severstats. Other than having a lot of filterscripts, and some things just bug out (it happens sometimes).

Redownload the include?
By Distance I mean how spread apart they are from one anther.
PHP код:
CMD// Command being typed(1)
CMD// Command being typed (2)
CMD// Command being called(1)
CMD// Doesn't work at all
CMD:// Doesn't work at all
CMD:// Command Being Called(2) 
I'm using 0 Filterscripts as-well.
Every command is created in the game mode.
The only thing read outside of the game mode is my objects.
Those are read through objects.pwn using ****** Hooking method.

I would understand if maybe Pawn.CMD didn't work, or ZCMD alone didn't work
However neither of them working, has got me really confused.
I've messed up in a way I didn't know was possible, and have no idea how I did it.
Tried redownloading the include as-well(Both.)

EDIT:
UrShadow released a new update 4 Days ago I didn't notice.
I updated the Include and plugin, and now it works.
However they working fine before as-well so I'm not sure if that fixed it for good or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)