CMD problem?
#1

Error
Код:
../gamemodes/OnPlayerCommandZCMD.pwn(2779) : error 017: undefined symbol "tmp"
../gamemodes/OnPlayerCommandZCMD.pwn(2779) : error 017: undefined symbol "cmdtext"
../gamemodes/OnPlayerCommandZCMD.pwn(2780) : error 017: undefined symbol "tmp"
../gamemodes/OnPlayerCommandZCMD.pwn(2791) : error 017: undefined symbol "tmp"
pawn Код:
}
COMMAND:buyclothes(playerid, params[])
{
        if(PlayerCuffed[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "You can not do this while cuffed."); return 1; }
        if(Died[playerid] == 1) { SendClientMessage(playerid, COLOR_WHITE, "Cannot use this command while dead."); return 1; }
        if(IsAtClothShop(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE,"USAGE: /buyclothes [Skin ID]");
                return 1;
            }

            if(GetPlayerMoney(playerid) < 200)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You don't have enough money ! ");
                return 1;
            }
            new level = strval(tmp);

            GivePlayerMoney(playerid,-200);
            if(!IsValidSkin(level))
            return SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!");
            PlayerInfo[playerid][pSkin] = level;
            SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
        }
        return 1;
}
Reply
#2

Use params cmdtext is only for OnPlayerCommandText,

pawn Код:
tmp = strtok(cmdtext, idx); into

new tmp[128],idx;
tmp = strtok(params, idx);
Reply
#3

Yep, you're using things from OnPlayerCommandText. Things that aren't defined in zcmd.

As Kitten said, use "params". You could simply replace "tmp" with "params" and delete the part where you set up tmp - "tmp = strtok(cmdtext, idx);"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)