DCMD using more than one param?
#1

Hello,long time no see,i've advanced a lot in coding from last time,and now i have another problem.
I cannot find a way to make a command ask for more than the player id...
Example:
/setfaction [playerid][factionid]

i can only make a kill command...like this one...

Код:
dcmd_setfaction(playerid, params[])
{
    if(PlayerInfo[playerid][pAdminLevel] < gCommands[SETFACTION])
    {
        new string[100];
        format(string, sizeof(string), "You must be administrator level %d to use that command!", gCommands[SETFACTION]);
        return SendClientMessage(playerid, COLOUR_ORANGE, string);
    }
    else if(!strlen(params))
    return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /kill [id | name]");
    else
    {
	new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params);
	if(IsPlayerConnected(id) && id != playerid)
	{
	}
	else
	    return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You can not admin-kill yourself or a disconnected player.");
    }
}

//credits to wiki
can you please give me an example of how to ask for the player to type more than just the id?
Reply


Messages In This Thread
DCMD using more than one param? - by Mikibey - 13.06.2012, 11:29
Re: DCMD using more than one param? - by park4bmx - 13.06.2012, 12:28
Re: DCMD using more than one param? - by Mikibey - 13.06.2012, 13:00
Re: DCMD using more than one param? - by park4bmx - 13.06.2012, 13:25
Re: DCMD using more than one param? - by eSPeZet - 01.08.2017, 17:45
Re: DCMD using more than one param? - by eSPeZet - 02.08.2017, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)