Raised This Month: $ Target: $400
 0% 

Check if player was on a ladder


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-23-2009 , 20:52   Check if player was on a ladder
Reply With Quote #1

I know this may sound stupid, but is it possible to get the info of a player that is ON a ladder, while he touches someone?

Lets say, Player1 is on the ladder, AFK or something. And Player2 jumps to the ladder, but instead of landing on the ladder, he lands on Player1 and dies.

Is it possible to get the info of the Player1, that is still on the ladder?

I've thought about looking in a no boost plugin, but I don't have the time to look for anything right now, as I am busy with another plugin, which is causing trouble. I went a little bit offtopic, but anyway IF the thing I explained earlier is possible, then please show me an example.

I'm off to bed now, 3 am here.

Thanks in advance.
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-23-2009 , 23:21   Re: Check if player was on a ladder
Reply With Quote #2

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.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-24-2009 , 04:45   Re: Check if player was on a ladder
Reply With Quote #3

I know how to check if the player is on a ladder.

Could I just use a deathevent for checking if Player2 died?, while Player1 is still on the ladder, alive.

EDIT:
Also, can't I use fakemeta instead, "pev(id, pev_movetype, MOVETYPE_FLY)"?
__________________
Achievements API - a simple way for you to create your OWN custom achievements!

Last edited by Xellath; 05-24-2009 at 04:47.
Xellath is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-24-2009 , 13:00   Re: Check if player was on a ladder
Reply With Quote #4

Quote:
Originally Posted by Xellath View Post
I know how to check if the player is on a ladder.

Could I just use a deathevent for checking if Player2 died?, while Player1 is still on the ladder, alive.
It's really not that hard.
Register the DeathMsg event or hook Ham_Player_Killed, and check if the killer is on the ladder.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Xellath
Veteran Member
Join Date: Dec 2007
Location: Sweden
Old 05-24-2009 , 15:00   Re: Check if player was on a ladder
Reply With Quote #5

I figured it out a while ago, but thanks!
__________________
Achievements API - a simple way for you to create your OWN custom achievements!
Xellath is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-24-2009 , 05:06   Re: Check if player was on a ladder
Reply With Quote #6

PHP Code:
#define IsOnLadder(%1) (pev(%1, pev_movetype) == MOVETYPE_FLY) 
__________________
xPaw 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 01:26.


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