SA-MP Forums Archive
[SOLVED] Maximum Dcmd's?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Maximum Dcmd's?? (/showthread.php?tid=94027)



[SOLVED] Maximum Dcmd's?? - Rizard - 27.08.2009

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


Re: Maximum Dcmd's?? - SiJ - 27.08.2009

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


Re: Maximum Dcmd's?? - [HUN]Gamestar - 27.08.2009

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

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

Gamestar


Re: Maximum Dcmd's?? - SiJ - 27.08.2009

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


Re: Maximum Dcmd's?? - Rizard - 27.08.2009

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


Re: Maximum Dcmd's?? - SiJ - 27.08.2009

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;"


Re: Maximum Dcmd's?? - Rizard - 27.08.2009

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

thnx for the quick solutions James!!

Grts Riz