Convert dcmd command to strcmp
#7

I have posted the start of my onplayercommandtext, it goes on forever, lol. I think i know what it is, I have indicated it in the code below:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(gPlayerSpawned[playerid] == 0)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "   You are not logged in or have not spawned !");
        return 1;
    }
    if(PlayerInfo[playerid][pAdmin] > 0 && gAdminAuthorized[playerid] == 0)
    {
        Kick(playerid);
        return 1;
    }
    new pos, funcname[32];
    while(cmdtext[++pos] > ' ')
    {
        funcname[pos-1] = tolower(cmdtext[pos]);
    }
    strins(funcname, "cmd_", 0, sizeof(funcname));
    while (cmdtext[pos] == ' ') pos++;
    if(!cmdtext[pos])
    {
        return CallLocalFunction(funcname, "is", playerid, "\1");
    }
    return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]); //Think Its Something To Do With This
    new string[128];
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new cmd[128];
    new tmp[128];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);
    dcmd(countdown, 9, cmdtext);
    dcmd(pm, 2, cmdtext);
    dcmd(reply, 5, cmdtext);
    dcmd(nopm, 4, cmdtext);
This is the problem i think:

pawn Код:
new pos, funcname[32];
    while(cmdtext[++pos] > ' ')
    {
        funcname[pos-1] = tolower(cmdtext[pos]);
    }
    strins(funcname, "cmd_", 0, sizeof(funcname));
    while (cmdtext[pos] == ' ') pos++;
    if(!cmdtext[pos])
    {
        return CallLocalFunction(funcname, "is", playerid, "\1");
    }
    return CallLocalFunction(funcname, "is", playerid, cmdtext[pos]); //Think Its Something To Do With This
Reply


Messages In This Thread
Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 19:13
Re: Convert dcmd command to strcmp - by T0pAz - 23.02.2012, 19:20
Re: Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 19:22
Re: Convert dcmd command to strcmp - by T0pAz - 23.02.2012, 19:23
Re: Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 19:26
Re: Convert dcmd command to strcmp - by T0pAz - 23.02.2012, 19:29
Re: Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 19:34
Re: Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 19:49
Re: Convert dcmd command to strcmp - by lewismichaelbbc - 23.02.2012, 20:05

Forum Jump:


Users browsing this thread: 1 Guest(s)