SA-MP Forums Archive
argument type mismatch =( - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: argument type mismatch =( (/showthread.php?tid=223378)



argument type mismatch =( - THE_KNOWN - 09.02.2011

whats wrong? its supposed to show the members list =( :
Код:
if(dialogid == 28)
	    {
	    new p[256];
	    p=LoadMem(playerid);
	    ShowPlayerDialog(playerid, 29,"Members",p,"Ok","Cancel");
	    }
this is loadmem:
Код:
LoadMem(playerid)
{
	new q[128],mem[256];
	format(q,128,"SELECT * FROM ostats WHERE org=%d",org[playerid]);
	mysql_query(q);
	mysql_store_result();
	for(new i=0;i<mysql_num_rows();mysql_retrieve_row())
	    {
	    new tmp[32],s[128],field[3][32];
		mysql_fetch_row_format(q, "|");
        explode(q, field, "|");
		format(tmp,32,"%s",field[1]);
		format(s,128,"%s\n%s",s,tmp);
		format(mem,256,"s",s);
		}
	return mem;
}



Re: argument type mismatch =( - HyperZ - 09.02.2011

Actually, you forgot to add Dialig Style, i've added Dialog Message Box you can change it if you want to change..
https://sampwiki.blast.hk/wiki/Dialog_Styles

Fixed Code:
pawn Код:
if(dialogid == 28)
{
    new p[256];
    p=LoadMem(playerid);
    ShowPlayerDialog(playerid, 29,DIALOG_STYLE_MSGBOX,"Members",p,"Ok", "Cancel");
}



Re: argument type mismatch =( - THE_KNOWN - 09.02.2011

ok its fixed but one prob still exists when i enter the cp it shows members option but when i click it, it just closes (doesnt show the members)


Re: argument type mismatch =( - _Tommy - 09.02.2011

"29" - Make sure you have such a dialog id.


Re: argument type mismatch =( - THE_KNOWN - 09.02.2011

i dont think thats the prob


Re: argument type mismatch =( - duukjones - 09.02.2011

I think it is the problem.


Re: argument type mismatch =( - THE_KNOWN - 09.02.2011

tested and its not the prob


Re: argument type mismatch =( - wups - 11.02.2011

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
whats wrong? its supposed to show the members list =( :
pawn Код:
if(dialogid == 28)
{
        ShowPlayerDialog(playerid, 29,DIALOG_STYLE_MSGBOX,"Members",LoadMem(playerid),"Ok","Cancel");
}


LoadMem(playerid)
{
    new q[128];
    format(q,128,"SELECT * FROM ostats WHERE org=%d",org[playerid]); // shouldn't you only select Name or sth?
    mysql_query(q);
    mysql_store_result();
        new s[256],field[3][32];
        new idx=0;
    while(mysql_fetch_row_format(q,"|")
    {
                idx++;
                explode(q, field, "|");
        if(idx==1) format(s,256,"%s",field[1]);
        else format(s,256,"%s\n%s",s,field[1]);
    }
    return s;
}