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

(KREEDZ) Make CP on ladder


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 01:10   (KREEDZ) Make CP on ladder
Reply With Quote #1

How a player can create a checkpoint on ladder?
I have this code, but when you try create CP on a ladder it's says "You can't make a checkpoint in the air" That's because of " FL_ONGROUND2 "

PHP Code:
public CheckPoint(id)
{
    if(
get_pcvar_num(kz_checkpoints) == 1)
    {

        if( !
is_user_aliveid ) )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You must be alive to use this command.")
                case 
2kz_hud_message(id"You must be alive to use this command")
            }
            return 
PLUGIN_HANDLED
        
}

        if( !( 
pevidpev_flags ) & FL_ONGROUND2 ) )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in the air.")
                case 
2kz_hud_message(id"You can't make a checkpoint in the air")
            }
            return 
PLUGIN_HANDLED
        
}
        
        if( 
IsPaused[id] )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in pause.")
                case 
2kz_hud_message(id"You can't make a checkpoint in pause")
            }
            return 
PLUGIN_HANDLED
        
}
        
        
pev(idpev_originCheckpoints[id][g_bCpAlternate[id] ? 0])
        
g_bCpAlternate[id] = !g_bCpAlternate[id]
        
checknumbers[id]++

        switch (
get_pcvar_num(kz_chatorhud))
        {
            case 
1ColorChat(idGREEN"^1Checkpoint ^3#%d ^1created",checknumbers[id])
            case 
2kz_hud_message(id"Checkpoint #%d",checknumbers[id])
        }
    }
    else
    {
        switch (
get_pcvar_num(kz_chatorhud))
        {
            case 
1ColorChat(idGREEN"Checkpoints are off.")
            case 
2kz_hud_message(id"Checkpoints are off")
        }
    }
    return 
PLUGIN_HANDLED


Last edited by bazhenov93; 04-16-2012 at 01:10.
bazhenov93 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 01:55   Re: (KREEDZ) Make CP on ladder
Reply With Quote #2

check if touch a ladder entity ( func_ladder )

--------------------------

chequea si esta tocando la entidad func_ladder
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 03:43   Re: (KREEDZ) Make CP on ladder
Reply With Quote #3

Yes, very good explained.... tut with func_ladder?
I searched and founded nothing=S
bazhenov93 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 07:32   Re: (KREEDZ) Make CP on ladder
Reply With Quote #4

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:35.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 08:08   Re: (KREEDZ) Make CP on ladder
Reply With Quote #5

So something like this, mmm?

PHP Code:
if( !( pevidpev_flags ) & FL_ONGROUND2 ) )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in the air.")
                case 
2kz_hud_message(id"You can't make a checkpoint in the air")
            }
            if (
pev(%1pev_movetype) == MOVETYPE_FLY)  
          {
            switch (
get_pcvar_num(kz_chatorhud))
        {
            case 
1ColorChat(idGREEN"^1Checkpoint ^3#%d ^1created",checknumbers[id])
            case 
2kz_hud_message(id"Checkpoint #%d",checknumbers[id])
        }

bazhenov93 is offline
Blue Snake.
Member
Join Date: May 2011
Location: Romania
Old 04-16-2012 , 08:45   Re: (KREEDZ) Make CP on ladder
Reply With Quote #6

A player is on the ground if his vertical speed is 0. So, you can cp on the ladder and maybe in water [no checked]
Blue Snake. is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 09:13   Re: (KREEDZ) Make CP on ladder
Reply With Quote #7

I can't compile, the code is not good
bazhenov93 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 09:17   Re: (KREEDZ) Make CP on ladder
Reply With Quote #8

becase you don't read tutorials
PHP Code:
if( !( pevidpev_flags ) & FL_ONGROUND2 ) && !IsOnLadder(id)) 
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 04-16-2012 at 11:21.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 04-16-2012 , 09:26   Re: (KREEDZ) Make CP on ladder
Reply With Quote #9

PHP Code:
public CheckPoint(id)
{
    if(
get_pcvar_num(kz_checkpoints) == 1)
    {

        if( !
is_user_aliveid ) )
        {
            {
                
ColorChat(idBLUE"You must be alive to use this command")
            }
            return 
PLUGIN_HANDLED
        
}

        if( !( 
pevidpev_flags ) & FL_ONGROUND2 ) )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in the air")
                case 
2kz_hud_message(id"You can't make a checkpoint in the air")
            }
            return 
PLUGIN_HANDLED
        
}
        
        
        if( 
IsPaused[id] )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in pause")
                case 
2kz_hud_message(id"You can't make a checkpoint in pause")
            }
            return 
PLUGIN_HANDLED
        
}
        
        
pev(idpev_originCheckpoints[id][g_bCpAlternate[id] ? 0])
        
g_bCpAlternate[id] = !g_bCpAlternate[id]
        
checknumbers[id]++, IsOnLadder(id// allow cp on ladder

        
switch (get_pcvar_num(kz_chatorhud))
        {
            case 
1ColorChat(idRED"^1Checkpoint ^4#%d",checknumbers[id])
            case 
2kz_hud_message(id"Checkpoint #%d",checknumbers[id])
        }
        
    }
    else
    {
        {
            
kz_hud_message(id"Checkpoints are off")
        }
    }
    return 
PLUGIN_HANDLED

bazhenov93 is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-16-2012 , 09:33   Re: (KREEDZ) Make CP on ladder
Reply With Quote #10

IsOnLadder(id) // allow cp on ladder

are you kidding me?

PHP Code:
public CheckPoint(id)
{
    if(
get_pcvar_num(kz_checkpoints) == 1)
    {
        
        if( !
is_user_aliveid ) )
        {
            
ColorChat(idBLUE"You must be alive to use this command")
            return 
PLUGIN_HANDLED
        
}
        
        if( !( 
pevidpev_flags ) & FL_ONGROUND2 ) && !IsOnLadder(id))
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in the air")
                case 
2kz_hud_message(id"You can't make a checkpoint in the air")
            }
            return 
PLUGIN_HANDLED
        
}
        
        
        if( 
IsPaused[id] )
        {
            switch (
get_pcvar_num(kz_chatorhud))
            {
                case 
1ColorChat(idGREEN"You can't make a checkpoint in pause")
                case 
2kz_hud_message(id"You can't make a checkpoint in pause")
            }
            return 
PLUGIN_HANDLED
        
}
        
        
pev(idpev_originCheckpoints[id][g_bCpAlternate[id] ? 0])
        
g_bCpAlternate[id] = !g_bCpAlternate[id]
        
checknumbers[id]++, 
        
        switch (
get_pcvar_num(kz_chatorhud))
        {
            case 
1ColorChat(idRED"^1Checkpoint ^4#%d",checknumbers[id])
            case 
2kz_hud_message(id"Checkpoint #%d",checknumbers[id])
        }
        
    }
    else
    {
    
        
kz_hud_message(id"Checkpoints are off")
    }

    return 
PLUGIN_HANDLED

__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
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 13:14.


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