Example of command with params? (newbie)
#3

Quote:
Originally Posted by Darnell
Посмотреть сообщение
I suggest using zCMD, easier.
pawn Код:
CMD:stunt 1(playerid, params[])
{
    SetPlayerPos(playerid,X,Y,Z);
        return 1;
    }
    return 0;
}
Hi, this is TheBetaFox. My friend 'ere is gone.
The ZCMD-based YCMD wouldn't make much more of a difference.

pawn Код:
YCMD:stunt 1(playerid, params[], help)
{
    #pragma unused params
    if(help)
    {
        SendClientMessage(playerid, -1, "Help text goes here for /help stunt 1");
    }
    SetPlayerPos(playerid,X,Y,Z);
    return 1;
}
I added the if(help) because I love that function of YCMD. /help [command] has been a function that I've seen requested on various stunt servers, so I've thought that it might help people understand what X command does ~ but instead of adding help to 'ambiguous' commands, I'm adding a help section to all commands.

But I'm not looking for simply naming commands 'stunt 1' 'stunt 2'.
I want to consider the number as a parameter, include everything in one command. Basically something like if parameter = 1 do this, if parameter = 2 do that, and so on.

I'm also using the SSCANF2 plugin, so if using SSCANF helps to speed up things, use it.

...I'm not a very good scripter, and I have no idea either, just like my friend. This has sparked my curiosity and I am awaiting for a new, more helpful reply.

-TheBetaFox
Reply


Messages In This Thread
Example of command with params? (newbie) - by TheBetaFox - 11.08.2011, 11:05
Re: Example of command with params? (newbie) - by Darnell - 11.08.2011, 11:29
Re: Example of command with params? (newbie) - by TheBetaFox - 11.08.2011, 14:33
Re: Example of command with params? (newbie) - by MadeMan - 11.08.2011, 15:31
Re: Example of command with params? (newbie) - by TheBetaFox - 11.08.2011, 15:43

Forum Jump:


Users browsing this thread: 1 Guest(s)