3 players, commands fuckup!
#1

So i use ZCMD, and honestly, never tried using them when 3 players connected.
Today i had a party on server, many came, but all the commands fucked up!
Some work some don't, i keep receiving the unknown command message but the command gets processed!

Any tips? I give you a command and everything needed.

Just...some help
Reply
#2

Well, the unknown command message is shown when the OnPlayerCommandText callback returns 0, so do you return 0 anywhere in your OnPlayerCommandText function? Also, in ZCMD do you return a value at the end of each command to prevent the script from continuing to the end of the OnPlayerCommandText callback?

I'm not really sure how ZCMD works as I've never used it, but I assume that's where the issues lies, you should probably check out the documentation for it, if there is any.
Reply
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Well, the unknown command message is shown when the OnPlayerCommandText callback returns 0, so do you return 0 anywhere in your OnPlayerCommandText function? Also, in ZCMD do you return a value at the end of each command to prevent the script from continuing to the end of the OnPlayerCommandText callback?

I'm not really sure how ZCMD works as I've never used it, but I assume that's where the issues lies, you should probably check out the documentation for it, if there is any.
Actually, ZCMD doesn't use OnPlayerCommandText
i uses

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
Should i show you some commands and what the 2 callback contain? But I'm pretty sure that's not from it..
I have return 1 to every command! OnPlayerCommandText is not even used.
Strange, but with 1 and 2 players, it works fine, when 3, it's a command total fuckup!
Not even a single command works like it should...
Reply
#4

Well OnPlayerCommandText must be used somewhere, most likely in the background by ZCMD. Give me an example of some of the commands you use.
Reply
#5

pawn Код:
CMD:kick(playerid, params[])
{
    if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
    if (P_DATA[ playerid ][ P_LoggedIN ] == 0)return SendError( playerid, "Please login to use this command!");
    if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/kick <id> [reason]" );
    if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
    if( params[ 0 ] == playerid )return SendError( playerid, "You can't kick yourself!");

    FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s kicked %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
    FormMessage( params[ 0 ], COLOR_GREEN, "4 %s kicked you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
    FormMessage( playerid, COLOR_GREEN, "You have kicked %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
    Kick( params[ 0 ] );
    return 1;
}




CMD:ban(playerid, params[])
{
    if (P_DATA[ playerid ][ P_Level ] < 4)return SendError( playerid, "You are not allowed to use this command"),SendClientMessage(playerid, COLOR_WHITE, "REASON: Low level!");
    if (P_DATA[ playerid ][ P_LoggedIN ] == 0)return SendError( playerid, "Please login to use this command!");
    if ( sscanf( params, "us", params[ 0 ] ,params[ 1 ]) )return SendUsage( playerid, "/ban <id> [reason]" );
    if ( !IsPlayerConnected( params[ 0 ] ) )return SendError( playerid, "Player is not connected!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");
    if (P_DATA[ params[ 0 ] ][ P_Level ] > P_DATA[ playerid ][ P_Level ])return SendError( playerid, "You have no rights to use admin commands on higher admins!");

    /*if( params[ 0 ] == playerid )
        return SendError( playerid, "You can't ban yourself!");*/

    FormMessageForAllEx(playerid,COLOR_GREEN, "Administrator %s banned %s from the server! [Reason: %s]",PlayerName2( playerid ), PlayerName2( params[ 0 ] ), params[ 1 ]);
    FormMessage( params[ 0 ], COLOR_GREEN, "Administrator %s banned you! [Reason: %s ]",PlayerName2( playerid ), params[ 1 ]);
    FormMessage( playerid, COLOR_GREEN, "You have banned %s [Reason: %s]",PlayerName2( params[ 0 ] ), params[ 1 ]);
    new gP_FILE[ 256 ];
    format( gP_FILE, 256, "Administration/Users/%s.ini", PlayerName2( params[ 0 ] ));
    new
        INI:pACC = INI_Open( gP_FILE );
    INI_WriteInt(pACC, "BANNED", 1 );
    INI_Close( pACC );
    Ban( params[ 0 ] );
    return 1;
}
Some of the few. I guess you know how FormMessage is. It's the define ****** made.

I only use OnPlayerCommandText with CallRemoteFunction. But the commands that use the CallRemoteFunction, weren't even touched!
Reply
#6

Can I see where you initialize the P_DATA variable?
Reply
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Can I see where you initialize the P_DATA variable?
Here is the enum.
pawn Код:
enum P_ENUM_DATA
    {
        bool:P_Super,
        bool:P_vStats,
        P_LoggedIN,
        P_Registered,
        P_MSGS,
        P_CMDS,
        P_Kills,
        P_Deaths,
        P_PMS,
        P_LoginFails,
        P_Cookies,
//list goes on...

And this..
pawn Код:
new P_DATA [ MAX_PLAYERS ][ P_ENUM_DATA ] ;
Reply
#8

When people join, which commands work and which don't?
Reply
#9

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
When people join, which commands work and which don't?
Like i said, with 2 players, everything works as it should.
When the third joins, or more, for example, /login command, works with whatever password you insert.
for example /setlevel, works, it says promoted / demoted and stuff, but i get my defined Unknown Command message.

Did i say what it was needed?
Reply
#10

Okay well I read through some of that ZCMD documentation, and it says that if you return 0 anywhere in

pawn Код:
OnPlayerCommandPerformed(playerid, cmdtext[], success)
Then it will show the standard unknown command message from returning 0 in OnPlayerCommandText, so do you use that callback at all? If you do, please show the contents of it.

Also show OnPlayerCommandRecieved if you use it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)