04.03.2015, 16:15
onplayertext not work with me where probleme ..<zcmd>!!!
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/help", true) == 0)
{
SendClientMessage(playerid, -1, "Available commands: ");
return 1;
}
if(strcmp(cmdtext, "/kill", true) == 0)
{
SetPlayerHealth(playerid, 0);
return 1;
}
new
pos,
funcname[32];
while (cmdtext[++pos] > ' ')
{
funcname[pos-1] = tolower(cmdtext[pos]);
}
format(funcname, sizeof(funcname), "cmd_%s", funcname);
while (cmdtext[pos] == ' ') pos++;
if (!cmdtext[pos])
{
return CallLocalFunction(funcname, "is", playerid, "\1");
}
return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]);
}