SA-MP Forums Archive
doesn't match the arguments - 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: doesn't match the arguments (/showthread.php?tid=661093)



doesn't match the arguments - redtin06 - 22.11.2018

Код:
CMD:turfs(playerid, params[])
{
	new string[5500];
    new number = 0;

	for(new i; i < MAX_POINTS; i++)
	{
		if(Points[i][Type] >= 0)
		{
		    number ++;
		    if(Points[i][Vulnerable] == -1)
		    {
     			format(string, sizeof(string), "%d. %s\t{%h} %s\t%s\tTemporarily disabled", number, Points[i][Name],Points[i][Owner],Points[i][CapperName]);
			}
		    else
		    {
				format(string, sizeof(string), "%d. %s\t%s\t%s\t%d", number, Points[i][Name],Points[i][Owner],Points[i][CapperName],Points[i][Vulnerable]);
			}
			ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Turfs", "{a9c4e4}Turf\tOwner\tPerk\tVulnerability", string, "Close", "");
		}
	}
	return 1;
}
anyone can help me rid out of it


Re: doesn't match the arguments - redtin06 - 22.11.2018

The warning is "SERVER\Millennial Roleplay\gamemodes\MRP.pwn(34636) : warning 202: number of arguments does not match definition"


Re: doesn't match the arguments - d1git - 22.11.2018

PHP код:
format(stringsizeof string"");
strins(string"{a9c4e4}Turf\tOwner\tPerk\tVulnerability\n"0);
ShowPlayerDialog(playerid1DIALOG_STYLE_TABLIST_HEADERS"Turfs"string"Close"""); 



Re: doesn't match the arguments - DTV - 22.11.2018

Assuming that
pawn Код:
format(string, sizeof(string), "%d. %s\t{%h} %s\t%s\tTemporarily disabled", number, Points[i][Name],Points[i][Owner],Points[i][CapperName]);
is the warning line, two things pop out.

1. I've never seen %h in native SA-MP code so unless that's added from another include, that's probably not doing anything.
2. You have 5 specifiers (including the %h) but only gave information to 4 of them.


Re: doesn't match the arguments - d3Pedro - 22.11.2018

Quote:
Originally Posted by redtin06
Посмотреть сообщение
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Turfs", "{a9c4e4}Turf\tOwner\tPerk\tVulnerability", string, "Close", "");
This is wrong done code.

Here's the code:
pawn Код:
CMD:turfs(playerid, params[])
{
    new string[5500];
    new number = 0;
    string = "Turf\tOwner\tPerk\tVulnerability";
    for(new i; i < MAX_POINTS; i++)
    {
        if(Points[i][Type] >= 0)
        {
            number ++;
            if(Points[i][Vulnerable] == -1)
            {
                format(string, sizeof(string), "%s\n%d. %s\t{%h} %s\t%s\tTemporarily disabled", string, number, Points[i][Name],Points[i][Owner],Points[i][CapperName]);
            }
            else
            {
                format(string, sizeof(string), "%s\n%d. %s\t%s\t%s\t%d", string, number, Points[i][Name],Points[i][Owner],Points[i][CapperName],Points[i][Vulnerable]);
            }
            ShowPlayerDialog(playerid, 1, DIALOG_STYLE_TABLIST_HEADERS, "Turfs", string, "Close", "");
        }
    }
    return 1;
}
Here's ShowPlayerDialog wiki: https://sampwiki.blast.hk/wiki/ShowPlayerDialog
Here's dialog styles wiki: https://sampwiki.blast.hk/wiki/Dialog_Styles // it has examples provided!
Read them both so you can understand it better and next time, try to search before posting.

The code you provided is done by me (not this but the real /turfs code.), and i don't recommend you to use that leaked script.