06.01.2012, 01:12
I want to create a /note command with options add, view, show, delete, give
I know how to make it with ZCMD but I can't make it with the normal commands (OnPlayerCommandTex...)
Can anyone tell me how to make a command with different options?
Here's the code I tried, but it fails, always returns the SendClientMessage(playerid, 0xFFFFFF, "1");
I know how to make it with ZCMD but I can't make it with the normal commands (OnPlayerCommandTex...)
Can anyone tell me how to make a command with different options?
Here's the code I tried, but it fails, always returns the SendClientMessage(playerid, 0xFFFFFF, "1");
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/note", cmdtext, true) == 0)
{
new cmd[5], param[120];
sscanf(cmdtext, "ss", cmd, param);
if (strcmp("add", param, true, 3) == 0)
{
new param1[9], number[1], text[100];
sscanf(param, "sis", param1, number, text);
if (strcmp("1", number, true) == 0)
{
return SendClientMessage(playerid, COLOR_USAGE, "1");
}
if (strcmp("2", number, true) == 0)
{
return SendClientMessage(playerid, COLOR_USAGE, "2");
}
if (strcmp("3", number, true) == 0)
{
return SendClientMessage(playerid, COLOR_USAGE, "3");
}
if (strcmp("4", number, true) == 0)
{
return SendClientMessage(playerid, COLOR_USAGE, "4");
}
if (strcmp("5", number, true) == 0)
{
return SendClientMessage(playerid, COLOR_USAGE, "5");
}
}
if (strcmp("view", param, true) == 0)
{
}
if (strcmp("delete", param, true) == 0)
{
}
if (strcmp("show", param, true) == 0)
{
}
if (strcmp("give", param, true) == 0)
{
}
return SendClientMessage(playerid, COLOR_USAGE, "[USAGE:] /note add | view | delete | show | give");
}
return 0;
}