SA-MP Forums Archive
OnPlayerShot A Dynamic Vehicle - 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: OnPlayerShot A Dynamic Vehicle (/showthread.php?tid=646937)



OnPlayerShot A Dynamic Vehicle - maikons - 27.12.2017

I have this vehicle streammer:
https://sampforum.blast.hk/showthread.php?tid=580937

Is that possible to GetDynamicVehicleID on a shot (to remove vehicle health from unocupped vehicles and make a anti cheat)...
But GetPlayerDynamicVehicleID(playerid); get dynamicvehicleID from the vechile player is driving...

How to make it? I've tried:
PHP код:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ) {
    if(
hittype == BULLET_HIT_TYPE_VEHICLE
    {
        new 
vehid hitid;
        new 
string[80];
        
format(stringsizeof(string), "Vehicle Shotted %i Weapon %i."vehidweaponid);
        
SendClientMessage(playeridCOLOR_NEWSstring);
    }

To test, i know i trying
new vehid = hitid;
Get the current vehicle ID, not dynamic ID

But nothing print when i shot a car, nothing happen...


Re: OnPlayerShot A Dynamic Vehicle - JaKe Elite - 27.12.2017

Why not just use this? https://sampforum.blast.hk/showthread.php?tid=611142

It provides what you just need, OnPlayerShotVehicle. I do not kinda trust that Vehicle Streamer as it doesn't make any sense to me.