speedboost with class problem...
#3

Under OnGameModeInit:
pawn Код:
for( new slots = GetMaxPlayers( ), i; i < slots; i ++ )
{
    if( IsPlayerConnected( i ) && !IsPlayerNPC( i ) )
    {
        SpeedBoostMultiplier[ i ] = 3.0;
    }
}
Under OnPlayerKeyStateChange:
pawn Код:
if( newkeys & KEY_FIRE )
{
    new Float:vx, Float:vy, Float:vz;
    if( Teams[ playerid ] != FREEROAM ) break;
    if( !IsPlayerInAnyVehicle( playerid ) ) break;
    if( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER ) break;
   
    GetVehicleVelocity( GetPlayerVehicleID( playerid ), vx, vy, vz );

    if( floatabs( vx ) < 3 && floatabs( vy ) < 3 && floatabs( vz ) < 3 )
    {
        SetVehicleVelocity( GetPlayerVehicleID( playerid ), vx * SpeedBoostMultiplier[ playerid ], vy * SpeedBoostMultiplier[ playerid ], vz * SpeedBoostMultiplier[ playerid ] );
    }
    return 1;
}
Reply


Messages In This Thread
speedboost with class problem... - by niels44 - 17.02.2012, 14:23
Re: speedboost with class problem... - by niels44 - 19.02.2012, 13:34
Re: speedboost with class problem... - by aRoach - 19.02.2012, 13:43
Re: speedboost with class problem... - by niels44 - 19.02.2012, 14:49
Re: speedboost with class problem... - by aRoach - 19.02.2012, 14:51
Re: speedboost with class problem... - by niels44 - 19.02.2012, 14:54
Re: speedboost with class problem... - by niels44 - 20.02.2012, 14:26

Forum Jump:


Users browsing this thread: 2 Guest(s)