Need help - 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)
+--- Thread: Need help (
/showthread.php?tid=558925)
Need help -
MBilal - 19.01.2015
How i can stop other team mate to stop shooting his teammate vehicle..
because the vehicle Got damage and all got killed..
Under OnPlayerTakeDamage
if(GetPlayerTeam(issuerid)==GetPlayerTeam(playerid ))
{
new GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
How i can stop damage to Team mate vehicle...
}
}
Re: Need help -
xVIP3Rx - 19.01.2015
Quote:
This callback was added in SA-MP 0.3z and will not work in earlier versions!
|
The driver must be in the same team thought, not anyone in the car
pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
new driver = GetVehicleDriver(hitid);
if(driver != INVALID_PLAYER_ID && GetPlayerTeam(playerid) == GetPlayerTeam(driver)) return 0;
}
return 1;
}
stock GetVehicleDriver(vehicleid)
{
foreach(Player, i) if(IsPlayerInVehicle(i, vehicleid) && GetPlayerVehicleSeat(i) == 0) return i;
return INVALID_PLAYER_ID;
}
Re: Need help -
MBilal - 19.01.2015
Thanks Rep++