open.mp forum
[Pawn] error 035: argument type mismatch (argument 3) - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] error 035: argument type mismatch (argument 3) (/showthread.php?tid=1867)



error 035: argument type mismatch (argument 3) - Boxi - 2021-04-13

Hi all! i updated my gm to the eSelection version that TommyB123 (https://github.com/TommyB123/eSelection)?released and everything is fine, except for these 2 errors that it tells me that the library has?



PHP Code:
eSelection.inc(124) : error 035argument type mismatch (argument 3)

eSelection.inc(205) : error 035argument type mismatch (argument 3



(they were already there before i changed the code in my gm). does anyone know what i can do? the lines of the errors are these:



PHP Code:
static stock SetModelSelectionModelBox(playeridcount, const model[g_eMenuModelData])

{

PlayerTextDrawSetPreviewModel(playeridg_ePlayerMenuData[playerid][g_eMenuItems][count], model[g_eMenuModel]);

if(
model[g_eItemUseRotation])

{

PlayerTextDrawSetPreviewRot(playeridg_ePlayerMenuData[playerid][g_eMenuItems][count], model[g_eItemRotX], model[g_eItemRotY], model[g_eItemRotZ], model[g_eItemZoom]);

}

else

{

PlayerTextDrawSetPreviewRot(playeridg_ePlayerMenuData[playerid][g_eMenuItems][count], 0.00.00.0);

}



PlayerTextDrawShow(playeridg_ePlayerMenuData[playerid][g_eMenuItems][count]);



if(
model[g_eMenuModelText][0])

{

PlayerTextDrawSetString(playeridg_ePlayerMenuData[playerid][g_eMenuTextDisplay][count], model[g_eMenuModelText]); //line 205

PlayerTextDrawShow(playeridg_ePlayerMenuData[playerid][g_eMenuTextDisplay][count]);

}





PHP Code:
static stock ShowModelSelectionMenuTextDraws(playerid, const header[])

{

DestroyModelSelectionPlayerTDs(playerid);

CreateModelSelectionPlayerTDs(playerid);



for(new 
Iter:list_iter(g_ePlayerMenuData[playerid][g_eMenuModels]), countmodel[g_eMenuModelData]; iter_inside(i); iter_move_next(i))

{

if(
count >= MAX_ITEM_PER_PAGE) break;



iter_get_arr(imodel);

SetModelSelectionModelBox(playeridcountmodel);

count ;

}



//page TD

new page[8];

format(pagesizeof(page), "1/%d", (list_size(g_ePlayerMenuData[playerid][g_eMenuModels]) / MAX_ITEM_PER_PAGE)  1);

PlayerTextDrawSetString(playeridg_ePlayerMenuData[playerid][g_eMenuPageText], page);



//header test

PlayerTextDrawSetString(playeridg_ePlayerMenuData[playerid][g_eMenuHeaderText], header); //line 124

PlayerTextDrawShow(playeridg_ePlayerMenuData[playerid][g_eMenuHeaderText]);

PlayerTextDrawShow(playeridg_ePlayerMenuData[playerid][g_eMenuPageText]);



TextDrawShowForPlayer(playeridg_eMenuRightArrow);

TextDrawShowForPlayer(playeridg_eMenuLeftArrow);

TextDrawShowForPlayer(playeridg_eMenuBackground);

TextDrawShowForPlayer(playeridg_eMenuTopBanner);

TextDrawShowForPlayer(playeridg_eMenuBottomBanner);

TextDrawShowForPlayer(playeridg_eMenuCloseButton);

SelectTextDraw(playerid, -1);





i have all the includes in their latest version, help please :C


RE: error 035: argument type mismatch (argument 3) - PutuSuhartawan - 2021-04-15

PlayerTextDrawSetString(playerid, g_ePlayerMenuData[playerid][g_eMenuHeaderText], header); //line 124
Sir. ShowModelSelectionMenuTextDraws just using two variables. not three. and the type variable just string need array.

Basically, "argument type mismatch" means that you're inserting 1 type of argument into
a function which needs to receive an argument of different type.

For example: you will get this error if you input a integer into a function that requires a string.