31.12.2014, 08:41
I do not speak English very well but I will try to explain it
Strcmp compare string "mycommand" with string "cmdtext", "true" is "ignorecase", then "mycommand" is the same "MyCoMmaNd", "10" is the lenght of the command, you can also leave it because it is a optional parameter... "== 0" because if the the strings are the same strcmp return 0, then we proceed to the instruction inside the brackets, that return 1 that the command was executed successfully. If the strings don't are the same, return 0 that the command wasn't executed successfully.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}

