warning 202: number of arguments does not match definition
#1

Okay I dont know but I've got this error upon compiling....

Код:
	if (strcmp(cmd, "/buy", true) == 0)
	{
	    for (new i = 0; i < MAX_BUY_PLACES; i++)
		{
			if (IsPlayerInRangeOfPoint(playerid, 5.0, buyPlaces[i][0], buyPlaces[i][1], buyPlaces[i][2], buyPlaces[i][3]))
			{
			    ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapons","1. Deagle (250$)\n2.MP5 (500$)\n3.m4 (1000$)\n4. AK-47 (1000$)\n5. SD Pistol (150$)\n6. 9mm (150$)\n7. Shotgun (300$)\n8. Micro SMG (500$)\n9. Sawnoff Shotgun (700$)\n10.Combat Shotgun (1000$)\n11. Tec-9 (500$)\n12.Country Rifle (1000$)\n13. Sniper Rifle (2000$)\n14. RPG (5000$)\n14. Flame Thrower (4000$)", "Buy", "Close");
			}
		}
	    return 1;
	}
Код:
#define MAX_BUY_PLACES 4
new Float:buyPlaces[MAX_BUY_PLACES][4] =
{
	{1566.8317, -1691.0072, 5.8906},
	{2175.8867,-2259.5242,14.7734},
	{2497.3757, -1687.8939, 13.5221},
	{1582.6523, -1341.9149, 16.4844}
};
Код:
warning 202: number of arguments does not match definition
This is the buggy line
Код:
if (IsPlayerInRangeOfPoint(playerid, 5.0, buyPlaces[i][0], buyPlaces[i][1], buyPlaces[i][2], buyPlaces[i][3]))
Reply
#2

The warning says itself. The argument "isPlayerInRangeOfPoint" is not written as it should be
Your function is using 6 Arguments but the definition of this is 5 argument's.. So you need to delete the fifth text "buyPlaces[i][3]"
So it will look like this:
Код:
if (IsPlayerInRangeOfPoint(playerid, 5.0, buyPlaces[i][0], buyPlaces[i][1], buyPlaces[i][2]))
insted of:
Код:
if (IsPlayerInRangeOfPoint(playerid, 5.0, buyPlaces[i][0], buyPlaces[i][1], buyPlaces[i][2], buyPlaces[i][3]))
EDIT:
Код:
if (strcmp(cmd, "/buy", true) == 0)
	{
	    for (new i = 0; i < MAX_BUY_PLACES; i++)
		{
		if (IsPlayerInRangeOfPoint(playerid, 5.0, buyPlaces[i][0], buyPlaces[i][1], buyPlaces[i][2]))
			{
			    ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapons","1. Deagle (250$)\n2.MP5 (500$)\n3.m4 (1000$)\n4. AK-47 (1000$)\n5. SD Pistol (150$)\n6. 9mm (150$)\n7. Shotgun (300$)\n8. Micro SMG (500$)\n9. Sawnoff Shotgun (700$)\n10.Combat Shotgun (1000$)\n11. Tec-9 (500$)\n12.Country Rifle (1000$)\n13. Sniper Rifle (2000$)\n14. RPG (5000$)\n14. Flame Thrower (4000$)", "Buy", "Close");
			}
		}
	    	return 1;
	}
Reply
#3

But how do I implent the "buyPlaces[i][3]" with it?

I mean is there any way to link 2 IsPlayerInRange or should I use maybe

else if
and continue with the buy spots
Reply
#4

Hello

goviscrap gave you the solution.

Some information for you:
Код:
new Float:buyPlaces[MAX_BUY_PLACES][4] =
{                   X(0)       Y(1)    Z(2)
BuyPlace0	{1566.8317, -1691.0072, 5.8906},
BuyPlace1	{2175.8867,-2259.5242,14.7734},
BuyPlace2	{2497.3757, -1687.8939, 13.5221},
BuyPlace3	{1582.6523, -1341.9149, 16.4844}
};
The for-loop is for the different BuyPlaces ->
Buyplace0
...........|
...........|
...........
Buyplace3

buyPlaces[i][0] -> X-position
buyPlaces[i][1] -> Y-position
buyPlaces[i][2] -> Z-position

Why do you want to "link 2 IsPlayerInRange"?
Because of the different Buyplaces?
the for-loop do it already:
pawn Код:
for (new i = 0; i < MAX_BUY_PLACES; i++)
Instead of "MAX_BUY_PLACES" you can use "sizeof(buyPlaces)".
Reply
#5

........
Reply
#6

ahhh sorry didnt read it well

Thank ya!
Reply
#7

No problem
Reply
#8

Still no one understands what I need.

I need to add more ranges to the command. For example

Quote:

BuyPlace3 {1582.6523, -1341.9149, 16.4844}

How do I add that one into the IsPlayerInRange also?
Reply
#9

I think you need to make a "{" "else if" isplayeinrange....under it!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)