error 035: argument type mismatch (argument 3)
#1

Код:
gamemodes/test.pwn(4884) : error 035: argument type mismatch (argument 3)
pawn Код:
new gItemList[] =
{
    400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,
    431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,450,451,452,453,454,455,456,457,458,459,460,461,
    462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,
    493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,
    524,525,526,527,528,529,530,531,532,533,534,535,536,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,
    555,556,557,558,559,560,561,562,563,564,565,566,567,568,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,
    586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611
};

CMD:cars(playerid)
{
    static array[1][1];
    ShowPlayerPreviewModelDialog(playerid, 0, DIALOG_STYLE_PREVMODEL, "Vehicle selection dialog", gItemList, array, "Select", "Cancel"); //ERROR LINE
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        if(response)
        {
                 new Float:x,Float:y,Float:z;
             GetPlayerPos(playerid,x,y,z);
                 new veh = AddStaticVehicle(gItemList[listitem], x, y, z, 82.2873, 127, 127);
                 SendClientMessage(playerid,-1,"Car spawned");         
             PutPlayerInVehicle(playerid,veh,0);
             return 1;
        }
        return 0;
        }
}
Im using https://sampforum.blast.hk/showthread.php?tid=570213 for a vehicle spawner and everytime I compile my script it always gives me an error on just that one line. Any help would be appreciated. Thanks!
Reply
#2

You are using it false. The definition of function is :
PHP код:
ShowPreviewModelDialog(playeriddialogidcaption[], models[], labels[][], button1[], button2[], size sizeof models
If you don't know what all that mean, learn about arrays and some basic scripting knowledge.
Reply
#3

So you are saying that I'm just missing the parameter for "size = sizeof models"?
Reply
#4

If you needed the size argument you would have a doesn't match definition or similar error as of now it receives a default value and you don't need to manually provide it.

The error states that the 3rd argument is wrong.
Your third argument is DIALOG_STYLE_PREVMODEL but in the definition Dayrion provided it's supposed to be caption[]. There is no dialog style parameter. You can just remove DIALOG_STYLE_PREVMODEL and it should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)