Pawno crash on compiling
#1

Hi all,

So, I'm scripting and with a piece of code, my pawno crashes when I press 'compile'. When I exclude this from the script, it can compile without a single problem. Where did I make a mistake here?

pawn Код:
if(dialogid == 688) // Upgrade Vehicle
    {
        if(response)
        {
            for(new h = 0; h < sizeof(HouseInfo); h++)
            {
                new model = strval(inputtext);
                if(model < 400)
                    return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
                if(model > 611)
                    return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
                if(model == 425 || model == 432 || model == 476 || model == 447 || model == 537 || model == 538 || model == 569 || model == 570 || model == 584 || model == 590 || model == 591 || model == 606 || model == 607 || model == 608 || model == 610 || model == 611 || model == 441 || model == 464 || model == 465 || model == 501 || model == 564 || model == 594 || model == 435 || model == 449 || model == 450)
            {
                    SendClientMessage(playerid, 0xE21F1FFF, "Those vehicles are restricted!");
                    ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
                    return 1;
                }
                HouseInfo[h][CarModel] = model;
                IsUpgradingVehicle[playerid] = true;
                ShowPlayerDialog(playerid, 255, DIALOG_STYLE_MSGBOX, "Vehicle Setup", "Go to the position you want your vehicle to spawn, then type /confirm.", "Select", "Cancel");
                return 1;
            }
        }
    else
        {
            ShowPlayerDialog(playerid, 668, DIALOG_STYLE_LIST, "House Setup", "Entrance\nName\nDescription\nInterior\nVehicle\nVehicle2\nRent\nPurchase", "Select", "Cancel");
            return 1;
        }

    }
    return 1;
}
Reply
#2

pawn Код:
if(model == 425 || model == 432 || model == 476 || model == 447 || model == 537 || model == 538 || model == 569 || model == 570 || model == 584 || model == 590 || model == 591 || model == 606 || model == 607 || model == 608 || model == 610 || model == 611 || model == 441 || model == 464 || model == 465 || model == 501 || model == 564 || model == 594 || model == 435 || model == 449 || model == 450)
It may have something to do with this, I'd suggest making it into a restricted ID array
Reply
#3

Anyone with a definite conclusion..?
Reply
#4

pawn Код:
if(dialogid == 688) // Upgrade Vehicle
{
    if(response)
    {
        for(new h = 0; h < sizeof(HouseInfo); h++)
        {
            new model = strval(inputtext);

            if(model < 400)
                return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");

            if(model > 611)
                return ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");

            if(IsModelValid(model))
            {
                SendClientMessage(playerid, 0xE21F1FFF, "Those vehicles are restricted!");
                ShowPlayerDialog(playerid, 687, DIALOG_STYLE_INPUT, "Vehicle", "Please enter a vehicle ID from 400 to 611.", "Create", "Cancel");
                return 1;
            }

            HouseInfo[h][CarModel] = model;
            IsUpgradingVehicle[playerid] = true;
            ShowPlayerDialog(playerid, 255, DIALOG_STYLE_MSGBOX, "Vehicle Setup", "Go to the position you want your vehicle to spawn, then type /confirm.", "Select", "Cancel");
            return 1;
        }
    }
    else
        return ShowPlayerDialog(playerid, 668, DIALOG_STYLE_LIST, "House Setup", "Entrance\nName\nDescription\nInterior\nVehicle\nVehicle2\nRent\nPurchase", "Select", "Cancel");

    return 1;
}

stock IsModelValid(model)
{
    switch(model)
        case 425, 432, 476, 447, 537, 538, 569, 570, 584, 590, 591, 606, 607, 608, 610, 611, 441, 464, 465, 501, 564, 594, 435, 449, 450: return true;
    return false;
}
Try.
Reply
#5

Код:
D:\Server\Project Roderick\Server\filterscripts\house.pwn(1059) : warning 217: loose indentation
D:\Server\Project Roderick\Server\filterscripts\house.pwn(1073) : warning 217: loose indentation
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2194) : warning 217: loose indentation
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2208) : error 017: undefined symbol "IsModelValid"
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2227) : error 029: invalid expression, assumed zero
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2227) : error 017: undefined symbol "IsModelValid"
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2229) : error 017: undefined symbol "model"
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2230) : error 001: expected token: "{", but found "case"
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2231) : error 002: only a single statement (or expression) can follow each "case"
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2231) : warning 215: expression has no effect
D:\Server\Project Roderick\Server\filterscripts\house.pwn(2234) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
Reply
#6

1. Why you using HouseInfo in loop for vehicle upgrade?
2. Try this:
PHP код:
if(dialogid == 688// Upgrade Vehicle
    
{
        if(
response)
        {
            for(new 
0sizeof(HouseInfo); h++)
            {
                new 
model strval(inputtext);
                if(
model 400) return ShowPlayerDialog(playerid687DIALOG_STYLE_INPUT"Vehicle""Please enter a vehicle ID from 400 to 611.""Create""Cancel");
                if(
model 611) return ShowPlayerDialog(playerid687DIALOG_STYLE_INPUT"Vehicle""Please enter a vehicle ID from 400 to 611.""Create""Cancel");
                if(
model == 425 || model == 432 || model == 476 || model == 447 || model == 537 || model == 538 || model == 569 || model == 570 ||
                   
model == 584 || model == 590 || model == 591 || model == 606 || model == 607 || model == 608 || model == 610 || model == 611 ||
                   
model == 441 || model == 464 || model == 465 || model == 501 || model == 564 || model == 594 || model == 435 || model == 449 || model == 450)
                {
                    
SendClientMessage(playerid0xE21F1FFF"Those vehicles are restricted!");
                    
ShowPlayerDialog(playerid687DIALOG_STYLE_INPUT"Vehicle""Please enter a vehicle ID from 400 to 611.""Create""Cancel");
                    return 
1;
                }
                
HouseInfo[h][CarModel] = model;
                
IsUpgradingVehicle[playerid] = true;
                
ShowPlayerDialog(playerid255DIALOG_STYLE_MSGBOX"Vehicle Setup""Go to the position you want your vehicle to spawn, then type /confirm.""Select""Cancel");
                return 
1;
            }
        }
        else
        {
            
ShowPlayerDialog(playerid668DIALOG_STYLE_LIST"House Setup""Entrance\nName\nDescription\nInterior\nVehicle\nVehicle2\nRent\nPurchase""Select""Cancel");
            return 
1;
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)