[Include] OnPlayerVehicleDamage
#1

OnPlayerVehicleDamage v1


So, I think there is no normal system like this on the forums.

ChangeLog:
Quote:

Version 1:
-Initial release.

Usage:
Firstly, copy both include files into /pawno/includes
Insert this code on top of your game mode after #include <a_samp>
pawn Код:
#include <OPVD>
And place this function anywhere you like:
pawn Код:
public OnPlayerVehicleDamage(playerid,vehicleid,Float:Damage)
{
    return 1;
}
Attention: If you use SetVehicleHealth or RepairVehicle in Filterscripts, add this code in all of them.
pawn Код:
#include <OPVD_SEC> // after include <a_samp>
An example:
pawn Код:
public OnPlayerVehicleDamage(playerid,vehicleid,Float:Damage)
{
    new msg[128];
    format(msg,sizeof(msg)," * You damaged vehicleid %i with %.2f",vehicleid,Damage);
    SendClientMessage(playerid,COLOR,msg);
    return 1;
}
OR a system, to turn off the engine, after a strong hit.
pawn Код:
public OnPlayerVehicleDamage(playerid,vehicleid,Float:Damage)
{
    if(Damage > 149.0)
    {
        new VehVars[7];
        GetVehicleParamsEx(vehicleid,VehVars[0],VehVars[1],VehVars[2],VehVars[3],VehVars[4],VehVars[5],VehVars[6]);
        if(VehVars[0])
        {
            SetVehicleParamsEx(vehicleid,false,VehVars[1],VehVars[2],VehVars[3],VehVars[4],VehVars[5],VehVars[6]);
            SendClientMessage(playerid,0xFF0000AA," * Your Engine Went down!");
        }
    }
}
Another nice use would be detecting heal hacks: If the Damage is negative, Check if the player is not in a mod shop, and not in a pay& spray.
Installing:
Download and save to pawn/includes folder!

Credits:
Lorenc_ inspired me

Download:
Here you go:
Version 1.0

Feel free to do anything you want with it.

v1 Has been tested.
Reply


Messages In This Thread
OnPlayerVehicleDamage - by wups - 12.08.2011, 09:48
Re: OnPlayerVehicleDamage - by rbN. - 12.08.2011, 10:14
Re: OnPlayerVehicleDamage - by wups - 12.08.2011, 10:32
Re: OnPlayerVehicleDamage - by CJoao - 12.08.2011, 10:42
Re: OnPlayerVehicleDamage - by Lorenc_ - 12.08.2011, 10:57
Re: OnPlayerVehicleDamage - by wups - 12.08.2011, 11:07
Re: OnPlayerVehicleDamage - by Gh0sT_ - 12.08.2011, 11:33
Re: OnPlayerVehicleDamage - by Macluawn - 12.08.2011, 17:24
Re: OnPlayerVehicleDamage - by wups - 12.08.2011, 17:28
Re: OnPlayerVehicleDamage - by rbN. - 12.08.2011, 18:15
Re: OnPlayerVehicleDamage - by Darnell - 12.08.2011, 18:40
Re: OnPlayerVehicleDamage - by Ninoslav - 12.08.2011, 19:20
Re: OnPlayerVehicleDamage - by Snipa - 12.08.2011, 19:31
Re: OnPlayerVehicleDamage - by Markx - 12.08.2011, 19:32
Re: OnPlayerVehicleDamage - by Ehab1911 - 17.08.2011, 00:33
Re: OnPlayerVehicleDamage - by dowster - 17.08.2011, 00:50
Re: OnPlayerVehicleDamage - by Darnell - 17.08.2011, 13:52
Re: OnPlayerVehicleDamage - by wouter0100 - 17.08.2011, 18:09
Re: OnPlayerVehicleDamage - by knackworst - 19.08.2011, 15:21
Re: OnPlayerVehicleDamage - by wouter0100 - 19.08.2011, 16:14
Re: OnPlayerVehicleDamage - by Kaperstone - 19.08.2011, 17:46
Re: OnPlayerVehicleDamage - by Darnell - 19.08.2011, 18:11
Re: OnPlayerVehicleDamage - by VOTZE - 22.09.2011, 13:46
Re: OnPlayerVehicleDamage - by wups - 22.09.2011, 14:14
Re: OnPlayerVehicleDamage - by Edvin - 22.09.2011, 14:38
Re: OnPlayerVehicleDamage - by andmeida10 - 05.07.2012, 07:47
Re: OnPlayerVehicleDamage - by Black Wolf - 21.09.2012, 02:56
Re: OnPlayerVehicleDamage - by Skyrise - 21.09.2012, 02:58

Forum Jump:


Users browsing this thread: 3 Guest(s)