Who is driving the car I shoot
#1

Thanks guys >..... Worked
Reply
#2

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        /* Yes, shooting in car ..
        You can use GetPlayerVehicleID to be more ..
            accurate in ID, or your model with GetVehicleModel (GetPlayerVehicleID (playerid)) .. */

    }
    return 1;
}
I do not know if it's really what you meant, I do not speak English in its entirety.
Reply
#3

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
      if(hittype == HIT_TYPE_VEHICLE)
      {
             if(hitid != INVALID_VEHICLE_ID)
             {
                      new driver = INVALID_PLAYER_ID;
                      foreach(new i: Player)
                      {
                              if(GetPlayerVehicleID(i) == hitid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
                              {
                                      driver = i;
                                      break;
                              }
                      }
                       if(driver != INVALID_PLAYER_ID)
                       {
                           // Put your codes here.
                       }
                       else // do something here if there isn't a driver in said vehicle.
             }
     }
     return 1;
}
Reply
#4

Thanks guys^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)