[SOLVED] Maximum Dcmd's??
#1

Hi,

Seems I got in trouble with making a lot of dcmd's

When I add one more dcmd command, I get the 'server: unknown command' when I use a dcmd....
anyone know where to look for a solution?

Grts Riz
Reply
#2

You need to return 1; at the end of all commands..
That will solve your problems
Reply
#3

For "OnPlayerCommandText" call function:
dcmd( example, strlen( "example" ), cmdtext );

Prototype:
dcmd( cmd name, strlen( "cmd name" ), cmd string );
Commands it's unlimited.

Gamestar
Reply
#4

Quote:
Originally Posted by ɹɐʇsǝɯɐƃ
For "OnPlayerCommandText" call function:
dcmd( example, strlen( "example" ), cmdtext );

Gamestar
But it would be a lot easier to just type the length of command instead of using that... But that's each scripter's choice :P
Reply
#5

restarted the server another time and issue is returned? checking the filterscripts on dcmd commands

This is as legal as a return 1; right?

pawn Код:
dcmd_cctv(playerid,params[])
    #pragma unused params
    if(IsPlayerCommandLevel(playerid,"cctv"))
    {
      if(Spawned[playerid] == 1)
        {
          PlayerMenu[playerid] = 0;
          TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(CCTVMenu[0], playerid);
        }
        else
        {
          SendClientMessage(playerid, 0xFF0000AA, "Please spawn first!");
        }
        return 1;
    }else return SendLevelErrorMessage(playerid,"cctv");
And at the end of OnPlayerCommandText() there is a return 0... also alowed?

Grts Riz
Reply
#6

Quote:
Originally Posted by Rizard
restarted the server another time and issue is returned? checking the filterscripts on dcmd commands

This is as legal as a return 1; right?

pawn Код:
dcmd_cctv(playerid,params[])
    #pragma unused params
    if(IsPlayerCommandLevel(playerid,"cctv"))
    {
      if(Spawned[playerid] == 1)
        {
          PlayerMenu[playerid] = 0;
          TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(CCTVMenu[0], playerid);
        }
        else
        {
          SendClientMessage(playerid, 0xFF0000AA, "Please spawn first!");
        }
        return 1;
    }else return SendLevelErrorMessage(playerid,"cctv");
And at the end of OnPlayerCommandText() there is a return 0... also alowed?

Grts Riz
You forgot the brackets.. The right code should be like this in all dcmds:

pawn Код:
dcmd_cctv(playerid,params[])
{
    #pragma unused params
    if(IsPlayerCommandLevel(playerid,"cctv"))
    {
      if(Spawned[playerid] == 1)
        {
          PlayerMenu[playerid] = 0;
          TogglePlayerControllable(playerid, 0);
            ShowMenuForPlayer(CCTVMenu[0], playerid);
        }
        else
        {
          SendClientMessage(playerid, 0xFF0000AA, "Please spawn first!");
        }
        return 1;
    }else return SendLevelErrorMessage(playerid,"cctv");
}
Everything else is ok in this command..

And yes, at the end of OnPlayerCommandText should be "return 0;"
Reply
#7

wow lot's of work done in the last 20 min

thnx for the quick solutions James!!

Grts Riz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)