OnPlayerCommandText
#1

onplayertext not work with me where probleme ..<zcmd>!!!

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if(
strcmp(cmdtext"/help"true) == 0)
    {
        
SendClientMessage(playerid, -1"Available commands: ");
        return 
1;
    }
    if(
strcmp(cmdtext"/kill"true) == 0)
    {
        
SetPlayerHealth(playerid0);
        return 
1;
    }
    new
        
pos,
        
funcname[32];
    while (
cmdtext[++pos] > ' ')
    {
        
funcname[pos-1] = tolower(cmdtext[pos]);
    }
    
format(funcnamesizeof(funcname), "cmd_%s"funcname);
    while (
cmdtext[pos] == ' 'pos++;
    if (!
cmdtext[pos])
    {
        return 
CallLocalFunction(funcname"is"playerid"\1");
    }
    return 
CallLocalFunction(funcname"is"playeridcmdtext[pos]);

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)