08.07.2018, 00:24
pawn Код:
AddARepairPickups(Float:x, Float:y, Float:z)
{
for (new i; i < sizeof(ARepairPickups); i++)
{
if (ARepairPickups[i][PickupID] == 0)
{
ARepairPickups[i][PickupID] = CreatePickup(3096, 1, x, y, z, 0);
ARepairPickups[i][pux] = x;
ARepairPickups[i][puy] = y;
ARepairPickups[i][puz] = z;
Create3DTextLabel("{FFFF00}Type {00FF00}/repair {FFFF00}to repair your vehicle!", -1, x, y, z +0.5, 50.0, 0);
CreateDynamicMapIcon(x, y, z, 63, 0, 0, 0, -1, 300.0);
printf("PickupID: %d, PosX: %.4f, PosY: %.4f, PosZ: %.4f",ARepairPickups[i][PickupID],x,y,z);
break;
}
}
}
bool:IsPlayerAtRepair(playerid)
{
for(new i; i != sizeof(ARepairPickups); i++)
{
if(ARepairPickups[i][PickupID] != 0)
{
printf("IsPlayerAtRepair: PosX: %.4f, PosY: %.4f, PosZ: %.4f",ARepairPickups[i][pux], ARepairPickups[i][puy], ARepairPickups[i][puz]);
}
if(ARepairPickups[i][PickupID] != 0 && IsPlayerInRangeOfPoint(playerid, 5.0, ARepairPickups[i][pux], ARepairPickups[i][puy], ARepairPickups[i][puz]))
return true;
}
return false;
}