Raised This Month: $ Target: $400
 0% 

[HELP] MultiJump (from amx to smx)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jenzz
Junior Member
Join Date: Mar 2007
Old 11-02-2008 , 10:47   [HELP] MultiJump (from amx to smx)
Reply With Quote #1

Hi i will staty my question directly... Is it possible or hard to make this a sourcemod plugin instead of amx?

Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define ADMINACCESS ADMIN_CHAT

new jumpnum[33] = 0
new bool:dojump[33] = false

public plugin_init()
{
    register_plugin("MultiJump","1.1","twistedeuphoria")
    register_cvar("amx_maxjumps","1")
    register_cvar("amx_mjadminonly","0")
}

public client_putinserver(id)
{
    jumpnum[id] = 0
    dojump[id] = false
}

public client_disconnect(id)
{
    jumpnum[id] = 0
    dojump[id] = false
}

public client_PreThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE
    if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    new nbut = get_user_button(id)
    new obut = get_user_oldbutton(id)
    if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
    {
        if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
        {
            dojump[id] = true
            jumpnum[id]++
            return PLUGIN_CONTINUE
        }
    }
    if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        jumpnum[id] = 0
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
    if(!is_user_alive(id)) return PLUGIN_CONTINUE
    if(get_cvar_num("amx_mjadminonly") && (!access(id,ADMINACCESS))) return PLUGIN_CONTINUE
    if(dojump[id] == true)
    {
        new Float:velocity[3]    
        entity_get_vector(id,EV_VEC_velocity,velocity)
        velocity[2] = random_float(265.0,285.0)
        entity_set_vector(id,EV_VEC_velocity,velocity)
        dojump[id] = false
        return PLUGIN_CONTINUE
    }
    return PLUGIN_CONTINUE
}
Original thread: http://forums.alliedmods.net/showthread.php?t=10159

Do you think i should request this in the request section or try to make it myself?
I would really like to learn somthing at the same time as i want this one to work for sourcemod.
I dont know much of amx or smx programming so all help would be appreciated.
__________________
Jenzz is offline
Send a message via MSN to Jenzz Send a message via Skype™ to Jenzz
SAMURAI16
BANNED
Join Date: Sep 2006
Old 11-02-2008 , 11:40   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #2

untill CS:S isn't ported on OrangeBox, it's impossible to make this plugin.
m_nOldButtons has been disabled in ep 1
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-02-2008 , 12:07   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #3

Why not replicate m_nOldButtons then? Just store the value and check it against the current.
bl4nk is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 11-02-2008 , 12:09   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #4

Easily doable, but Prethink/Postthink arent available without an SDKCall or an Extention.
CrimsonGT is offline
Jenzz
Junior Member
Join Date: Mar 2007
Old 11-02-2008 , 15:03   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #5

Ow i see a important command is ported in css which makes this one work...
But is it not possible making this a command like with +jetpack and just fake a jump.
The important thing is that it should look like ur jumping and we can still call it MultiJump.
Does that sounds correct?
__________________
Jenzz is offline
Send a message via MSN to Jenzz Send a message via Skype™ to Jenzz
decadentx
Junior Member
Join Date: Jun 2009
Old 06-27-2010 , 23:36   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #6

Would this plugin now be possible thanks to the css update?
decadentx is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 06-28-2010 , 08:00   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #7

Quote:
Originally Posted by decadentx View Post
Would this plugin now be possible thanks to the css update?
It was never impossible. Here's something to get started:

PHP Code:
#include <sourcemod>
#include <sdktools>

new g_iOldButtons[MAXPLAYERS 1];
new 
g_iOffs_hGroundEntity = -1;

public 
OnPluginStart() {
    
g_iOffs_hGroundEntity FindSendPropInfo("CBasePlayer","m_hGroundEntity");
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon) {
    if(
buttons IN_JUMP && !(g_iOldButtons[client] & IN_JUMP) && IsPlayerAlive(client) && GetEntDataEnt2(client,g_iOffs_hGroundEntity) == -1) {
        
SetEntDataEnt2(client,g_iOffs_hGroundEntity,0);
        
PrintToChat(client,"[Multijump] Yay!");
    }

    
g_iOldButtons[client] = buttons;
    return 
Plugin_Continue;

Instead of faking the jumps it tells the engine the player is able to jump. Tested on CS:S, no side effects noticed.

By the way it would probably be a good idea to create a new thread, since this has been dead for ages...
__________________
plop

Last edited by p3tsin; 06-28-2010 at 08:03.
p3tsin is offline
decadentx
Junior Member
Join Date: Jun 2009
Old 06-28-2010 , 10:50   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #8

Nice, and yes indeed. However I've seen at least a few other threads asking for a conversion of this with no replies. Shame since this is such a sweet plugin.
decadentx is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-21-2010 , 14:30   Re: [HELP] MultiJump (from amx to smx)
Reply With Quote #9

Sorry to bump, but I have seen something similar. I would use this method...

http://forums.alliedmods.net/showthread.php?p=1256123
Silvers 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 15:26.


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