[Include] OnEmptyVehicleDamage - Damage an empty vehicle (v0.1) [0.3c R3 Server]
#21

I mean how to use: UpdateVehicleDamageStatus with this?
Reply
#22

pawn Код:
public OnEmptyVehicleDamage(vehicleid,playerid,exems)
{
    new Float:VehHealth;
    new panels, doors, lights, tires;
    GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    GetVehicleHealth(vehicleid,VehHealth);
    if(GetPlayerWeapon(playerid) <= 15){SetVehicleHealth(vehicleid,VehHealth-random(100));}
    else{SetVehicleHealth(vehicleid,VehHealth-random(200));}
    //-------------------------
    if(VehHealth <= 900 && VehHealth >= 700)
    {
        panels = encode_panels(1, 0, 1, 0, 1, 0, 1);
        doors = encode_doors(1, 1, 1, 1, 1, 1);
    }
    else if(VehHealth <= 700 && VehHealth >= 500)
    {
        panels = encode_panels(1, 2, 1, 2, 1, 2, 1);
        doors = encode_doors(2, 2, 2, 2, 2, 2);
    }
    else if(VehHealth <= 500 && VehHealth >= 300)
    {
        panels = encode_panels(3, 2, 3, 2, 3, 2, 3);
        doors = encode_doors(3, 3, 3, 3, 3, 3);
    }
    else if(VehHealth <= 300)
    {
        panels = encode_panels(3, 3, 3, 3, 3, 3, 3);
        doors = encode_doors(4, 4, 4, 4, 4, 4);
    }
    UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
    return 1;
}
encode_doors and encode_panels are from the sa-mp wiki (https://sampwiki.blast.hk/wiki/OnVehicleDamageStatusUpdate)
Reply
#23

I was wondering... How to make panel(windshield << 16) when player shot windshield?
Reply
#24

I trued it, and it doesn't working.
As a found, GetPlayerKeys(playerid,newkeys,plyup,plylr) function always return 0. Why is it happens?
Reply
#25

It doesnt work anymore because vehicle sync kind of changed in 0.3d. If you shoot a car now it doesn't move anymore. Thats why that this script won't work anymore
Reply
#26

RobinOwnz is right. The only things that work is hitting the vehicle with a bat or something.
Reply
#27

Quote:
Originally Posted by NaS
Посмотреть сообщение
RobinOwnz is right. The only things that work is hitting the vehicle with a bat or something.
Well there's a bug if you mean that: You can damage other vehicles if you have a parachute equipped..
Reply
#28

No, if you hit the car (with a meelee weapon) it will move, because you run into the car, so the callback is called.
Reply
#29

I would fix it, but it seems useless, because most of this functions doesn't work since 0.3d ... :/
Sry guys
Reply
#30

please fix it..
Reply
#31

make a 0.3e version please
Good work
Reply
#32

Quote:
Originally Posted by The_Coder
Посмотреть сообщение
make a 0.3e version please
Good work
I second this.
Reply
#33

I'm so glad something like this finally got posted. THANK YOU for this! I always hated that you couldn't damage an empty vehicle! +REP
Reply
#34

Quote:
Originally Posted by NoahF
Посмотреть сообщение
I'm so glad something like this finally got posted. THANK YOU for this! I always hated that you couldn't damage an empty vehicle! +REP
Seems like you don't read anything, this doesn't work since 0.3d, only in 0.3c.
Reply
#35

I did this for six months before ))

http://*********/YKyjOElMbng
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)