SA-MP Forums Archive
Vehicle auto repairing problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Vehicle auto repairing problem (/showthread.php?tid=269487)



Vehicle auto repairing problem - Yaszine - 16.07.2011

Hello everyone ..

I had a problem while repairing the burnt vehicle with an AutoRepairing system [ Credits forgotten ]
So, here you are:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(Autorep[playerid] == 1 )
    {
        new Float:health;
        new veh;
        veh = GetPlayerVehicleID(playerid);
        GetVehicleHealth(veh, health);
        if(IsPlayerInAnyVehicle(playerid) && health < 350)
        {
            RepairVehicle(veh);
            PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
            SendClientMessage(playerid, WHITE,"AutoRepairing .. Use /autorep to disable it.");
            return 1;
        }

    }

return 1;
}
That works so bad usual, exactly when the vehicle is flipped upside down .. because it sends too many messages and sounds .. So I need when a player's vehicle is auto repaired it sends to him just 1 message and one sound at a time .. I don't think so that is possible within the car which is flipped upside down

Sorry for my bad English ..


Re: Vehicle auto repairing problem - MoroDan - 16.07.2011

Actually you can with SetVehicleAngularVelocity. Just play a bit with the Z Angle .


Re : Re: Vehicle auto repairing problem - Yaszine - 16.07.2011

Quote:
Originally Posted by MoroDan
Посмотреть сообщение
Actually you can with SetVehicleAngularVelocity. Just play a bit with the Z Angle .
Thanks for your reply, But if the driven vehicle is Hydra, So when its health is < 350, I think it will stop a moment and restart again like you're just turn on its engine but this time is on air .. So !


Re : Vehicle auto repairing problem - Yaszine - 30.07.2011

BUMP !


Re: Vehicle auto repairing problem - [MWR]Blood - 30.07.2011

Make a player variable.
I reccomend you to put a timer instead of OnPlayerUpdate!