ZCMD command error
#1

I have made this for deleting house...it includes furniture,but the problem is that when i put for example /deletehouse [houseid], if it's an invalid house id it says wrong house id,but if i put a right house id that is used it shows error message by ZCMD,why?here is the code:
pawn Код:
CMD:resethouse(houseid, params[])
{
    new house;
    if(!sscanf(params, "d", house))
    {
        if(hInfo[house][hcreated] != 1) return SendClientMessage(houseid, -1, "Invalid house id");
        else
        {
            hInfo[house][hcreated] = 0; //it only changes these two things
            hInfo[house][houseowned] = 0; //it only changes these two things
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(pInfo[i][playerhouse] == house)
                {
                    pInfo[i][playerhouse] = 0;
                }
            }
            hInfo[house][housepot] = 0;
            hInfo[house][housegun] = 0;
            hInfo[house][housecash] = 0;
            hInfo[house][houselock] = 0;
            format(string, sizeof(string), "You have deleted house id %d.", house);
            SendClientMessage(houseid, COLOR_GREY, string);
            new query[128];
            mysql_format(dbHandle, query, sizeof(query), "DELETE * FROM `houselist` WHERE `hID`=%d", house);
            printf("%d deleted", house);
            mysql_tquery(dbHandle, query, "", "");
        }
    }
    else
    {
        SendClientMessage(houseid, COLOR_GREY, "/resethouse [houseid]");
    }
    return 1;
}
Reply


Messages In This Thread
ZCMD command error - by iBots - 16.04.2015, 13:42
Re: ZCMD command error - by Azula - 16.04.2015, 13:48
Re: ZCMD command error - by iBots - 16.04.2015, 13:56
Re: ZCMD command error - by ATGOggy - 16.04.2015, 13:57
Re: ZCMD command error - by iBots - 16.04.2015, 14:01
Re: ZCMD command error - by ATGOggy - 16.04.2015, 14:04
Re: ZCMD command error - by iBots - 16.04.2015, 14:13
Re: ZCMD command error - by ATGOggy - 16.04.2015, 14:21
Re: ZCMD command error - by iBots - 16.04.2015, 14:28
Re: ZCMD command error - by ATGOggy - 16.04.2015, 15:05

Forum Jump:


Users browsing this thread: 2 Guest(s)