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

[SDK Hooks] ZPS SM 1.6.0


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xerox8521
Senior Member
Join Date: Sep 2011
Old 09-03-2014 , 09:33   [SDK Hooks] ZPS SM 1.6.0
Reply With Quote #1

Hi,

so i tried to mess around a bit with sdkhooks in zps and it seems not everything is working such as SDKHook_UsePost and SDKHook_Use. Maybe im using it wrong ? Also what i noticed is that some entities have the same entity number shouldnt be the entity numbers unique ? I logged every entity which is created and quite a few have the same entity index (i assume it is)

PHP Code:
entity19 classnameitem_healthvial
entity
19 classnameitem_healthkit 
PHP Code:
public OnEntityCreated(entity, const String:classname[])
{
    if(
StrEqual(classname,"item_healthvial") || StrEqual(classname,"item_healthkit"))
    {
        
SDKHook(entity,SDKHook_UsePost,OnItemUse);
    }
}

public 
OnItemUse(entityactivatorcallerUseType:typeFloat:value)
{
    
PrintToChatAll("entity: %d | activator: %d | caller: %d | UseType: %d | value: %f",entity,caller,type,value);

xerox8521 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-03-2014 , 10:15   Re: [SDK Hooks] ZPS SM 1.6.0
Reply With Quote #2

Entity indexes are unique for the lifetime of an entity... but once an entity is destroyed, its entity index can be reassigned to another entity.

This is important, since Source has a hard limit of iirc 2048 entities.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-03-2014 at 10:15.
Powerlord is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 09-04-2014 , 15:26   Re: [SDK Hooks] ZPS SM 1.6.0
Reply With Quote #3

Well the entity doesnt get destroyed as in this case is a medkit and pills which get only removed once a player has used them fully.
xerox8521 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 05:05.


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