SA-MP Forums Archive
Help Command [Not Simple One] - 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)
+--- Thread: Help Command [Not Simple One] (/showthread.php?tid=412902)



Help Command [Not Simple One] - zohartrejx - 03.02.2013

Hey Guys, i need help for my Deathrun script.

I Want to make a cmd /help [info].
If player types /help it will send functions: bla bla bla
if you type /help server it will type about server, /help skins about skins.
Can you help me? Thanks, repping all comments


Re: Help Command [Not Simple One] - Scrillex - 03.02.2013

PHP код:
CMD:help(playeridparams[])
{
    
SendClientMessage(playerid0xFF0000AA"blablabal");
    return 
1;

PHP код:
CMD:helpskins(playeridparams[])
{
    
SendClientMessage(playerid0xFF0000AA"blablabal");
    return 
1;

just multiple times!


Re: Help Command [Not Simple One] - zohartrejx - 03.02.2013

Yeah, but i want /help [cmd] so it'll be like /help server and it'll show dialog for server help


Re: Help Command [Not Simple One] - Scrillex - 03.02.2013

Something like this or use dialog list on help cmd!
PHP код:
CMD:help(playeridparams[])
{
    if(!
sscanf(params,"s[40]"help))
    {
        if(
strcmp(help,"new"true) == 0)
        {
        }
        else if(
strcmp(help,"_"true) == 0)
        {
        }        
        
// And so on.
        
}
        else
        {
            
SendClientMessage(playerid, -1,"/help new, _, _, _, _");
        }
        return 
1;
    }




Re: Help Command [Not Simple One] - u3ber - 03.02.2013

y_commands has a nice in-built feature that does this.


Re: Help Command [Not Simple One] - zohartrejx - 03.02.2013

Can you make it for normal? without ZCMD and those,


Re: Help Command [Not Simple One] - Da_Noob - 03.02.2013

pawn Код:
CMD:help(playerid, params [])
{
 if(!strcmp(params,"skin",true))
{
 // do your stuff here
}
if(!strcmp(params,"server",true))
{
// do other stuff here
}
return 1;
Something like this. (I'm on my phone so it's hard to type)


Re: Help Command [Not Simple One] - Scrillex - 03.02.2013

pawn Код:
if(strcmp("/help", cmdtext, true) == 0)
    {
        if(!sscanf(params,"s[40]", help))
        {
            if(strcmp(help,"new", true) == 0)
            {

            }
            else if(strcmp(help,"_", true) == 0)
            {

            }      
            // And so on.
        }
        else
        {
            SendClientMessage(playerid, -1,"/help new, _, _, _, _");
        }
        return 1;
    }
Not tested... So if it isn't working then look how to recode it to strcmp!


Re: Help Command [Not Simple One] - Da_Noob - 03.02.2013

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
pawn Код:
if(strcmp("/help", cmdtext, true) == 0)
    {
        if(!sscanf(params,"s[40]", help))
        {
            if(strcmp(help,"new", true) == 0)
            {

            }
            else if(strcmp(help,"_", true) == 0)
            {

            }      
            // And so on.
        }
        else
        {
            SendClientMessage(playerid, -1,"/help new, _, _, _, _");
        }
        return 1;
    }
Not tested... So if itsn't working then look how to recode it to strcmp!
I think you forgot to add this: new help;


Re: Help Command [Not Simple One] - zohartrejx - 04.02.2013

Doesnt work, i dont have sscanf.