Help with Argument 3 -
Genmetal - 15.04.2015
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
Re: Help with Argument 3 -
ATGOggy - 15.04.2015
Show the error and the TruckingUnload enum
Re: Help with Argument 3 -
Genmetal - 15.04.2015
Код:
new Float:TruckingUnload[][0] =
{
{-64.7117,-1133.9790,1.0781},
{-19.0223,-278.8979,5.4297},
{1336.4464,289.4808,19.5615}
};
Re: Help with Argument 3 -
Genmetal - 15.04.2015
Help ...
Re: Help with Argument 3 -
ATGOggy - 15.04.2015
Show the error too.
Just copy and paste the message that you gets while compiling.
Re: Help with Argument 3 -
Genmetal - 15.04.2015
Код:
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]))
{
Re: Help with Argument 3 -
J4Rr3x - 15.04.2015
Change:
pawn Код:
new Float:TruckingUnload[][0] =
With:
pawn Код:
new Float:TruckingUnload[][3] =
Re: Help with Argument 3 -
Konstantinos - 15.04.2015
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.
Re: Help with Argument 3 -
Genmetal - 15.04.2015
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?
Re: Help with Argument 3 -
Konstantinos - 15.04.2015
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; i != sizeof (TruckingUnload); ++i)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[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;
}
}