if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
if(MissionCar[4])
{
Step = 0;
MisiuneActiva = 0;
DestroyActor(Actorr[0]);
DestroyActor(Actorr[1]);
OwnerMisiune[playerid] = 0;
PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/ppuz6duc8e/Mission_Passed.mp3");
SendClientMessage(playerid, -1, "Ai distrus servieta cu bani, acum nu isi mai pot incheia afacerea ilegala.");
GameTextForPlayer(playerid, "~y~mission passed!", 5000, 3);
}
else return SendClientMessage(playerid, -1, "Nu aia este masina ce trebuie distrusa.");
}
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == 2)
{
new bool: isany_incar = false;
for(new i = 0; i < MAX_PLAYERS; ++i)
{
if(IsPlayerInVehicle(i, hitid))
{
isany_incar = true;
break;
}
}
if(isany_incar != true)//You hit a vehicle with noone sitting inside.
{
//the vehicle's ID you've hit is hitid
new Float:vHealth;
GetVehicleHealth(hitid, vHealth);
SetVehicleHealth(hitid, vHhealth - 50);
}
}
return 1;
}
if(hitid != MissionCar[4]) SendClientMessage(playerid, color, "that car you shot is the wrong one");
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
new vehicleid = hitid;
if(vehicleid == MissionCar[4])
{
SendClientMessage(playerid, -1, "You've hitted correct car");
}
else
{
SendClientMessage(playerid, -1, "You've hitted wrong car");
}
}
return 1;
}
|
Try this
PHP код:
|