[Pomoc] Brzina udarca lopte JailBreak
Results 1 to 9 of 9
  1. #1
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Jagodina
    Karma
    3

    Default Brzina udarca lopte JailBreak

    PHP Code:
    // BALL BRAIN :)
    ////////////////////////////////////////////////////////////
    public FwdThinkBalliEntity ) {
        if( !
    is_valid_entg_iBall ) )
            return 
    PLUGIN_HANDLED;
        
        
    entity_set_floatiEntityEV_FL_nextthinkhalflife_time( ) + 0.05 );
        
        static 
    Float:vOrigin], Float:vBallVelocity];
        
    entity_get_vectoriEntityEV_VEC_originvOrigin );
        
    entity_get_vectoriEntityEV_VEC_velocityvBallVelocity );
        
        static 
    iOwneriOwner peviEntitypev_iuser1 );
        static 
    iSolidiSolid peviEntitypev_solid );
        
        
    // Trail --- >
        
    static Float:flGametimeFloat:flLastThink;
        
    flGametime get_gametime( );
        
        if( 
    flLastThink flGametime ) {
            if( 
    floatroundvector_lengthvBallVelocity ) ) > 10 ) {
                
    message_beginMSG_BROADCASTSVC_TEMPENTITY );
                
    write_byteTE_KILLBEAM );
                
    write_shortg_iBall );
                
    message_end( );
                
                
    message_beginMSG_BROADCASTSVC_TEMPENTITY );
                
    write_byteTE_BEAMFOLLOW );
                
    write_shortg_iBall );
                
    write_shortg_iTrailSprite );
                
    write_byte10 );
                
    write_byte10 );
                
    write_byte);
                
    write_byte50 );
                
    write_byte255 );
                
    write_byte200 );
                
    message_end( );
            }
            
            
    flLastThink flGametime 3.0;
        }
        
    // Trail --- <
        
        
    if( iOwner ) {
            static 
    Float:vOwnerOrigin];
            
    entity_get_vectoriOwnerEV_VEC_originvOwnerOrigin );
            
            static const 
    Float:vVelocity] = { 1.01.00.0 };
            
            if( !
    is_user_aliveiOwner ) ) {
                
    entity_set_intiEntityEV_INT_iuser1);
                
                
    vOwnerOrigin] += 5.0;
                
                
    entity_set_originiEntityvOwnerOrigin );
                
    entity_set_vectoriEntityEV_VEC_velocityvVelocity );
                
                return 
    PLUGIN_CONTINUE;
            }
            
            if( 
    iSolid != SOLID_NOT )
                
    set_peviEntitypev_solidSOLID_NOT );
            
            static 
    Float:vAngles], Float:vReturn];
            
    entity_get_vectoriOwnerEV_VEC_v_anglevAngles );
            
            
    vReturn] = ( floatcosvAngles], degrees ) * 55.0 ) + vOwnerOrigin];
            
    vReturn] = ( floatsinvAngles], degrees ) * 55.0 ) + vOwnerOrigin];
            
    vReturn] = vOwnerOrigin];
            
    vReturn] -= ( entity_get_intiOwnerEV_INT_flags ) & FL_DUCKING ) ? 10 30;
            
            
    entity_set_vectoriEntityEV_VEC_velocityvVelocity );
            
    entity_set_originiEntityvReturn );
        } else {
            if( 
    iSolid != SOLID_BBOX )
                
    set_peviEntitypev_solidSOLID_BBOX );
            
            static 
    Float:flLastVerticalOrigin;
            
            if( 
    vBallVelocity] == 0.0 ) {
                static 
    iCounts;
                
                if( 
    flLastVerticalOrigin vOrigin] ) {
                    
    iCounts++;
                    
                    if( 
    iCounts 10 ) {
                        
    iCounts 0;
                        
                        
    UpdateBall);
                    }
                } else {
                    
    iCounts 0;
                    
                    if( 
    PointContentsvOrigin ) != CONTENTS_EMPTY )
                        
    UpdateBall);
                }
                
                
    flLastVerticalOrigin vOrigin];
            }
        }
        
        return 
    PLUGIN_CONTINUE;
    }

    KickBallid ) {
        
    set_user_maxspeed(id230.0)
        static 
    Float:vOrigin];
        
    entity_get_vectorg_iBallEV_VEC_originvOrigin );
        
        if( 
    PointContentsvOrigin ) != CONTENTS_EMPTY )
            return 
    PLUGIN_HANDLED;

        new 
    Float:vVelocity];
        
    velocity_by_aimidget_pcvar_num(cDistance), vVelocity );
            
        
    set_pevg_iBallpev_solidSOLID_BBOX );
        
    entity_set_sizeg_iBallFloat:{ -15.0, -15.00.0 }, Float:{ 15.015.012.0 } );
        
    entity_set_intg_iBallEV_INT_iuser1);
        
    entity_set_vectorg_iBallEV_VEC_velocityvVelocity );
            
        return 
    PLUGIN_CONTINUE;
    }

    // BALL TOUCHES
    ////////////////////////////////////////////////////////////
    public FwdTouchPlayerBallid ) {
        if( 
    is_user_botid ) )
            return 
    PLUGIN_CONTINUE;
        
        static 
    iOwneriOwner pevBallpev_iuser1 );
        
        if( 
    iOwner == ) {
            
    entity_set_intBallEV_INT_iuser1id );
            
    set_user_maxspeed(idget_pcvar_float(cSpeed))
        }
        return 
    PLUGIN_CONTINUE;
    }

    public 
    FwdTouchWorldBallWorld ) {
        static 
    Float:vVelocity];
        
    entity_get_vectorBallEV_VEC_velocityvVelocity );
        
        if( 
    floatroundvector_lengthvVelocity ) ) > 10 ) {
            
    vVelocity] *= 0.85;
            
    vVelocity] *= 0.85;
            
    vVelocity] *= 0.85;
            
            
    entity_set_vectorBallEV_VEC_velocityvVelocity );
            
            
    emit_soundBallCHAN_ITEMBALL_BOUNCE_GROUND1.0ATTN_NORM0PITCH_NORM );
        }

        return 
    PLUGIN_CONTINUE;
    }


    // ENTITIES CREATING
    ////////////////////////////////////////////////////////////
    CreateBallidFloat:vOrigin] = { 0.00.00.0 } ) {
        if( !
    id && vOrigin] == 0.0 && vOrigin] == 0.0 && vOrigin] == 0.0 )
            return 
    0;
        
        
    g_bNeedBall true;
        
        
    g_iBall create_entity"info_target" );
        
        if( 
    is_valid_entg_iBall ) ) {
            
    entity_set_stringg_iBallEV_SZ_classnameg_szBallName );
            
    entity_set_intg_iBallEV_INT_solidSOLID_BBOX );
            
    entity_set_intg_iBallEV_INT_movetypeMOVETYPE_BOUNCE );
            
    entity_set_modelg_iBallg_szBallModel );
            
    entity_set_sizeg_iBallFloat:{ -15.0, -15.00.0 }, Float:{ 15.015.012.0 } );
            
            
    entity_set_floatg_iBallEV_FL_framerate0.0 );
            
    entity_set_intg_iBallEV_INT_sequence);
            
            
    entity_set_floatg_iBallEV_FL_nextthinkget_gametime( ) + 0.05 );
            
            
    client_printidprint_chat"* Successfully created ball!" );
            
            if( 
    id ) {
                new 
    iOrigin];
                
    get_user_originidiOrigin);
                
    IVecFVeciOriginvOrigin );
                
                
    vOrigin] += 5.0;
                
                
    entity_set_origing_iBallvOrigin );
            } else
                
    entity_set_origing_iBallvOrigin );
            
            
    g_vOrigin vOrigin;
            
            return 
    g_iBall;
        }
        
        return -
    1;

    Moze neko povecati brzinu lopte i da moze normalno da se sutira,ovako je ko da sutiram kamen od 60 kila.Ako je iko dobre volje molim vas nek uradi stv mi je potrebno,pozdrav svima
    EDIT : izvinite zbog ovoga,ali nije mogao ceo kod lopte da stane,ako vam treba jos dodavacu,unapred hvala.

  2. #2
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    Rekao bih da imas cvar za to.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  3. #3
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Jagodina
    Karma
    3

    Default

    Mozes to malo bolje objasniti? Posto ja bas se u to i ne razumem u amxmodx studio tamo da kliknem na defined pa cvars ili nesto drugo? Stv se u to ne razumem samo pitam

  4. #4
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    Ne, nego taj plugin vec ima cvar za to (podesavanje koje kucas u konzoli). Dok ne postavis kod plugina ne mogu ti reci tacan naziv.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  5. #5
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Jagodina
    Karma
    3

    Default

    #include < amxmodx >
    #include < engine >
    #include < fakemeta >
    #include < hamsandwich >
    #include < fun >

    static const BALL_BOUNCE_GROUND[ ] = "kickball/bounce.wav";
    static const g_szBallModel[ ] = "models/jailbreak/ball.mdl";
    static const g_szBallName[ ] = "ball";

    new g_iBall, g_szFile[ 128 ], g_szMapname[ 32 ], g_iButtonsMenu, g_iTrailSprite;
    new bool:g_bNeedBall, cSpeed, cDistance;
    new Float:g_vOrigin[ 3 ];

    public plugin_init( ) {
    register_plugin( "Jailbreak || Football", "1.0", "name" );

    /* Cvars */
    cSpeed = register_cvar("football_speed", "200.0");
    cDistance = register_cvar("football_distance", "520");

    /* Register Forward */
    register_forward(FM_PlayerPreThink, "PlayerPreThink", 0)

    /* Current Weapon */
    register_event("CurWeapon", "CurWeapon", "be");

    RegisterHam( Ham_ObjectCaps, "player", "FwdHamObjectCaps", 1 );
    register_logevent( "EventRoundStart", 2, "1=Round_Start" );

    register_think( g_szBallName, "FwdThinkBall" );
    register_touch( g_szBallName, "player", "FwdTouchPlayer" );

    new const szEntity[ ][ ] = {
    "worldspawn", "func_wall", "func_door", "func_door_rotating",
    "func_wall_toggle", "func_breakable", "func_pushable", "func_train",
    "func_illusionary", "func_button", "func_rot_button", "func_rotating"
    }

    for( new i; i < sizeof szEntity; i++ )
    register_touch( g_szBallName, szEntity[ i ], "FwdTouchWorld" );

    g_iButtonsMenu = menu_create( "\rBallMaker \y Menu", "HandleButtonsMenu" );

    menu_additem( g_iButtonsMenu, "\rCreate\w Ball", "1" );
    menu_additem( g_iButtonsMenu, "\rLoad\w Ball", "2" );
    menu_additem( g_iButtonsMenu, "\rDelete\r All\w Balls", "3" );
    menu_additem( g_iButtonsMenu, "\rSave", "4" );

    register_clcmd( "say /ball", "CmdButtonsMenu", ADMIN_KICK );
    register_clcmd( "say /reset", "UpdateBall" );
    }
    public PlayerPreThink(id) {
    if(!is_user_alive(id))
    return PLUGIN_CONTINUE;

    if( is_valid_ent( g_iBall ) ) {
    static iOwner; iOwner = pev( g_iBall, pev_iuser1 );
    if( iOwner != id )
    set_user_maxspeed(id, 230.0)
    }
    return PLUGIN_HANDLED;
    }
    public CurWeapon(id) {
    if(!is_user_alive(id))
    return PLUGIN_CONTINUE;
    if( is_valid_ent( g_iBall ) ) {
    static iOwner; iOwner = pev( g_iBall, pev_iuser1 );
    if( iOwner == id )
    set_user_maxspeed(id, get_pcvar_float(cSpeed))
    }
    return PLUGIN_HANDLED;
    }
    public UpdateBall( id ) {
    if( !id || get_user_flags( id ) & ADMIN_KICK ) {
    if( is_valid_ent( g_iBall ) ) {
    entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
    entity_set_origin( g_iBall, g_vOrigin );

    entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
    entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
    entity_set_int( g_iBall, EV_INT_iuser1, 0 );
    }
    }

    return PLUGIN_HANDLED;
    }

    public plugin_precache( ) {
    precache_model( g_szBallModel );
    precache_sound( BALL_BOUNCE_GROUND );

    g_iTrailSprite = precache_model( "sprites/laserbeam.spr" );

    get_mapname( g_szMapname, 31 );
    strtolower( g_szMapname );

    // File
    new szDatadir[ 64 ];
    get_localinfo( "amxx_datadir", szDatadir, charsmax( szDatadir ) );

    formatex( szDatadir, charsmax( szDatadir ), "%s", szDatadir );

    if( !dir_exists( szDatadir ) )
    mkdir( szDatadir );

    formatex( g_szFile, charsmax( g_szFile ), "%s/ball.ini", szDatadir );

    if( !file_exists( g_szFile ) ) {
    write_file( g_szFile, "// Ball Spawn Editor", -1 );
    write_file( g_szFile, " ", -1 );

    return; // We dont need to load file
    }

    new szData[ 256 ], szMap[ 32 ], szOrigin[ 3 ][ 16 ];
    new iFile = fopen( g_szFile, "rt" );

    while( !feof( iFile ) ) {
    fgets( iFile, szData, charsmax( szData ) );

    if( !szData[ 0 ] || szData[ 0 ] == ';' || szData[ 0 ] == ' ' || ( szData[ 0 ] == '/' && szData[ 1 ] == '/' ) )
    continue;

    parse( szData, szMap, 31, szOrigin[ 0 ], 15, szOrigin[ 1 ], 15, szOrigin[ 2 ], 15 );

    if( equal( szMap, g_szMapname ) ) {
    new Float:vOrigin[ 3 ];

    vOrigin[ 0 ] = str_to_float( szOrigin[ 0 ] );
    vOrigin[ 1 ] = str_to_float( szOrigin[ 1 ] );
    vOrigin[ 2 ] = str_to_float( szOrigin[ 2 ] );

    CreateBall( 0, vOrigin );

    g_vOrigin = vOrigin;

    break;
    }
    }

    fclose( iFile );
    }

    public CmdButtonsMenu( id ) {
    if( get_user_flags( id ) & ADMIN_RCON )
    menu_display( id, g_iButtonsMenu, 0 );

    return PLUGIN_HANDLED;
    }

    public HandleButtonsMenu( id, iMenu, iItem ) {
    if( iItem == MENU_EXIT )
    return PLUGIN_HANDLED;

    new szKey[ 2 ], _Access, _Callback;
    menu_item_getinfo( iMenu, iItem, _Access, szKey, 1, "", 0, _Callback );

    new iKey = str_to_num( szKey );

    switch( iKey ) {
    case 1: {
    if( pev_valid( g_iBall ) )
    return PLUGIN_CONTINUE;

    CreateBall( id );
    }
    case 2: {
    if( is_valid_ent( g_iBall ) ) {
    entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
    entity_set_origin( g_iBall, g_vOrigin );

    entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
    entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
    entity_set_int( g_iBall, EV_INT_iuser1, 0 );
    client_print( id, print_chat, "* Successfully loaded ball!" );
    }
    }
    case 3: {
    new iEntity;

    while( ( iEntity = find_ent_by_class( iEntity, g_szBallName ) ) > 0 )
    remove_entity( iEntity );
    client_print( id, print_chat, "* Successfully removed the balls!" );
    }
    case 4: {
    new iBall, iEntity, Float:vOrigin[ 3 ];

    while( ( iEntity = find_ent_by_class( iEntity, g_szBallName ) ) > 0 )
    iBall = iEntity;

    if( iBall > 0 )
    entity_get_vector( iBall, EV_VEC_origin, vOrigin );
    else
    return PLUGIN_HANDLED;

    new bool:bFound, iPos, szData[ 32 ], iFile = fopen( g_szFile, "r+" );

    if( !iFile )
    return PLUGIN_HANDLED;

    while( !feof( iFile ) ) {
    fgets( iFile, szData, 31 );
    parse( szData, szData, 31 );

    iPos++;

    if( equal( szData, g_szMapname ) ) {
    bFound = true;

    new szString[ 256 ];
    formatex( szString, 255, "%s %f %f %f", g_szMapname, vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ] );

    write_file( g_szFile, szString, iPos - 1 );

    break;
    }
    }

    if( !bFound )
    fprintf( iFile, "%s %f %f %f^n", g_szMapname, vOrigin[ 0 ], vOrigin[ 1 ], vOrigin[ 2 ] );

    fclose( iFile );

    client_print( id, print_chat, "* Successfully saved ball!" );
    }
    default: return PLUGIN_HANDLED;
    }

    menu_display( id, g_iButtonsMenu, 0 );

    return PLUGIN_HANDLED;
    }

    public EventRoundStart( ) {
    if( !g_bNeedBall )
    return;

    if( !is_valid_ent( g_iBall ) )
    CreateBall( 0, g_vOrigin );
    else {
    entity_set_vector( g_iBall, EV_VEC_velocity, Float:{ 0.0, 0.0, 0.0 } ); // To be sure ?
    entity_set_origin( g_iBall, g_vOrigin );

    entity_set_int( g_iBall, EV_INT_solid, SOLID_BBOX );
    entity_set_int( g_iBall, EV_INT_movetype, MOVETYPE_BOUNCE );
    entity_set_size( g_iBall, Float:{ -15.0, -15.0, 0.0 }, Float:{ 15.0, 15.0, 12.0 } );
    entity_set_int( g_iBall, EV_INT_iuser1, 0 );
    }
    }

    public FwdHamObjectCaps( id ) {
    if( pev_valid( g_iBall ) && is_user_alive( id ) ) {
    static iOwner; iOwner = pev( g_iBall, pev_iuser1 );

    if( iOwner == id )
    KickBall( id );
    }
    }

  6. #6
    Member Array
    Join Date
    Jan 2017
    Location
    Kragujevac
    Karma
    1

    Default

    Code:
    cSpeed = register_cvar("football_speed", "200.0");
    cDistance = register_cvar("football_distance", "520");
    U konzoli
    Code:
    amx_cvar football_speed "BROJ"    ;default ti je 200.0
    amx_cvar football_distance "BROJ"        ;default ti je 520
    Promeni cvar podesi kako ti odgovara,kada odredis koji broj hoces u configs/amxx.cfg upises nov red
    Code:
    amx_cvar football_speed "BROJ KOJI SI ODREDIO"

  7. #7
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    football_speed odredjuje brzinu igraca koji ima kod sebe loptu (ovo nema veze sa tvojim pitanjem).
    football_distance odredjuje brzinu lopte kada je igrac ispuca.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  8. #8
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Jagodina
    Karma
    3

    Default

    Hvala na pomoci,radi super! moze lock slobodno

  9. #9
    Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lk-net.com
    Karma
    26

    Default

    Tip: Ubuduce koristi [code] ili [php] tagove kada kacis kod. Ako je kod predugacak onda koristi neki servis za hostovanje koda, kao Pastebin ili GitHub Gist.
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •