AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need help to code ladder in to blockmaker (https://forums.alliedmods.net/showthread.php?t=94122)

Cyklarn 06-06-2009 15:51

Need help to code ladder in to blockmaker
 
Please i need some help with my plugin
I need the action id for climbing ladder

Thanks in advance.

infek 06-07-2009 01:50

Re: Need help to code ladder in to blockmaker
 
This would just me Trampolines Sides like BCM Right? How come u just dont make a trampoline side as a ladder.

Exolent[jNr] 06-07-2009 02:00

Re: Need help to code ladder in to blockmaker
 
I made a LadderMaker plugin if you search for it.
(Hint: Scripting Help section)

Cyklarn 06-07-2009 05:23

Re: Need help to code ladder in to blockmaker
 
Cant find it can you please tell me the action ID so i can do it in my blockmaker plugin

znovit 06-07-2009 05:28

Re: Need help to code ladder in to blockmaker
 
1 Attachment(s)
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



Cyklarn 06-07-2009 05:43

Re: Need help to code ladder in to blockmaker
 
Thanks!

znovit 06-07-2009 06:07

Re: Need help to code ladder in to blockmaker
 
Well, this one is better

--> http://forums.alliedmods.net/showpos...3&postcount=19

[X]-RayCat 06-07-2009 06:08

Re: Need help to code ladder in to blockmaker
 
Its probably best to use this. :)

znovit 06-07-2009 06:19

Re: Need help to code ladder in to blockmaker
 
I agree. :)

Cyklarn 06-07-2009 06:49

Re: Need help to code ladder in to blockmaker
 
1 Attachment(s)
But when i try to lay in it my blockmaker i get many errors :/
Where is the action id please tell me :D


All times are GMT -4. The time now is 23:35.

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