Question why does it say unknown command?
#1

Ok, So all these command's work in the server but they say unknown command after them / if the player is not in the right area etc.

pawn Код:
COMMAND:getatmid(playerid, params[])
{
    new string[256];
    new i;
    i = GetATMID(playerid);
    if(WorldInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0,abInfo[i][ATMx],abInfo[i][ATMy],abInfo[i][ATMz]))
        {
            format(string, sizeof(string), "ATM ID %d",i);
            SendClientMessage(playerid,COLOR_ORANGE,string);
            return 1;
        }
        else return SendClientMessage(playerid,COLOR_RED,"You are not around any cash machines.");
    }
    else return SendClientMessage(playerid,COLOR_RED,"You can not use this command!");
}

COMMAND:atmwithdraw(playerid, params[])
{
    new amount;
    new Biz[128];
    new string[256];
    new i;
    i = GetATMID(playerid);
    if(!sscanf(params, "i", amount))
    {
        if(IsPlayerInRangeOfPoint(playerid, 3.0,abInfo[i][ATMx],abInfo[i][ATMy],abInfo[i][ATMz]))
        {
            if(amount <= abInfo[i][ATMMoney] && amount > 0)
            {
                if(amount <= RpPlayerInfo[playerid][pBank] && amount > 0)
                {
                    format(Biz, sizeof(Biz), "ATMs/ATMid%d",i);
                    RpPlayerInfo[playerid][pBank] = RpPlayerInfo[playerid][pBank]-amount;
                    RpPlayerInfo[playerid][pCash] = RpPlayerInfo[playerid][pCash]+amount;
                    SetPlayerMoney(playerid,RpPlayerInfo[playerid][pCash]);
                    abInfo[i][ATMMoney] = abInfo[i][ATMMoney]-amount;
                    dini_IntSet(Biz, "Money", abInfo[i][ATMMoney]);
                    Delete3DTextLabel(ATMLabel[i]);
                    format(string, sizeof(string), "ATM type /atmwithdraw and /atmbalance.\nMoney left $%d",abInfo[i][ATMMoney]);
                    ATMLabel[i] = Create3DTextLabel(string, 0x008080FF, abInfo[i][ATMx],abInfo[i][ATMy],abInfo[i][ATMz], 10.0, 0, 1);
                    return 1;
                }
                else return SendClientMessage(playerid,COLOR_RED,"You don't have that much money in your bank account.");
            }
            else return SendClientMessage(playerid,COLOR_RED,"This cash machine doesn't have that much cash in.");
        }
        else return SendClientMessage(playerid,COLOR_RED,"You are not around any cash machines.");
    }
    else return SendClientMessage(playerid,COLOR_RED,"USAGE: /atmwithdraw [amount]");
}

COMMAND:furniture(playerid,params[])
{
    new str1[256],pname[24];
    new housenumber;
    housenumber = GetHouseID(playerid);
    format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
    SendClientMessage(playerid, RED, "If you are wanting to plant furniture out side your house go to the icon / enter point.");
    if(RpPlayerInfo[playerid][pInhouse] == RpPlayerInfo[playerid][pOwnedhouse])
    {
        ShowPlayerDialog(playerid, 710, DIALOG_STYLE_LIST, "{CC0000}Furniture System", "Beds\nChairs\nRugs\nTables n Drawers\nTVs\nMisc", "Ok", "Cancel");
        return 1;
    }
    if(strcmp(hInfo[housenumber][Name],pname,true)==0)
    {
        housefid[playerid] = housenumber;
        if(housenumber == RpPlayerInfo[playerid][pOwnedhouse])
        {
            SendClientMessage(playerid, RED, "Please don't plant furniture in the road or far away from your house!");
            SendClientMessage(playerid, RED, "If you do you will be banned.");
            ShowPlayerDialog(playerid, 710, DIALOG_STYLE_LIST, "{CC0000}Furniture System Out Side", "Beds\nChairs\nRugs\nTables n Drawers\nTVs\nMisc", "Ok", "Cancel");
            return 1;
        }
        else return SendClientMessage(playerid, RED, "This house is not yours.");
    }
    return 1;
}

COMMAND:putgun(playerid, params[])
{
    if(RpPlayerInfo[playerid][pHasPutGun] == 0)
    {
        RpPlayerInfo[playerid][pPutGun] = GetPlayerWeapon(playerid);
        if(RpPlayerInfo[playerid][pPutGun] >=22 && RpPlayerInfo[playerid][pPutGun] <= 34)
        {
            new GunName[32];
            new string[128];
            if(GetPlayerWeapon(playerid) == 23 && RpPlayerInfo[playerid][pUsingTazer] == 1) return SendClientMessage(playerid, COLOR_RED, "You Can't store this weapon!");
            RpPlayerInfo[playerid][pPutGun] = GetPlayerWeapon(playerid);
            RpPlayerInfo[playerid][pPutGunAmmo] = GetPlayerAmmo(playerid);
            RpPlayerInfo[playerid][pHasPutGun] = 1;
            GetWeaponName(RpPlayerInfo[playerid][pPutGun],GunName,sizeof(GunName));
            format(string, 128, " %s stored in your inventory.", GunName);
            SendClientMessage(playerid, 0x42F3F198, string);
            RemovePlayerWeapon(playerid, GetPlayerWeapon(playerid));
            return 1;
        }
        else return SendClientMessage(playerid, COLOR_RED, "This weapon can't be stored!");
    }
    else return SendClientMessage(playerid, COLOR_RED, "You already have a weapon in your inventory!");
}
Reply
#2

Make sure that the code is under OnPlayerText, sometimes you may miss it/forget it.
Reply
#3

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Make sure that the code is under OnPlayerText, sometimes you may miss it/forget it.
This ain't needed actually, since its ZCMD, i never placed my commands at OnPlayerCommandText. (i think, tell me if i'm wrong)
Reply
#4

I didn't mean that actually, I apologise. I forgot it's an old method, I should have known better, the above post is correct, do the opposite of what I told you. Make sure it's not under any Public.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)