SA-MP Forums Archive
Error - 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)
+--- Thread: Error (/showthread.php?tid=648512)



Error - Jokers98s - 23.01.2018

errors
Код:
Compiling...
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17145) : error 035: argument type mismatch (argument 3)
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17146) : error 035: argument type mismatch (argument 3)
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17147) : error 035: argument type mismatch (argument 3)
PHP код:
        new Query[300];
        
mysql_format(gSQL,Querysizeof(Query), "SELECT * FROM `Clans` WHERE `ID` = '%d'"searchclanid);
        
mysql_query(gSQLQuery );
        new 
clanid,clanlevel,clanpoints,clankills,clandeaths;
        new 
clanname[150],clandes[150],clanmoto[150];
        
cache_get_value_int(0"Clan_Id",clanid);
        
cache_get_value_name(0"Clan_Name",clanname);
        
cache_get_value_name(0"Clan_desc",clandes);
        
cache_get_value_name(0"Clan_Motd",clanmoto);
        
cache_get_value_int(0"Clan_Level",clanlevel);
        
cache_get_value_int(0"Clan_Points",clanpoints);
        
cache_get_value_int(0"Clan_Kills",clankills);
        
cache_get_value_int(0"Clan_Deaths",clandeaths);
        new 
str[2000];
        
strcat(str"\t{FFFFFF}Clan Info\n");
        
strcat(str"{#79C5FF}Clan Id{FFFFFF}    : %d\n",clanid);
        
strcat(str"{#79C5FF}Clan Name{FFFFFF}  : %s\n",clanname); //error
        
strcat(str"{#79C5FF}Clan Description{FFFFFF} : %s\n",clandes); //error
        
strcat(str"{#79C5FF}Clan Motd{FFFFFF}  : %s\n",clanmoto); //error
        
strcat(str"{#79C5FF}Clan Level{FFFFFF} : %d\n",clanlevel);
        
strcat(str"{#79C5FF}Clan Points{FFFFFF}: %d\n",clanpoints);
        
strcat(str"{#79C5FF}Clan Kills{FFFFFF} : %d\n",clankills);
        
strcat(str"{#79C5FF}Clan Deaths{FFFFFF}: %d\n",clandeaths);
        
Dialog_Show(playeridDIALOG_NULLDIALOG_STYLE_MSGBOX"Call of Duty AW ::  Clan Commands"str"Okay"""); 



Re: Error - 1fret - 23.01.2018

Quote:
Originally Posted by Jokers98s
Посмотреть сообщение
errors
Код:
Compiling...
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17145) : error 035: argument type mismatch (argument 3)
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17146) : error 035: argument type mismatch (argument 3)
F:\Server\My server\Copy- of server 3\Call of Duty\gamemodes\TDM.pwn(17147) : error 035: argument type mismatch (argument 3)
PHP код:
        new Query[300];
        
mysql_format(gSQL,Querysizeof(Query), "SELECT * FROM `Clans` WHERE `ID` = '%d'"searchclanid);
        
mysql_query(gSQLQuery );
        new 
clanid,clanlevel,clanpoints,clankills,clandeaths;
        new 
clanname[150],clandes[150],clanmoto[150];
        
cache_get_value_int(0"Clan_Id",clanid);
        
cache_get_value_name(0"Clan_Name",clanname);
        
cache_get_value_name(0"Clan_desc",clandes);
        
cache_get_value_name(0"Clan_Motd",clanmoto);
        
cache_get_value_int(0"Clan_Level",clanlevel);
        
cache_get_value_int(0"Clan_Points",clanpoints);
        
cache_get_value_int(0"Clan_Kills",clankills);
        
cache_get_value_int(0"Clan_Deaths",clandeaths);
        new 
str[2000];
        
strcat(str"\t{FFFFFF}Clan Info\n");
        
strcat(str"{#79C5FF}Clan Id{FFFFFF}    : %d\n",clanid);
        
strcat(str"{#79C5FF}Clan Name{FFFFFF}  : %s\n",clanname); //error
        
strcat(str"{#79C5FF}Clan Description{FFFFFF} : %s\n",clandes); //error
        
strcat(str"{#79C5FF}Clan Motd{FFFFFF}  : %s\n",clanmoto); //error
        
strcat(str"{#79C5FF}Clan Level{FFFFFF} : %d\n",clanlevel);
        
strcat(str"{#79C5FF}Clan Points{FFFFFF}: %d\n",clanpoints);
        
