Raised This Month: $ Target: $400
 0% 

How to set user can't on ladder


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wwzw
Member
Join Date: Feb 2009
Old 04-15-2012 , 13:01   How to set user can't on ladder
Reply With Quote #1

I want to block one or some player climbed the ladder, but I do not know how to do it!
Please help me, thanks!
wwzw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-15-2012 , 14:09   Re: How to set user can't on ladder
Reply With Quote #2

Hook when player touches ladder and block it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wwzw
Member
Join Date: Feb 2009
Old 04-16-2012 , 00:43   Re: How to set user can't on ladder
Reply With Quote #3

Thank you for your help, but I can not get the event of player contact with the ladder.
I tried the code:
PHP Code:
RegisterHam(Ham_Touch"player""Ham_Touch_Ladder_Pre"0);
RegisterHam(Ham_Touch"player""Ham_Touch_Ladder_Pre"1);
public 
Ham_Touch_Ladder_Pre(id,ent)
{
 if (
is_user_alive(id)) {
  new 
classname[32]
  
pev(ent,pev_classname,classname,31)
  
client_print(idprint_chat"=======Touch===Test====%s====",classname);
 }

And:
PHP Code:
register_forwardFM_Touch"fwdTouch" );
public 
fwdTouch(entid) { 
 if (
is_user_alive(id)) {
  new 
classname[32]
  
pev(ent,pev_classname,classname,31)
  
client_print(idprint_chat"=======Touch===Test====%s====",classname);
 } 

But all fails, please continue to help me!
wwzw is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 01:59   Re: How to set user can't on ladder
Reply With Quote #4

func_ladder and check if is valid ent
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-16-2012 at 02:00.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
wwzw
Member
Join Date: Feb 2009
Old 04-16-2012 , 03:09   Re: How to set user can't on ladder
Reply With Quote #5

Please tell me exactly how to do and code demonstration!


register_touch( "player", "func_ladder", "FwdTouchLadder" );
public FwdTouchLadder(id, ent)
{
client_print(0, print_chat, "=======Touch===%d====%d====",id,ent);
}

The above code does not work...

Last edited by wwzw; 04-16-2012 at 03:16.
wwzw is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 07:32   Re: How to set user can't on ladder
Reply With Quote #6

sorry; now i see this

Code:
This is an internal entity. When the map is compiled by VBSP it is processed and then removed: it does not exist when the map is running.

Quote:
Originally Posted by Exolent[jNr] View Post
If a player is on a ladder, his move type will be fly.
Code:
// at the top of your plugin #define IsOnLadder(%1) (entity_get_int(%1, EV_INT_movetype) == MOVETYPE_FLY) // in your plugin if( IsOnLadder(index) ) {     // player is on a ladder }
That code requires the engine module.
Quote:
Originally Posted by xPaw View Post
PHP Code:
#define IsOnLadder(%1) (pev(%1, pev_movetype) == MOVETYPE_FLY) 
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-16-2012 at 07:34.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
wwzw
Member
Join Date: Feb 2009
Old 04-16-2012 , 08:01   Re: How to set user can't on ladder
Reply With Quote #7

Yes, I have been tried.But my purpose is to prevent players climb the ladder.

if( IsOnLadder(index) )
{
// How can I stop or let him down?
}
wwzw is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 08:56   Re: How to set user can't on ladder
Reply With Quote #8

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

public plugin_init( ) {
    
register_plugin"Disable func_ladder""0.0.1""Exolent" );
    
    new 
iEntity;
    while( ( 
iEntity find_ent_by_class( -1"func_ladder" ) ) ) {
        
remove_entityiEntity );
    }


i found this and work xD
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-16-2012 at 08:56.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 04-16-2012 , 09:31   Re: How to set user can't on ladder
Reply With Quote #9

All that does is remove all the ladders from the map. He asked for blocking the passage, not removing them.
Backstabnoob is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-16-2012 , 10:57   Re: How to set user can't on ladder
Reply With Quote #10

Try this.

Requirements:
- Orpheu
- PM Functions pack

Code:
#include <amxmodx> #include <orpheu> #include <orpheu_stocks> new gHideLadder; #define CanSeeLadder(%1) (~gHideLadder &   (1 << (%1 & 31))) #define HideLadder(%1)     gHideLadder |=  (1 << (%1 & 31)) #define ShowLadder(%1)     gHideLadder &= ~(1 << (%1 & 31)) new OrpheuStruct:ppmove; public plugin_init() {     register_plugin("Ladder Disabler", "0.0.1", "Exolent");         register_clcmd("say /ladder", "CmdLadder");         OrpheuRegisterHook(OrpheuGetDLLFunction("pfnPM_Move", "PM_Move"), "PM_Move");     OrpheuRegisterHook(OrpheuGetFunction("PM_Ladder"), "PM_Ladder"); } public client_disconnect(id) {     ShowLadder(id); } public CmdLadder(id) {     if(CanSeeLadder(id)) {         HideLadder(id);                 client_print(id, print_chat, "* Ladders are now unusable.");     } else {         ShowLadder(id);                 client_print(id, print_chat, "* Ladders are now usable.");     } } public OrpheuHookReturn:PM_Move(OrpheuStruct:_ppmove, server) {     ppmove = _ppmove; } public OrpheuHookReturn:PM_Ladder() {     new id = OrpheuGetStructMember(ppmove, "player_index") + 1;         if(!CanSeeLadder(id)) {         OrpheuSetReturn(0);         return OrpheuOverride;     }         return OrpheuIgnored; }
__________________
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 00:21.


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