14.01.2012, 08:35
Spooky, there are still a few errors in your code.
pawn Код:
command(apb, playerid, params[])
{
new string[128], usage[10], apb[100];
if(sscanf(params, "s[10]", usage))
{
SendClientMessage(playerid, GREY, "USAGE: /apb [usage]");
SendClientMessage(playerid, GREY, "USAGES: create, details");
}
else
{
if(Groups[Player[playerid][Group]][CommandTypes] == 1)
{
if(strcmp(usage, "create", true) == 0)
{
new slot;
if(sscanf(usage, "s[100]d", apb, slot))
{
SendClientMessage(playerid, GREY, "USAGE: /apb create [apb] [slot]");
}
else
{
format(string, sizeof(string), "Officer %s just submitted an APB! (/apb details %d)", GetName(playerid), slot);
GroupMessage(playerid, RED, string);
format(apb, sizeof(apb), "%s", apb);
}
}
else if(strcmp(usage, "details", true) == 0)
{
new slot;
if(sscanf(usage, "d", slot))
{
SendClientMessage(playerid, GREY, "USAGE: /apb details [slot]");
}
else
{
format(string, sizeof(string), "|__________APB %d__________|", slot);
SendClientMessage(playerid, RED, string);
format(string, sizeof(string), "APB: %s", apb);
SendClientMessage(playerid, RED, string);
}
}
else
{
SendClientMessage(playerid, GREEN, "Wrong APB usage");
}
}
}
return 1;
}