strcat(str"{#79C5FF}Clan Kills{FFFFFF} : %d\n",clankills);
        
strcat(str"{#79C5FF}Clan Deaths{FFFFFF}: %d\n",clandeaths);
        
Dialog_Show(playeridDIALOG_NULLDIALOG_STYLE_MSGBOX"Call of Duty AW ::  Clan Commands"str"Okay"""); 
strcat doesn't work that well with strings like that you got to use format.

Something like this:

PHP код:
new str[128];
format(str,sizeof(str),"{#79C5FF}Clan Name{FFFFFF}  : %s",clanname);
SendClientMessage(playerid,-1,str);
ormat(str,sizeof(str),"{#79C5FF}Clan Description{FFFFFF} : %s",clandes);
SendClientMessage(playerid,-1,str);
ormat(str,sizeof(str),"{#79C5FF}Clan Motd{FFFFFF}  : %s",clanmoto);
SendClientMessage(playerid,-1,str); 
I haven't tested it but i'm sure this will work.


Re: Error - Jokers98s - 23.01.2018

but i want to show info in an message box how could do it ?


Re: Error - Fratello - 23.01.2018

Turn
Код:
SendClientMessage(playerid,-1,str);
into
Код:
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE, "Clan Info", str, "OK", "");



Re: Error - 1fret - 23.01.2018

Quote:
Originally Posted by Fratello
Посмотреть сообщение
Turn
Код:
SendClientMessage(playerid,-1,str);
into
Код:
ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE, "Clan Info", str, "OK", "");
Yes, just as he says , just replace all those line with the code he gave above which is used to create a dialog and remember to define the dialog ID. The style which to let the dialog in message box is DIALOG_STYLE_MSGBOX.
Check here for other styles.


Re: Error - Jokers98s - 23.01.2018

Only showing last line of the string in messagebox


Re: Error - 1fret - 23.01.2018

SHow the code


Re: Error - Jokers98s - 23.01.2018

code :
Код:
        new str[2000];
        format(str,sizeof(str),"\t{FFFFFF}Clan Info\n");
        format(str,sizeof(str),"{79C5FF}Clan Id{FFFFFF}    : %d\n",clanid);
        format(str,sizeof(str),"{79C5FF}Clan Name{FFFFFF}  : %s\n",clanname);
        format(str,sizeof(str),"{79C5FF}Clan Description{FFFFFF} : %s\n",clandes);
        format(str,sizeof(str),"{79C5FF}Clan Motd{FFFFFF}  : %s\n",clanmoto);
        format(str,sizeof(str),"{79C5FF}Clan Level{FFFFFF} : %d\n",clanlevel);
        format(str,sizeof(str),"{79C5FF}Clan Points{FFFFFF}: %d\n",clanpoints);
        format(str,sizeof(str),"{79C5FF}Clan Kills{FFFFFF} : %d\n",clankills);
        format(str,sizeof(str),"{79C5FF}Clan Deaths{FFFFFF}: %d\n",clandeaths);

        ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_MSGBOX, "Call of Duty AW ::  Clan Info", str, "Okay", "");



Re: Error - Fratello - 23.01.2018

Quote:
Originally Posted by Jokers98s
Посмотреть сообщение
code :
Код:
        new str[2000];
        format(str,sizeof(str),"\t{FFFFFF}Clan Info\n");
        format(str,sizeof(str),"{79C5FF}Clan Id{FFFFFF}    : %d\n",clanid);
        format(str,sizeof(str),"{79C5FF}Clan Name{FFFFFF}  : %s\n",clanname);
        format(str,sizeof(str),"{79C5FF}Clan Description{FFFFFF} : %s\n",clandes);
        format(str,sizeof(str),"{79C5FF}Clan Motd{FFFFFF}  : %s\n",clanmoto);
        format(str,sizeof(str),"{79C5FF}Clan Level{FFFFFF} : %d\n",clanlevel);
        format(str,sizeof(str),"{79C5FF}Clan Points{FFFFFF}: %d\n",clanpoints);
        format(str,sizeof(str),"{79C5FF}Clan Kills{FFFFFF} : %d\n",clankills);
        format(str,sizeof(str),"{79C5FF}Clan Deaths{FFFFFF}: %d\n",clandeaths);

        ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_MSGBOX, "Call of Duty AW ::  Clan Info", str, "Okay", "");
If everything is alright, no compiler errors, you're good to go! Report here if you find any in-game bug.


Re: Error - Jokers98s - 23.01.2018

no error's.. but only one data is shown clan deaths