Simple function/include to return command paramters?
#1

Has someone made/could make a include of function to return command parameters? I always have and always will find sscanf to confusing!
I'm not really sure how to explain this, but here is a example!

pawn Код:
CMD:healplayer(playerid, params[])
{
    SetPlayerHealth(p1, 100.0); //so you type "/healplayer 2" and it heals player 2...
    return 1;
}
Where p1 stands for the first parameter, and p2 stands for the seconds parameter.

pawn Код:
CMD:sethealth(playerid, params[])
{
    SetPlayerHealth(p1, p2); //so you type "/healplayer 2 50" and it sets player 2's health to 50%
    return 1;
}
And you can add it to your script using something like this, or whatever the include is called!

pawn Код:
#include <params>
Reply


Messages In This Thread
Simple function/include to return command paramters? - by linuxthefish - 02.04.2011, 12:55
Re: Simple function/include to return command paramters? - by SchurmanCQC - 02.04.2011, 13:00
Re: Simple function/include to return command paramters? - by linuxthefish - 02.04.2011, 13:05

Forum Jump:


Users browsing this thread: 1 Guest(s)