AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [ H3LP ] Wall climb problem? (https://forums.alliedmods.net/showthread.php?t=296563)

CrazY. 04-24-2017 06:24

[ H3LP ] Wall climb problem?
 
1 Attachment(s)
Hey, I've developed a wall climb with wallhang, its work but with some problems. To move to right/left, the player need move the camera. I've tryed force to move the camera angle, but not got success. Anyone can help me?

Natsheh 04-25-2017 06:31

Re: [ H3LP ] Wall climb problem?
 
Your code is buggy player can move/climb in air

CrazY. 04-25-2017 09:39

Re: [ H3LP ] Wall climb problem?
 
LoL, I think I need check the distance of wall haha

Houssam Benmouna 04-25-2017 13:25

Re: [ H3LP ] Wall climb problem?
 
Nice Plugin, I'm not a coder :) and I don't understand that, your plugin is cool for me :3 and it's hard to make like it for me

CrazY. 04-25-2017 13:58

Re: [ H3LP ] Wall climb problem?
 
O.o what the hell? Haha

This a scripting forum bro, don't plugin sharing :no:

And, worked with you without problems ???

OciXCrom 04-25-2017 14:47

Re: [ H3LP ] Wall climb problem?
 
Take a look at my alien wallclimb class:

PHP Code:

#include <amxmodx>
#include <colorchat>
#include <fakemeta>
#include <fakemeta_util>
#include <FurienClasses>
#include <fun>
#include <hamsandwich>

#define PLUGIN_VERSION "1.0"

new const g_szPrefix[] = "^1[^4iPlay Furien^1]"
new bool:g_blClass[33]
new 
Float:g_flWallOrigin[33][3]
new 
g_iClass

#define CLASS_NAME "Martian"
#define CLASS_DESC "\y[\rHP- | G- | NP | WallClimb\y]"
#define CLASS_MODEL "iplay_martian"
#define CLASS_KNIFE "models/iplay_furien/v_martian.mdl"
#define CLASS_TYPE "VIP"
#define CLASS_HEALTH 120
#define CLASS_SPEED 750.0
#define CLASS_GRAVITY 0.5
#define CLASS_INVIS true
#define CLASS_PARA false

#define WALL_DISTANCE 25.0
#define WALL_SPEED 160

public plugin_init()
{
    
register_plugin("Furien Class: Martian"PLUGIN_VERSION"OciXCrom")
    
RegisterHam(Ham_Spawn"player""eventPlayerSpawn"1)
    
register_forward(FM_Touch"fwdTouchWorld")
    
register_forward(FM_PlayerPreThink"fwdPreThink")
}

public 
plugin_precache()
    
g_iClass RegisterAlienClass(CLASS_NAMECLASS_DESCCLASS_MODELCLASS_KNIFECLASS_TYPECLASS_HEALTHCLASS_SPEEDCLASS_GRAVITYCLASS_INVISCLASS_PARA)

public 
eventPlayerSpawn(id)
{
    if(
is_class(id))
    {
        
ColorChat(idTEAM_COLOR"%s Your Alien Class is ^4%s^1. You have decreased health and gravity."g_szPrefixCLASS_NAME)
        
ColorChat(idTEAM_COLOR"%s Press E + W/A/S/D to climb walls. You're invisible when attached to a wall and not moving. You have no parachute."g_szPrefix)
        
g_blClass[id] = true
    
}
    else 
g_blClass[id] = false
}

public 
fwdTouchWorld(idworld)
{
    if(!
is_user_alive(id) || !g_blClass[id])
        return 
FMRES_IGNORED
        
    pev
(idpev_origing_flWallOrigin[id])
    return 
FMRES_IGNORED
}

public 
fwdPreThink(id
{
    if(!
g_blClass[id]) 
        return 
FMRES_IGNORED
    
    
new iButton fm_get_user_button(id)
    
    if(
iButton IN_USE)
        
wallclimb(idiButton)

    return 
FMRES_IGNORED
}

public 
wallclimb(idiButton)
{
    if(!
g_blClass[id])
        return 
FMRES_IGNORED
        
    
static Float:flOrigin[3]
    
pev(idpev_originflOrigin)

    if(
get_distance_f(flOriging_flWallOrigin[id]) > WALL_DISTANCE)
        return 
FMRES_IGNORED
    
    
if(fm_get_entity_flags(id) & FL_ONGROUND)
        return 
FMRES_IGNORED
        
    
new bool:blInvis true
    
static Float:flVelocity[3]
    
    if(
iButton IN_FORWARD)
    {
        
velocity_by_aim(idWALL_SPEEDflVelocity)
        
blInvis false
    
}
    else if(
iButton IN_BACK)
    {
        
velocity_by_aim(idWALL_SPEED * -1flVelocity)
        
blInvis false
    
}
    else
        
velocity_by_aim(id, -1flVelocity)
        
    if(
iButton IN_MOVELEFT || iButton IN_MOVERIGHT)
        
blInvis false
        
    
if(blInvis)
        
set_user_rendering(idkRenderFxNone000kRenderTransAlpha0)
    
    
fm_set_user_velocity(idflVelocity)
    return 
FMRES_IGNORED
}

bool:is_class(id)
    return (
get_user_team(id) == && FurienGetAlienClass(id) == g_iClass) ? true false 


hornet 04-25-2017 16:44

Re: [ H3LP ] Wall climb problem?
 
Both plugins would benefit from hooking the use key (by means of sound or perhaps objectcaps), registering/enabling your pre/post think forward, then unregistering/disabling when you release the key (check for release in think forward).
OciXCrom also this way you wouldn't need a cpu expensive forward like FM_TOUCH.

CrazY. 04-25-2017 18:18

Re: [ H3LP ] Wall climb problem?
 
@OciXCrom, I don't think that I will extract much things from your plugin because you're using velocity_by_aim.

@hornet, good suggestion, thanks!

Natsheh 04-30-2017 06:51

Re: [ H3LP ] Wall climb problem?
 
Ithink hooking fm cmd start is better than player prethink


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

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