never seen this error before in my life help
#1

pawn Код:
cmd_house(playerid,params[]) {
    #pragma unused params
    if(IsPlayerConnected(playerid)){
        new tmp[64];
        the line thats fucked-if(sscanf(params, "s", tmp)) return SendClientMessage(playerid, COLOR_GREY, ".: Usage: /house (upgrade/downgrade) :.");
        SendFormattedMessage(playerid, COLOR_WHITE, "Prices for upgrade: 0[%d], 1[%d], 2[%d], 3[%d], 4[%d], 5[%d], 6[%d]", HousesLevels[0][1], HousesLevels[1][1], HousesLevels[2][1], HousesLevels[3][1], HousesLevels[4][1], HousesLevels[5][1], HousesLevels[6][1]);
        SendFormattedMessage(playerid, COLOR_WHITE, "7[%d], 8[%d], 9[%d], 10[%d], 11[%d], 12[%d]", HousesLevels[7][1], HousesLevels[8][1], HousesLevels[9][1], HousesLevels[10][1], HousesLevels[11][1], HousesLevels[12][1]);
        if(strlen(tmp) == strlen("upgrade")){
            for(new h = 0; h <= MAX_HOUSES; h++){
                if(PlayerToPoint(PTP_RADIUS, playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])){
                    if(strcmp(HouseInfo[h][hName],GetName(playerid), false ) == 0){
                        if(HouseInfo[h][hLevel]+1 > 12) return SendClientMessage(playerid, COLOR_ERROR, "You cannot set your house lvl above 12");
                        new Level = HousesLevels[HouseInfo[h][hLevel]+1][1];
                        SendFormattedMessage(playerid, COLOR_WHITE, "You have added improvments to your house that costs $%d", Level);
                        HouseInfo[h][hLevel] = (HouseInfo[h][hLevel]+1); GivePlayerMoney(playerid, -Level); Money[playerid] -= Level;
                        SavePlayerHouse(h);
                        for(new i = 0; i <= MAX_PLAYERS; i++)
                        {
heres the line i cant see anything wrong but when i compile

C:\Users\Lyn\Documents\Mafia\gamemodes\MafiaCity2. pwn(30310) : error 033: array must be indexed (variable "tmp")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
wtf does that mean ive never ever ever seen that before in my life
Reply
#2

I guess you create tmp like this: new tmp[xx]; and not like this: new tmp[xx][yy];?

You could also try to update your sscanf if you are using an old version.
Reply
#3

i have the upto date sscanif or what ever it is as i have loads of them like 100 lines worth off them ill post whole thing of that n sorry :P i forgot to copy it all
Reply
#4

1. Put your code into "[ pawn] CODE HERE [/pawn]"-format, cause nobody can actually read it like this.
2. Would it help to delete '#pragma unused params'? If not go first put the code into the right format.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)