Ask about earthquakes system
#24

pawn Код:
new AmountOfShakes[ MAX_PLAYERS ];
forward SetPlayerEarthquakeEffect   ( playerid, amount_of_shakes );
forward EarthquakeEffects           ( playerid, interval, bool:status );
public SetPlayerEarthquakeEffect( playerid, amount_of_shakes ){
    if( amount_of_shakes < AmountOfShakes[ playerid ] )
        return 0;
    AmountOfShakes[ playerid ] = amount_of_shakes;
    new vehicleid = GetPlayerVehicleID( playerid );
    if( vehicleid ){
        if( GetVehicleModelMass( vehicleid, true ) >= 2400.0 || amount_of_shakes <= SMALL_QUAKE+200 ){
            SetVehicleAngularVelocity( vehicleid, 0.09, 0.033, 0.05 );
        } else SetVehicleAngularVelocity( vehicleid, 0.03, 0.03, 0.03 );
    }
    return EarthquakeEffects( playerid, 10, false );
}
public EarthquakeEffects( playerid, interval, bool:status ){
    if( AmountOfShakes[ playerid ] <= 0 )
        return SetPlayerDrunkLevel( playerid, 0 );
    if( !(AmountOfShakes[ playerid ]%5) ){
        new vehicleid = GetPlayerVehicleID( playerid );
        if( GetVehicleModelMass( vehicleid, true ) >= 2400.0 || AmountOfShakes[ playerid ] <= SMALL_QUAKE+200 ){
            SetVehicleAngularVelocity( vehicleid, 0.03, 0.03, 0.03 );
        } else SetVehicleAngularVelocity( vehicleid, 0.015, 0.015, 0.015 );
    }
    if( status ){
        SetPlayerDrunkLevel( playerid, 3000 );
    } else SetPlayerDrunkLevel( playerid, 50000 );
    AmountOfShakes[ playerid ]--;
    return SetTimerEx( "EarthquakeEffects", interval, false, "iii", playerid, interval, !status );
}
Also have a function called forward Earthquake ( Float, Float:y, Float:z, Float:radius, area, amount_of_shakes ); but it's fused with so much LS-RP related code it may be useless to you. You can make the sound functions and such on your own. The rest is done through the mapping team + RemoveBuilding + Creation of objects.

Good luck hope you have as much fun as we did!
Reply


Messages In This Thread
Ask about earthquakes system - by TheFirst - 18.05.2014, 17:40
Re: Ask about earthquakes system - by Redirect Left - 18.05.2014, 17:45
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 17:47
Re: Ask about earthquakes system - by Kaperstone - 18.05.2014, 17:49
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 18:00
Re: Ask about earthquakes system - by Kindred - 18.05.2014, 18:02
Re: Ask about earthquakes system - by Calgon - 18.05.2014, 19:17
Re: Ask about earthquakes system - by LocMax - 18.05.2014, 19:25
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 19:27
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 19:30
Re: Ask about earthquakes system - by Khanz - 18.05.2014, 19:49
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 20:30
Re: Ask about earthquakes system - by Onfroi - 18.05.2014, 20:48
Re: Ask about earthquakes system - by Dignity - 18.05.2014, 20:49
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 21:00
Re: Ask about earthquakes system - by Dignity - 18.05.2014, 21:02
Re: Ask about earthquakes system - by GreenSt4lker - 18.05.2014, 21:04
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 21:06
Re: Ask about earthquakes system - by Basssiiie - 18.05.2014, 21:21
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 21:35
Re: Ask about earthquakes system - by beatsbydre - 18.05.2014, 21:50
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 21:57
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 21:59
Re: Ask about earthquakes system - by Damian - 18.05.2014, 22:06
Re: Ask about earthquakes system - by TheFirst - 18.05.2014, 22:13
Re: Ask about earthquakes system - by Abagail - 18.05.2014, 22:40
Re: Ask about earthquakes system - by Yves - 18.05.2014, 23:22
Re: Ask about earthquakes system - by Kindred - 19.05.2014, 13:05
Re: Ask about earthquakes system - by SaintMikey - 19.05.2014, 13:13
Re: Ask about earthquakes system - by Kindred - 19.05.2014, 13:18
Re: Ask about earthquakes system - by SaintMikey - 19.05.2014, 13:24
Re: Ask about earthquakes system - by Kindred - 19.05.2014, 15:27
Re: Ask about earthquakes system - by ZachKnoxx - 19.05.2014, 15:31
Re: Ask about earthquakes system - by FaceTutorialz - 20.05.2014, 10:46

Forum Jump:


Users browsing this thread: 1 Guest(s)