Function/Callback that detects...
#2

Nope there isn't one. All callbacks are listed here
You can make it yourself though.

put this in your filterscript
pawn Code:
#include vhealth.inc
public OnFilterScriptInit()
{
  SetTimer("VehicleHCheck", 500, 1);
}
//put this callback where you want it
public OnVehicleDamage(driverid, vehicleid)
{
.....
}
in an include file call it vhealth.inc put it in pawn/include
pawn Code:
//This is in here for security, just leave as is
#if defined _vhealthcallback_Included
    #endinput
#endif
#define _vhealthcallback_Included

//have a variable for all players for their cars vehicle healths.
new Float:playerVHealth[GetMaxPlayers()];

//This is your callback, put this where you want it in your filterscript
forward OnVehicleDamage(driverid, vehicleid);

forward VehicleHCheck();
public VehicleHCheck()
{
  new Float:VHealth, vehicleid;
  for(new playerid=0; player<GetMaxPlayers();playerid++)
  {
    if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) continue;
    vehicleid = GetPlayerVehicleID(playerid);
    GetVehicleHealth(vehicleid, VHealth);
    if(VHealth < playerVHealth[playerid])
    {
      OnVehicleDamage(playerid, vehicle);
    }
    playerVHealth[playerid] = VHealth;
  }
}
Reply


Messages In This Thread
Function/Callback that detects... - by Torran - 23.01.2010, 21:52
Re: Function/Callback that detects... - by mansonh - 23.01.2010, 22:21
Re: Function/Callback that detects... - by Torran - 23.01.2010, 22:27
Re: Function/Callback that detects... - by Correlli - 24.01.2010, 00:00
Re: Function/Callback that detects... - by Torran - 24.01.2010, 00:04
Re: Function/Callback that detects... - by Correlli - 24.01.2010, 00:06
Re: Function/Callback that detects... - by Torran - 24.01.2010, 00:15
Re: Function/Callback that detects... - by Correlli - 24.01.2010, 00:42
Re: Function/Callback that detects... - by Torran - 24.01.2010, 00:47
Re: Function/Callback that detects... - by Correlli - 24.01.2010, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)