Баг респавна транспорта
#7

Quote:
Originally Posted by Diman777
View Post
Я предпалагаю, что вот так
PHP Code:
public OnVehicleDeath(vehicleidkillerid)
{
    if (
vehicleid == vehicle_death_id[vehicleid] && killerid == player_shot_id[killerid])
    {
        ...
    }

Но я не проверял, так что смотри сам.
Сделал у себя во так
PHP Code:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
hittype == BULLET_HIT_TYPE_VEHICLE)
    {
        static 
Float:XFloat:YFloat:Z//Show in the petrol tank - It also works when the player is inside.
        
GetVehicleModelInfo(GetVehicleModel(hitid), VEHICLE_MODEL_INFO_PETROLCAPXYZ);
        if(
VectorSize(fX-XfY-YfZ-Z) < 0.15)
        {
              
SetVehicleHealth(hitid0.0);
              
EmptyVeh[hitid] = hitid;
              
KillerVeh[playerid] = playerid;
            return 
1;
        }
         
//Shot in empty vehicle
        
for(new GetPlayerPoolSize(); > -1i--)
        {
            if(
GetPlayerVehicleID(i) == hitid && GetPlayerVehicleSeat(i) == 0)
            return 
1;
        }
        
GetVehicleHealth(hitidX);
        
EmptyVeh[hitid] = hitid;
        
KillerVeh[playerid] = playerid;
          if(
0)
        {
             switch(
weaponid)
               {
                 case 
.. 15SetVehicleHealth(hitid10);
                  case 
22 .. 23SetVehicleHealth(hitid15);
                 case 
24SetVehicleHealth(hitid50);
                   case 
25 .. 27SetVehicleHealth(hitid30);
                case 
282932SetVehicleHealth(hitid5);
                case 
3031SetVehicleHealth(hitid10);
                case 
3334SetVehicleHealth(hitid40);
                case 
35 .. 38SetVehicleHealth(hitid80);
                default: return 
1;
            }
        }
    }
    return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
   if (
vehicleid == EmptyVeh[vehicleid])
    {
        if (
killerid == vehicleid)
        {
            
SetVehicleToRespawn(vehicleid);
         }
     }
     return 
1;

но всёравно не хочет машина респавниться
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)