doesn't match the arguments
#1

Код:
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
Reply
#2

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

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

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)