Чёто глянул в тему,а у нас в сампе 0.3 возможность теперь чинить авто не как в 0.2.2,а можно вместе с кузовом чинить,так вот подредактировал код для починки атво для сампа 0.3 [pwn]#include <a_samp>
forward OnRepairPickupCheck();
forward RespawnTimer(enumid);
enum REPAIR_INFO{
Float:RepairX,
Float:RepairY,
Float:RepairZ,
RespawnTime,
bool:PickupSpawned,
PickupID,
}
new REPAIR_PICKUPS[][REPAIR_INFO] = {
{2106.8855,1390.5999,10.8203,5000,true,-1},
{212.8447,2506.3833,16.4844,5000,true,-1},
/*X Y Z Respawn Time Spawned? PickupID*/
{0.0, 0.0, 0.0, 5000,/*5 sec*/ true, -1}
};
public OnFilterScriptInit()
{
print("\n#########################################");
print("### I have no money for repairing succesfully loaded");
print("### Author: Tr1viUm");
print("#########################################\n");
new y;
while (y < sizeof(REPAIR_PICKUPS)-1)
{
REPAIR_PICKUPS[y][PickupID] = CreatePickup(3096,2,REPAIR_PICKUPS[y][RepairX],REPAIR_PICKUPS[y][RepairY],REPAIR_PICKUPS[y][RepairZ]);
y++;
}
SetTimer("OnRepairPickupCheck",96,true);
return 1;
}
public OnFilterScriptExit()
{
new y;
while (y < sizeof(REPAIR_PICKUPS)-1)
{
if(REPAIR_PICKUPS[y][PickupSpawned] == true)
{
DestroyPickup(REPAIR_PICKUPS[y][PickupID]);
}
y++;
}
return 1;
}
public OnRepairPickupCheck()
{
new vehicleid,x,y;
while (x < GetMaxPlayers())
{
if(IsPlayerConnected(x) && IsPlayerInAnyVehicle(x))
{
while (y < sizeof(REPAIR_PICKUPS)-1)
{
vehicleid = GetPlayerVehicleID(x);
if(REPAIR_PICKUPS[y][PickupSpawned] == true && VehicleToPoint(5,vehicleid,REPAIR_PICKUPS[y][RepairX],REPAIR_PICKUPS[y][RepairY],REPAIR_PICKUPS[y][RepairZ]))
{
OnPlayerAtRepairPickup(REPAIR_PICKUPS[y][PickupID],y,vehicleid);
}
y++;
}
}
x++;
}
return true;
}
public RespawnTimer(enumid)
{
REPAIR_PICKUPS[enumid][PickupID] = CreatePickup(3096,2,REPAIR_PICKUPS[enumid][RepairX],REPAIR_PICKUPS[enumid][RepairY],REPAIR_PICKUPS[enumid][RepairZ]);
REPAIR_PICKUPS[enumid][PickupSpawned] = true;
}
//functions
OnPlayerAtRepairPickup(pickupid,enumid,vehicleid)
{
RepairVehicle(vehicleid);
DestroyPickup(pickupid);
REPAIR_PICKUPS[enumid][PickupSpawned] = false;
SetTimerEx("RespawnTimer",REPAIR_PICKUPS[enumid][RespawnTime],false,"i",enumid);
}
VehicleToPoint(Float:radi, vehicleid, Float:x, Float:y, Float:z)
{
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetVehiclePos(vehicleid, oldposx, oldposy, oldposz);
tempposx = (oldposx -x);
tempposy = (oldposy -y);
tempposz = (oldposz -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
return true;
return false;
}[/pwn]