Raised This Month: $51 Target: $400
 12% 

SM Parachute Fixed


Post New Thread Reply   
 
Thread Tools Display Modes
Author
n00b32
New Member
Join Date: May 2016
Plugin ID:
5176
Plugin Version:
2.6
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    SourceMod Parachute 2.5 based plugin
    Old 05-05-2016 , 08:08   SM Parachute Fixed
    Reply With Quote #1

    SM Parachute

    Version: 2.6
    Authors: SWAT_88, n00b32

    Original version : https://forums.alliedmods.net/showthread.php?t=66452
    Commands:
    Press E(+use) to slow down your fall.
    No more binding Keys!
    Write !bp or !buy_parachute in Chat to buy a parachute (Only if cost > 0) !
    Write !sp or !sell_parachute in Chat to sell your parachute (Only if cost > 0) !
    Cvars:
    sm_parachute_enabled "1" - 0: disables the plugin - 1: enables the plugin

    sm_parachute_fallspeed "100" - speed of the fall when you use the parachute

    sm_parachute_linear "1" - 0: disables linear fallspeed -1: enables it

    sm_parachute_msgtype "1" - 0: disables Information -1: Chat -2: Panel -3: BottomCenter

    sm_parachute_cost "0" - cost of the parachute (CS ONLY) (If cost = 0 then free for everyone)

    sm_parachute_payback "75" - how many percent of the parachute cost you get when you sell your parachute (ie. 75% of 1000 = 750$)

    sm_parachute_welcome "1" - 0: disables Welcome Message -1: enables it

    sm_parachute_roundmsg "1" - 0: disables Round Message - 1: enables it

    sm_parachute_model "1" - 0: dont use the model - 1: display the Model

    sm_parachute_decrease "50" - 0: dont use Realistic velocity-decrease - x: sets the velocity-decrease.

    sm_parachute_button "1" - 1: uses button +USE for parachute usage. - 2: uses button +JUMP.
    Changes to SWAT_88's version :

    The parachute is an attached entity to the player, no need for position updates, runs completly smoothly and is attached (positioned) correctly.

    If the parachute is free the commands for buying/selling it are disabled.

    Some optimizations.
    Known quirks/bugs :

    If you look directly down while parachuting ( ) you will see the model sticking out, either need to position the model slightly to the back of the player (offset) or change the model so its smaller.
    The models animations might be broken... I have no idea why the dont work.
    Gravity is not yet handled nicely.
    The attachment point is "primary".

    I will try to incorporate all the translations/fixes into this as I go, this is a work in progress but totally usable and very nice visually.

    I tried to enable animations but either Im doing it wrong or the model's animations are broken - Im not a designer so I wont be able to fix that (at least not at the moment)


    https://github.com/n00b32/sourcemod-parachute
    WARNING The sm_parachute.smx in the repo is probably out of date, recompile it !

    Last edited by n00b32; 05-05-2016 at 08:21.
    n00b32 is offline
    n00b32
    New Member
    Join Date: May 2016
    Old 05-05-2016 , 08:11   Re: SM Parachute Fixed
    Reply With Quote #2

    The current method for creating and attaching the model (based on sm_hats among other things). animations are commented out since they dont work.
    This desperately needs a cleanup

    Code:
    		new ent =CreateEntityByName("prop_dynamic_override");
    		Parachute_Ent[client] = ent;
    		DispatchKeyValue(ent, "model", path);
        	    DispatchKeyValue(ent, "spawnflags", "4");
    		SetEntProp(ent, Prop_Data, "m_CollisionGroup", 0);
    		SetEntPropEnt(ent, Prop_Send, "m_hOwnerEntity", client);
    
    	    AcceptEntityInput(ent, "TurnOn", ent, ent, 0);
    	    AcceptEntityInput(ent, "EnableCollision");
    
    
    		SetEntityMoveType(ent, MOVETYPE_NOCLIP);
    		DispatchSpawn(ent);
    		ActivateEntity(ent);
    		
    		hasModel[client]=true;
    		//TeleportParachute(client);
    		// animations just wont work... model is f***d up !
    /*
            SDKHook(ent, SDKHook_Spawn, SpawnChute);
            SetVariantString("deploy");
            AcceptEntityInput(ent, "SetAnimation", -1, -1, 0); 
            SetVariantString("idle");
            AcceptEntityInput(ent, "SetDefaultAnimation", -1, -1, 0); 
            SetVariantFloat(1.0);
            AcceptEntityInput(ent, "SetPlaybackRate", -1, -1, 0); 
    */
    
    		TeleportEntity(ent, or, ang, NULL_VECTOR); 
    
    		SetVariantString("!activator");
    		AcceptEntityInput(ent, "SetParent", client, ent, 0);
    		
    		SetVariantString("primary");
    		AcceptEntityInput(ent, "SetParentAttachment", ent, ent, 0);
    
    		
    		DispatchKeyValueVector(ent, "angles", ang);
    		DispatchKeyValueVector(ent, "origin", or);
    
    		SetVariantString("primary");
    		AcceptEntityInput(ent, "SetParentAttachmentMaintainOffset", ent, ent, 0);

    Last edited by n00b32; 05-05-2016 at 08:12. Reason: oops
    n00b32 is offline
    zipcore
    Veteran Member
    Join Date: Mar 2010
    Location: m_flZipcore
    Old 05-05-2016 , 10:27   Re: SM Parachute Fixed
    Reply With Quote #3

    Still dirty code and there is still much potential in improving performance.

    Check this: http://pastebin.com/raw/yLmvZFsS
    __________________
    zipcore is offline
    Bonkorn
    Senior Member
    Join Date: Jul 2015
    Old 07-03-2016 , 06:54   Re: SM Parachute Fixed
    Reply With Quote #4

    Is it possible to add a flag for admins/vips to use only?
    Bonkorn is offline
    EMINEM_FB
    Senior Member
    Join Date: Dec 2010
    Location: Czech republic
    Old 12-25-2016 , 07:13   Re: SM Parachute Fixed
    Reply With Quote #5

    Do you need some Parachute skins ? Check gamebanana http://gamebanana.com/skins/cats/11622
    __________________
    EMINEM_FB is offline
    Yundaz
    Member
    Join Date: Apr 2019
    Old 04-07-2020 , 07:23   Re: SM Parachute Fixed
    Reply With Quote #6

    I cannot get this to work,

    [SM] Unable to load plugin "sm_parachute.smx": Native "BfWriteByte" was not found
    Yundaz is offline
    eliteroyal
    AlliedModders Donor
    Join Date: Dec 2016
    Location: Moldova
    Old 09-09-2020 , 08:26   Re: SM Parachute Fixed
    Reply With Quote #7

    i needs update, need this for csgo
    __________________
    PEACE FROM MOLDOVA
    eliteroyal is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 04:15.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode