Raised This Month: $ Target: $400
 0% 

Multijump


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-06-2009 , 07:08   Re: Multijump
Reply With Quote #1

Explain why it can be more simple ? I mean you ask the most simple way and you are able to say if such way is simple or not... So I guess you have some knowledge to explain why you think there is a better way than playing with player's velocity.
Arkshine is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 07:12   Re: Multijump
Reply With Quote #2

@Arkshine: I just think

@hleV: What does g_(n) mean?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 04-06-2009 , 07:53   Re: Multijump
Reply With Quote #3

Quote:
Originally Posted by TitANious View Post
@Arkshine: I just think

@hleV: What does g_(n) mean?
Global <type>. In this case - global pointer. It's just a matter of coding style though.
__________________
hleV is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 08:08   Re: Multijump
Reply With Quote #4

I want to delete the admin only

Here is when i had deleted:

PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define FLAG_ADMIN ADMIN_LEVEL_A
 
new g_iJumpCount[33], bool:g_bJumped[33];
new 
g_pMaxJumps;
 
public 
plugin_init()
{
        
register_plugin("Multi Jump""1.2""twistedeuphoria (port to FM by hleV)");
        
g_pMaxJumps register_cvar("mj_maxjumps""1"); // 1 normal jump + amount in CVAR
        
register_forward(FM_PlayerPreThink"fwPreThink");
        
register_forward(FM_PlayerPostThink"fwPostThink");
}
 
public 
client_disconnect(iCl)
{
        
g_iJumpCount[iCl] = 0;
        
g_bJumped[iCl] = false;
}
 
public 
fwPreThink(iCl)
{
        if (!
is_user_alive(iCl) || (get_pcvar_num (get_user_flags(iCl) & FLAG_ADMIN)))
                return;
 
        static 
iButtoniOldButtoniFlags;
        
iButton pev(iClpev_button);
        
iOldButton pev(iClpev_oldbuttons);
        
iFlags pev(iClpev_flags);
 
        if ((
iButton IN_JUMP) && !(iFlags FL_ONGROUND) && !(iOldButton IN_JUMP))
                if (
g_iJumpCount[iCl] < get_pcvar_num(g_pMaxJumps))
                {
                        
g_iJumpCount[iCl]++;
                        
g_bJumped[iCl] = true;
                        return;
                }
 
        if ((
iButton IN_JUMP) && (iFlags FL_ONGROUND))
                
g_iJumpCount[iCl] = 0;
}
 
public 
fwPostThink(iCl)
{
        if (!
is_user_alive(iCl) || (get_pcvar_num (get_user_flags(iCl) & FLAG_ADMIN)))
                return;
 
        if (
g_bJumped[iCl])
        {
                static 
Float:fVel[3];
                
pev(iClpev_velocityfVel);
                
fVel[2] = random_float(265.0285.0); // IMO it should be lesser
                
set_pev(iClpev_velocityfVel);
                
g_bJumped[iCl] = false;
        }

__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-06-2009 , 08:25   Re: Multijump
Reply With Quote #5

Ok, are you trying to say it didn't work?

Admin only was turned off by default. I don't see a good reason to remove it from the code.
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 08:40   Re: Multijump
Reply With Quote #6

Well i dont want to do it bigger, if no reason to Its look better
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-06-2009 , 16:32   Re: Multijump
Reply With Quote #7

Quote:
Originally Posted by arkshine View Post
Explain why it can be more simple ? I mean you ask the most simple way and you are able to say if such way is simple or not... So I guess you have some knowledge to explain why you think there is a better way than playing with player's velocity.
Code:
set_pev(client, pev_oldbuttons, pev(client, pev_oldbuttons) & ~IN_JUMP); ExecuteHamB(Ham_Player_Jump, client);

Would this work if player is not on the ground?
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-06-2009 , 16:39   Re: Multijump
Reply With Quote #8

Ham looks like to be quite simple Oo
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 04-07-2009 , 06:35   Re: Multijump
Reply With Quote #9

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd "say mj" ,     "cmdMultiJump" )
    
register_clcmd "team_say mj",    "cmdMultiJump" )
}
    Public 
cmdMultiJumpid ) {
set_pev(clientpev_oldbuttonspev(clientpev_oldbuttons) & ~IN_JUMP);
ExecuteHamB(Ham_Player_Jumpclient);

It shouln't just be like this? If yes it cant compile
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.

Last edited by TitANious; 04-07-2009 at 06:39.
TitANious is offline
Send a message via MSN to TitANious
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-07-2009 , 07:09   Re: Multijump
Reply With Quote #10

No, you made it all wrong.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 02:27.


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