30.01.2014, 01:51
You can use sscanf.
I will use ZCMD for this:
I will use ZCMD for this:
pawn Код:
CMD:faction(playaerid, params[])
{
new Option[32], ID; // ID will be used for Player ID, Option will be like "Invite" or "uninvite"
if(sscanf(params, "s[32]u", Option, ID))//This is the sscanf statement, s[32] = String using size of 32, u is the id
{
SendClientMessage(playerid, -1, "Usage: /faction [Option] [ID]");
SendClientMessage(playerid, -1, "Options: Invite, Uninvite");//If they don't type the full command these messages will send
}
else
{
if(strcmp(Option, "invite", true) == 0)//If they type invite for option
{
//Invite goes here
}
if(strcmp(Option, "uninvite", true) == 0)//if they type uninvite for the option
{
// Uninvite goes here
SendClientMessage(ID, -1, "Sends message to the ID of the player, Using ID");
}
}
return 1;
}