[Resloved] Commands calling other commands -
Lynn - 08.07.2016
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(playerid, params[])
{
SetPlayerHealth(playerid, 0);
return 1;
}
PHP код:
CMD:logscreen(playerid, params[])
{
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(playerid, params[])
{
new string[128];
SCM(playerid, COL_WHITE, "|__________________________[SERVER STATS]__________________________|");
format(string, sizeof(string), "Streamer Loaded: Objects: ({3399FF}%d{FFFFFF}) | Pickups: ({3399FF}%d{FFFFFF}) | 3D Text Labels: ({3399FF}%d{FFFFFF})",
CountDynamicObjects(),CountDynamicPickups(), CountDynamic3DTextLabels());
SCM(playerid, COL_WHITE, string);
format(string, sizeof(string), "Player Stats: Logins: ({3399FF}%d{FFFFFF}) | Registered: ({3399FF}%d{FFFFFF}) | Connections: ({3399FF}%d{FFFFFF})",\
TotalLogin, TotalRegister, TotalConnect);
SCM(playerid, COL_WHITE, string);
format(string, sizeof(string), "Server Stats: Autobans: ({3399FF}%d{FFFFFF}) | Vehicles: ({3399FF}%d{FFFFFF}) ", TotalAutoBan, VehiclesLoaded);
SCM(playerid, COL_WHITE, string);
SCM(playerid, COL_WHITE, "|__________________________________________________________________|");
return 1;
}
Findings:
When I add this; No commands work at all:
PHP код:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(result == -1)
{
print("Something");
return 0;
}
print("Something two");
return 1;
}
public OnPlayerCommandReceived( playerid, cmd[ ], params[ ], flags )
{
print("Something four");
return 0;
}
However, when removed Commands work, but call the wrong command.
I.E
/dropgun calls /kick Command.
Re: Commands calling other commands -
XtremeRz - 08.07.2016
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.
Re: Commands calling other commands -
Lynn - 08.07.2016
Updated
Re: [Not Resloved] Commands calling other commands -
XtremeRz - 09.07.2016
The wrong might be with the version of pawn.cmd.
Re: [Not Resloved] Commands calling other commands -
Lynn - 09.07.2016
As I stated above, it happens with ZCMD as-well.
Re: [Not Resloved] Commands calling other commands -
XtremeRz - 09.07.2016
I mean, are you sure of the version of both of them?
Both might be outdated.
Re: [Not Resloved] Commands calling other commands -
PrO.GameR - 09.07.2016
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();
Re: [Not Resloved] Commands calling other commands -
Lynn - 09.07.2016
PHP код:
public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags)
{
if(result == -1)
{
print("Something");
return 0;
}
print("Something two");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
print("Something three");
return 0;
}
public OnPlayerCommandReceived( playerid, cmd[ ], params[ ], flags )
{
print("Something four");
return 0;
}
Only "Something three" prints.
Also, Now that I added OnPlayerCommandRecieved and OnPlayerCommandPerformed none of my commands work.
Re: [Not Resloved] Commands calling other commands -
SickAttack - 09.07.2016
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?
Re: [Not Resloved] Commands calling other commands -
Lynn - 09.07.2016
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.