AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get PlayerIndex from entity ID? (https://forums.alliedmods.net/showthread.php?t=98300)

Hayer 07-24-2009 08:43

Get PlayerIndex from entity ID?
 
Hi!

Just found out that register_touch feeds the callfunc with two entities..
So how do I get the PlayerIndex based on the entity ID? :|

TitANious 07-24-2009 08:53

Re: Get PlayerIndex from entity ID?
 
The first is Touched and the an other is Toucher?

Hayer 07-24-2009 08:53

Re: Get PlayerIndex from entity ID?
 
Ye, but the Toucher/Touched is not a playerindex.

TitANious 07-24-2009 08:54

Re: Get PlayerIndex from entity ID?
 
A player index can be a number from 0 - 32 (0 is all, 1 is a player, 2 is a player and so..)

Hayer 07-24-2009 09:07

Re: Get PlayerIndex from entity ID?
 
Nevermind, I was using pToucher insted of pTouched!
Sorry TitANious - Your right, I'm wrong

ConnorMcLeod 07-24-2009 10:01

Re: Get PlayerIndex from entity ID?
 
Generally, and if you need to block the touch, do :

register_touch("entity_class", "player", "function")

Then :

public function(iEntity, iPlayer)
{
}

wiki about register_touch says that you have to register twice but this is false.

Arkshine 07-24-2009 11:06

Re: Get PlayerIndex from entity ID?
 
As note, to block you have to return PLUGIN_HANDLED;


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

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