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

Need help to code ladder in to blockmaker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Cyklarn
Junior Member
Join Date: May 2008
Location: Sweden
Old 06-06-2009 , 15:51   Need help to code ladder in to blockmaker
Reply With Quote #1

Please i need some help with my plugin
I need the action id for climbing ladder

Thanks in advance.
Cyklarn is offline
Send a message via Skype™ to Cyklarn
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 06-07-2009 , 01:50   Re: Need help to code ladder in to blockmaker
Reply With Quote #2

This would just me Trampolines Sides like BCM Right? How come u just dont make a trampoline side as a ladder.
infek is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-07-2009 , 02:00   Re: Need help to code ladder in to blockmaker
Reply With Quote #3

I made a LadderMaker plugin if you search for it.
(Hint: Scripting Help section)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Cyklarn
Junior Member
Join Date: May 2008
Location: Sweden
Old 06-07-2009 , 05:23   Re: Need help to code ladder in to blockmaker
Reply With Quote #4

Cant find it can you please tell me the action ID so i can do it in my blockmaker plugin
Cyklarn is offline
Send a message via Skype™ to Cyklarn
znovit
Member
Join Date: Mar 2009
Location: Behind you :=
Old 06-07-2009 , 05:28   Re: Need help to code ladder in to blockmaker
Reply With Quote #5

Here ya go

PHP Code:
#include <amxmodx> 
#include <fakemeta_util> 

#pragma semicolon 1 

#define MODEL "models/ladder.mdl" 

// ladder dimensions 
new Float:gLadderMinY[3] = {-32.0,-4.0,-32.0}; 
new 
Float:gLadderMaxY[3] = { 32.04.032.0}; 

new 
bool:gOnLadder[33]; 

public 
plugin_init() { 
    
register_plugin("Ladder""1.0""xPaw"); 
     
    
register_clcmd("say .ladder""cmdCreateLadder"); 
    
register_clcmd("say .removeladder""cmdDeleteLadder"); 
     
    
register_forwardFM_PlayerPreThink"fwdPlayerPreThink"); 
    
register_forwardFM_Touch"fwdTouch" ); 


public 
plugin_precache() 
    
precache_modelMODEL ); 

public 
fwdPlayerPreThink(id) { 
    if ( 
is_user_alive(id)) { 
        if( 
gOnLadder[id] ) { 
            new 
Float:velocity[3]; 
            
pev(idpev_velocityvelocity); 
             
            if ( (
pev(idpev_button) & IN_FORWARD) && (velocity[0] == 0.0 || velocity[1] == 0.0) ) { 
                
velocity[2] = 250.0
                
set_pev(idpev_velocityvelocity); 
            } 
            
gOnLadder[id] = false
        } 
         
        new 
entbody
        
get_user_aiming(identbody320); 
         
        if (
isLadder(ent)) { 
            
set_hudmessage(025255, -1.0, -0.9001.01.00.20.21); 
            
show_hudmessage(id"First In-Game Ladder."); 
        } 
    } 


public 
fwdTouch(entid) { 
    if (
is_user_alive(id) && isLadder(ent)) { 
        
set_pev(idpev_movetypeMOVETYPE_FLY); 
         
        
gOnLadder[id] = true
         
        
// Velocity way 
        
new Float:velocity[3]; 
        
pev(idpev_velocityvelocity); 
         
        if ( (
pev(idpev_button) & IN_FORWARD) && (velocity[0] == 0.0 || velocity[1] == 0.0) ) { 
            
velocity[2] = 250.0
            
set_pev(idpev_velocityvelocity); 
        } 
         
    } 


public 
cmdCreateLadderid ) { 
    if (
get_user_flags(id) & ADMIN_KICK) { 
        new 
Float:vOrigin[3]; 
        new 
origin[3]; 
         
        
//get the origin of the player and add Z offset 
        
get_user_origin(idorigin3); 
        
IVecFVec(originvOrigin); 
        
vOrigin[2] += 4.0
         
        
createLaddervOrigin ); 
        
client_print(idprint_chat"* You Spawned Ladder, Have Fun! :-)"); 
    } 


public 
cmdDeleteLadder(id) { 
    if (
get_user_flags(id) & ADMIN_KICK) { 
        new 
entbody
        
get_user_aiming(identbody); 
         
        if (
isLadder(ent)) { 
            
fm_remove_entity(ent); 
            
client_print(idprint_chat"* You Removed Ladder."); 
        } 
    } 


createLadderFloat:vOrigin[3] ) { 
    new 
ent fm_create_entity"info_target" ); 
     
    if (
fm_is_valid_ent(ent)) { 
        
set_pev(entpev_classname"xpaw_ladder"); 
        
set_pev(entpev_solidSOLID_BBOX); 
        
set_pev(entpev_movetypeMOVETYPE_NONE); 
         
        new 
Float:vSizeMin[3]; 
        new 
Float:vSizeMax[3]; 
        new 
Float:vAngles[3]; 

        
vSizeMin gLadderMinY
        
vSizeMax gLadderMaxY
        
vAngles[0] = 90.0
        
vAngles[2] = 90.0
         
        
//adjust size min/max vectors depending on scale 
        
for (new 03; ++i) { 
            if (
vSizeMin[i] != 4.0 && vSizeMin[i] != -4.0
                
vSizeMin[i] *= 1.0
             
            if (
vSizeMax[i] != 4.0 && vSizeMax[i] != -4.0
                
vSizeMax[i] *= 1.0
        } 
         
        
fm_entity_set_model(entMODEL); 
        
set_pev(entpev_anglesvAngles); 
        
fm_entity_set_size(entvSizeMinvSizeMax); 
        
fm_entity_set_origin(entvOrigin); 
         
        return 
ent
    } 
     
    return 
0


bool:isLadder(ent) { 
    if (
fm_is_valid_ent(ent)) { 
        new 
szClassname[32]; 
        
pev(entpev_classnameszClassname32); 
         
        if (
equal(szClassname"xpaw_ladder")) 
            return 
true
    } 
    return 
false

Attached Files
File Type: zip ladder_model.zip (1.6 KB, 195 views)
__________________
znovit is offline
Cyklarn
Junior Member
Join Date: May 2008
Location: Sweden
Old 06-07-2009 , 05:43   Re: Need help to code ladder in to blockmaker
Reply With Quote #6

Thanks!
Cyklarn is offline
Send a message via Skype™ to Cyklarn
znovit
Member
Join Date: Mar 2009
Location: Behind you :=
Old 06-07-2009 , 06:07   Re: Need help to code ladder in to blockmaker
Reply With Quote #7

Well, this one is better

--> http://forums.alliedmods.net/showpos...3&postcount=19
__________________
znovit is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 06-07-2009 , 06:08   Re: Need help to code ladder in to blockmaker
Reply With Quote #8

Its probably best to use this.
__________________
[X]-RayCat is offline
znovit
Member
Join Date: Mar 2009
Location: Behind you :=
Old 06-07-2009 , 06:19   Re: Need help to code ladder in to blockmaker
Reply With Quote #9

I agree.
__________________
znovit is offline
Cyklarn
Junior Member
Join Date: May 2008
Location: Sweden
Old 06-07-2009 , 06:49   Re: Need help to code ladder in to blockmaker
Reply With Quote #10

But when i try to lay in it my blockmaker i get many errors :/
Where is the action id please tell me
Attached Files
File Type: sma Get Plugin or Get Source (laddermaker.sma - 685 views - 15.8 KB)

Last edited by Cyklarn; 06-07-2009 at 07:34.
Cyklarn is offline
Send a message via Skype™ to Cyklarn
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 06:52.


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