Raised This Month: $ Target: $400
 0% 

[SOLVED][HAMSANDWICH] Failed to retrieve classtype...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-10-2009 , 09:56   [SOLVED][HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #1

I wanted to make a plugin that made it harder to camp at/on the church in dod_avalanche (yes i play DoD ;)). First i created a zone where u cant prone, but i get and error while detecting the classname of the new ent name with Ham...

PHP Code:
[HAMSANDWICHFailed to retrieve classtype for "no_prone"hook for "FwdTouch" not active
So it doesnt detect the entity.. Any idea how to solve this?


PHP Code:
#include <amxmisc>
#include <amxmodx>
#include <dodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "No Church Campers"
#define VERSION "1.0 by Dr.G - www.clan-go.net"
#define AUTHOR "Dr.G"
new p_enable
public plugin_init()
{
 new 
check_map[32]
 
get_mapname(check_map,31)
 if(
equali(check_map,"dod_avalanche"))
 {
  
Zone1()
  
//Zone2()
 
 
}
 
register_plugin("no_church_campers",VERSIONAUTHOR)
 
register_cvar("no_church_campers"VERSIONFCVAR_SERVER|FCVAR_SPONLY)
 
//For testing
 //RegisterHam(Ham_Touch, "dod_capture_area", "FwdTouch",0) this IS tested and it worked perfect!
 
RegisterHam(Ham_Touch"no_prone""FwdTouch",0)
 
p_enable register_cvar("no_church_campers","1"// Plugin On | Off
 
}
public 
FwdTouch(entityclient)
{
 if(
get_pcvar_num(p_enable) && is_user_connected(client) && is_user_alive(client))
 
 
dod_set_pronestate(client0);
 
//For testing
 //client_print(client,print_chat,"You Can't Prone Here! You Damn Camper!")
 
 
return HAM_IGNORED
}
// stock for dod_noprone by Tatsu, thanks!
stock dod_set_pronestate(clientflag
{
 
set_pev(clientpev_iuser3flag );
}
public 
Zone1() // enter to church
{
 
 new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))
 
//STOP if we cant create the ent... safety
 
if(!ent)
  return 
PLUGIN_HANDLED 
 
 set_pev
(entpev_targetname"no_prone"
 
dllfunc(DLLFunc_Spawnent)
 
 new 
Float:origin[3] = { -547.0, -260.0, -188.0 //center box?
 
set_pev(entpev_originorigin)
 
 
set_pev(entpev_movetypeMOVETYPE_STEP////stay on the ground? 
 
set_pev(entpev_solidSOLID_NOT// TRIGGER?
 
 //new Float:g_fMaxs[3] = { -471.0 , -287.0 , -156.0 }
 //new Float:g_fMins[3] = { 0.0 , 0.0 , 100.0 }
 
new Float:g_fMaxs[3] = { -687.0, -303.0, -187.0 }
 new 
Float:g_fMins[3] = { -261.0 , -207.0 13.0 }
 
 
engfunc(EngFunc_SetSizeentg_fMaxsg_fMins)
 
 return 
PLUGIN_HANDLED
}
/*
public Zone2() // top of church
{
 //mortar field
 new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
 //STOP if we cant create the ent... safety
 if(!ent)
  return PLUGIN_HANDLED 
 
 set_pev(ent, pev_targetname, "no_prone") 
 dllfunc(DLLFunc_Spawn, ent)
 
 new Float:origin[3] = { -425.0, -17.5, 356.0 } //center box?
 set_pev(ent, pev_origin, origin)
 
 set_pev(ent, pev_movetype, MOVETYPE_FLY)
 set_pev(ent, pev_solid, SOLID_NOT) // TRIGGER?
 
 new Float:g_fMaxs[3] = { -495.0 , 191.0 , 311.0 } // oy oy
 new Float:g_fMins[3] = { -328.0 , -159.0 , 215.0 }
 
 engfunc(EngFunc_SetSize, ent, g_fMaxs, g_fMins)
 
 return PLUGIN_HANDLED
}
*/ 
__________________

Last edited by Dr.G; 01-12-2009 at 19:25.
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-10-2009 , 10:00   Re: [HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #2

You can only register ham forwards with default game entities classnames.
Either you let your entity as info_target and you set something that let you recognize it as pev_message : no_prone, either you use fakemeta instead.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 01-10-2009 , 10:45   Re: [HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
You can only register ham forwards with default game entities classnames.
Either you let your entity as info_target and you set something that let you recognize it as pev_message : no_prone, either you use fakemeta instead.
Also, you can use RegisterHamFromEntity, but be careful, if will register the hook for ALL ENTS with the same class as yours, so don't forget to filter it.
__________________

Community / No support through PM
danielkza is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-10-2009 , 11:25   Re: [HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #4

Thanks, no error with FM, but i still have a problem hooking to the entity i created.. Ive made another entity with another plugin and that works, but i cant catch the touch on that either... Ideas?
__________________
Dr.G is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-10-2009 , 11:27   Re: [HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #5

SOLID_NOT doesn't work, use SOLID_TRIGGER instead

Quote:
Originally Posted by hlsdk_const.inc
// pev(entity, pev_solid) values
// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves
// SOLID only effects OTHER entities colliding with this one when they move - UGH!
#define SOLID_NOT 0 // No interaction with other objects
#define SOLID_TRIGGER 1 // Touch on edge, but not blocking
#define SOLID_BBOX 2 // Touch on edge, block
#define SOLID_SLIDEBOX 3 // Touch on edge, but not an onground
#define SOLID_BSP 4 // BSP clip, touch on edge, block
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 01-11-2009 , 19:18   Re: [HAMSANDWICH] Failed to retrieve classtype...
Reply With Quote #6

It works! Thank you!
__________________
Dr.G 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 09:16.


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