public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
if(hittype == BULLET_HIT_TYPE_VEHICLE) {
// dano em veiculos desocupados
#define DEAGLE_DAMAGE 60
#define COMBATSHOTGUN_DAMAGE 64
#define SHOTGUN_DAMAGE 52
#define MP5_DAMAGE 28
#define SNIPER_DAMAGE 45
#define RIFLE_DAMAGE 38
#define M4_DAMAGE 35
#define AK47_DAMAGE 30
#define MINIGUN_DAMAGE 500
new Float:vhp;
GetDynamicVehicleHealth(hitid, vhp);
if(weaponid == 24) SetDynamicVehicleHealth(hitid, vhp-DEAGLE_DAMAGE);
else if(weaponid == 25) SetDynamicVehicleHealth(hitid, vhp-SHOTGUN_DAMAGE);
else if(weaponid == 27) SetDynamicVehicleHealth(hitid, vhp-COMBATSHOTGUN_DAMAGE);
else if(weaponid == 29) SetDynamicVehicleHealth(hitid, vhp-MP5_DAMAGE);
else if(weaponid == 30) SetDynamicVehicleHealth(hitid, vhp-AK47_DAMAGE);
else if(weaponid == 31) SetDynamicVehicleHealth(hitid, vhp-M4_DAMAGE);
else if(weaponid == 33) SetDynamicVehicleHealth(hitid, vhp-RIFLE_DAMAGE);
else if(weaponid == 34) SetDynamicVehicleHealth(hitid, vhp-SNIPER_DAMAGE);
else if(weaponid == 38) SetDynamicVehicleHealth(hitid, vhp-MINIGUN_DAMAGE);
}
}
|
Teve um post que eu achei que o gringo ja fez man, tlg, vou achar e volto
|
#define DEAGLE_DAMAGE 60
#define COMBATSHOTGUN_DAMAGE 64
#define SHOTGUN_DAMAGE 52
#define MP5_DAMAGE 28
#define SNIPER_DAMAGE 45
#define RIFLE_DAMAGE 38
#define M4_DAMAGE 35
#define AK47_DAMAGE 30
#define MINIGUN_DAMAGE 500
new Float:VidaCarro[MAX_VEHICLES];
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
GetVehicleHealth(vehicleid, VidaCarro[hitid]);
switch(weaponid)
{
case 24: VidaCarro[hitid] -= DEAGLE_DAMAGE);
case 25: VidaCarro[hitid] -= SHOTGUN_DAMAGE);
case 27: VidaCarro[hitid] -= COMBATSHOTGUN_DAMAGE);
case 29: VidaCarro[hitid] -= MP5_DAMAGE);
case 30: VidaCarro[hitid] -= AK47_DAMAGE);
case 31: VidaCarro[hitid] -= M4_DAMAGE);
case 33: VidaCarro[hitid] -= RIFLE_DAMAGE);
case 34: VidaCarro[hitid] -= SNIPER_DAMAGE);
case 38: VidaCarro[hitid] -= MINIGUN_DAMAGE);
}
SetVehicleHealth(vehicleid, VidaCarro[hitid]);
if(VidaCarro[hitid] < 250.0)
{
SetVehicleHealth(hitid, 0);
}
}
return 1;
}
|
Provavelmente estб atirando em um veiculo que nгo й dinвmico e/ou veiculos dinвmicos nгo suportam OnPlayerWeaponShot
|
|
PHP код:
|
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
GetDynamicVehicleHealth(hitid, VehicleInfo[hitid][vHealth]);
switch(weaponid)
{
case 24: (VehicleInfo[hitid][vHealth] -= DEAGLE_VEHDAMAGE);
case 25: (VehicleInfo[hitid][vHealth] -= SHOTGUN_VEHDAMAGE);
case 27: (VehicleInfo[hitid][vHealth] -= COMBATSHOTGUN_VEHDAMAGE);
case 29: (VehicleInfo[hitid][vHealth] -= MP5_VEHDAMAGE);
case 30: (VehicleInfo[hitid][vHealth] -= AK47_VEHDAMAGE);
case 31: (VehicleInfo[hitid][vHealth] -= M4_VEHDAMAGE);
case 33: (VehicleInfo[hitid][vHealth] -= RIFLE_VEHDAMAGE);
case 34: (VehicleInfo[hitid][vHealth] -= SNIPER_VEHDAMAGE);
case 38: (VehicleInfo[hitid][vHealth] -= MINIGUN_VEHDAMAGE);
}
if(VehicleInfo[hitid][vHealth] < 452) { VehicleInfo[hitid][vHealth] = 452; }
SetDynamicVehicleHealth(hitid, VehicleInfo[hitid][vHealth]);
}
|
Veja se o seu servidor estб com Lagcomp ON, creio que OnPlayerWeaponShot sу funcione nesse caso
|
|
O veiculo й dinamico...
Sabe algum lugar que eu posso ver se veiculos dinamicos aceitam OnPlayerWeaponShot Ou de testar isso? Baseado no que vocк me passou tentei fazer o meu, mas continua o mesmo problema de nem tirar lataria: PHP код:
|