AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if player was on a ladder (https://forums.alliedmods.net/showthread.php?t=93065)

Xellath 05-23-2009 20:52

Check if player was on a ladder
 
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.

Exolent[jNr] 05-23-2009 23:21

Re: Check if player was on a ladder
 
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.

Xellath 05-24-2009 04:45

Re: Check if player was on a ladder
 
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)"?

xPaw 05-24-2009 05:06

Re: Check if player was on a ladder
 
PHP Code:

#define IsOnLadder(%1) (pev(%1, pev_movetype) == MOVETYPE_FLY) 


Exolent[jNr] 05-24-2009 13:00

Re: Check if player was on a ladder
 
Quote:

Originally Posted by Xellath (Post 833524)
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.

Xellath 05-24-2009 15:00

Re: Check if player was on a ladder
 
I figured it out a while ago, but thanks! :)


All times are GMT -4. The time now is 01:26.

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