Help with Argument 3
#1

hey i tried to compile cuz this problem Argument 3

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	if(Trucker[playerid] == 1)
	{
	    if(Work[playerid] == 1)
	    {
			if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
		 	{
				if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0], TruckingUnload[1], TruckingUnload[2])) ( <<< Error in Line 363)
				{
					if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
		   			{
						GivePlayerMoney(playerid, 4000);
						SendClientMessage(playerid, COLOR_ORANGE, "INFO: {FFFFFF}Kau telah berhasil menyelesaikan tugasmu dan mendapatkan $4.000");
						DisablePlayerCheckpoint(playerid);
						Work[playerid] = 0;
						Trucker[playerid] = 0;
			        }
				}
			}
		}
	}
	return 1;
}
Please help
Reply
#2

Show the error and the TruckingUnload enum
Reply
#3

Код:
new Float:TruckingUnload[][0] =
{
	{-64.7117,-1133.9790,1.0781},
	{-19.0223,-278.8979,5.4297},
	{1336.4464,289.4808,19.5615}
};
Reply
#4

Help ...
Reply
#5

Show the error too.

Just copy and paste the message that you gets while compiling.
Reply
#6

Код:
D:\gamemodes\project.pwn(363) : error 035: argument type mismatch (argument 3)
ERROR LINE
Код:
				if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0], TruckingUnload[1], TruckingUnload[2]))
				{
Reply
#7

Change:
pawn Код:
new Float:TruckingUnload[][0] =
With:
pawn Код:
new Float:TruckingUnload[][3] =
Reply
#8

Quote:
Originally Posted by J4Rr3x
Посмотреть сообщение
Change:
pawn Код:
new Float:TruckingUnload[][0] =
With:
pawn Код:
new Float:TruckingUnload[][3] =
That is one part ^

The array is 2D so a correct example would be:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0][0], TruckingUnload[0][1], TruckingUnload[0][2]))
if the player is in range with the first row of TruckingUnload. In case you need to check if the player is in range of any point, use a loop.
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
That is one part ^

The array is 2D so a correct example would be:
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0][0], TruckingUnload[0][1], TruckingUnload[0][2]))
if the player is in range with the first row of TruckingUnload. In case you need to check if the player is in range of any point, use a loop.
what is loop for? can you give an example?
Reply
#10

Currently, you have 3 positions to TruckingUnload array. In case you get more and you cannot check if a player is in range of position 1, if not, check position 2 etc. a loop would do the job for you.

PHP код:
for (new i!= sizeof (TruckingUnload); ++i)
{
    if(
IsPlayerInRangeOfPoint(playerid7.0TruckingUnload[i][0], TruckingUnload[i][1], TruckingUnload[i][2]))
    {
        
// in range.. "i" holds the index. For example, "i" is 2. So you're in range of the 3rd position (remember indexes start with 0)
        
break;
    }

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)