/test one/two/three/four
CMD:test(playerid, params[])
{
if(isnull(params))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /test (1 - 3)");
return 1;
}
if(strcmp(params, "1", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 1");
}
if(strcmp(params, "3", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 2");
}
if(strcmp(params, "4", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 3");
}
}
|
Here you go
Код:
CMD:test(playerid, params[])
{
if(isnull(params))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /test (1 - 3)");
return 1;
}
if(strcmp(params, "1", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 1");
}
if(strcmp(params, "3", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 2");
}
if(strcmp(params, "4", true)
{
SendClientMessage(playerid, COLOR_RED, "This is /test 3");
}
}
|
|
Should be "!strcmp" not "strcmp". Also, they used the numeral "1" and you said the word "one" - you might have spotted that already but just pointing it out.
|