23.01.2015, 23:42
(
Последний раз редактировалось Flokx; 24.01.2015 в 16:32.
)
Thanks guys >..... Worked
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(IsPlayerInAnyVehicle(playerid))
{
/* Yes, shooting in car ..
You can use GetPlayerVehicleID to be more ..
accurate in ID, or your model with GetVehicleModel (GetPlayerVehicleID (playerid)) .. */
}
return 1;
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == HIT_TYPE_VEHICLE)
{
if(hitid != INVALID_VEHICLE_ID)
{
new driver = INVALID_PLAYER_ID;
foreach(new i: Player)
{
if(GetPlayerVehicleID(i) == hitid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
driver = i;
break;
}
}
if(driver != INVALID_PLAYER_ID)
{
// Put your codes here.
}
else // do something here if there isn't a driver in said vehicle.
}
}
return 1;
}