[Help] command not working from filterscript
#1

Hi there,

As everytime I try to create commands over filterscripts it never works, specialy if it's ZCMD or any other function, it's like my game mode kicks it out. Anyways I'm trying to make a furniture script but the cmds are not working, doesn't send anything, doesn't matter if it's a message or open a dialog...

Any ideas?
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new tmp[256], cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    if(strcmp(cmd,"/fhelp",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_WHITE, "TITLE TEST");
            SendClientMessage(playerid, COLOR_WHITE, "Random message here.");
        }
        return 1;
    }
    if(strcmp(cmd,"/furniture",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            ShowPlayerDialog(playerid, 1337, DIALOG_STYLE_LIST, "Furniture Menu", "Chairs\nBeds\nTables\nTvs\nCabinets\nFuns tuff\n", "Ok", "Cancel");
        }
        return 1;
    }
    return 0;
}

strtok(const string[], &index)
{
    new length = strlen(string);
    while ((index < length) && (string[index] <= ' '))
    {
        index++;
    }

    new offset = index;
    new result[20];
    while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
    {
        result[index - offset] = string[index];
        index++;
    }
    result[index - offset] = EOS;
    return result;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)