G abuse
#1

Hi, friend , I could help or give an idea of how you could do that when a vehicle without a driver and this is a passenger in the passenger lay their weapons with 0 bullets or not generate any damage
Reply
#2

pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(IsPlayerInAnyVehicle(playerid))
    {
        new
            driver = INVALID_PLAYER_ID,
            vehid = GetPlayerVehicleID(playerid);
        for(new i; i < GetMaxPlayers(); i++)
        {
            if(GetPlayerVehicleID(i) == vehid && GetPlayerState(i) == PLAYER_STATE_DRIVER)
            {
                driver = i;
                break;
            }
        }
        if(driver == INVALID_PLAYER_ID && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return 0;
    }
    return 1;
}
Reply
#3

In OnPlayerWeaponShot check:
Player is in any vehicle ?
If yes, player state is passenger ? (GetPlayerState)
If yes, then check that vehicle id has driver ?
If no, remove him from vehicle
But i think this isn't good idea because it will make a loop between player for each shot
I saw an include on the forum for 'G Bug abuse'
Search it (i'm on my phone i can't search sorry)

EDIT: i was slow, the guy above me replied faster
Sorry
Reply
#4

thanks for the help, if it was faster has also happened to me haha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)