08.12.2013, 05:03
hi,
how can i make a pickup and when i drive to the pickup in a car it will fix my car then?
I tried but it never gives me health to my car
hope u can help
how can i make a pickup and when i drive to the pickup in a car it will fix my car then?
I tried but it never gives me health to my car
pawn Код:
new Vehicle[MAX_PLAYERS];
//with command player gets into vehicle that is created like this
Vehicle[playerid]=CreateVehicle(571,x,y,z,facing_angle,-1,-1,-1);
//OnGameModeInit
CreatePickup(1248,1,x,y,z,-1);
public OnPlayerPickUpPickup(playerid, pickupid)
{
foreach (Player, i)
{
if(IsPlayerInAnyVehicle(i))
{
if(IsPlayerInRangeOfPoint(i,2,x,y,z))
{
SetVehicleHealth(Vehicle[i],1000.0);
RepairVehicle(Vehicle[i]);
}
}
}
return 1;
}