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;
}
new Float:TruckingUnload[][0] =
{
{-64.7117,-1133.9790,1.0781},
{-19.0223,-278.8979,5.4297},
{1336.4464,289.4808,19.5615}
};
D:\gamemodes\project.pwn(363) : error 035: argument type mismatch (argument 3)
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0], TruckingUnload[1], TruckingUnload[2]))
{
new Float:TruckingUnload[][0] =
new Float:TruckingUnload[][3] =
|
Change:
pawn Код:
pawn Код:
|
if(IsPlayerInRangeOfPoint(playerid, 7.0, TruckingUnload[0][0], TruckingUnload[0][1], TruckingUnload[0][2]))
|
That is one part ^
The array is 2D so a correct example would be: pawn Код:
|
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;
}
}