View Single Post
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-25-2010 , 18:12   Re: Common Issues and Examples/Solutions
Reply With Quote #4

Nice job! here two things... add it if you like.

How to remove properly the BuyZones in the map:

Code:
#include <amxmodx> #include <fakemeta> public plugin_precache() {     register_plugin("How", "are", "you?");     // If i am not wrong, this must be made in plugin_precache( )         new iEnt;         iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_map_parameters") );     SetKeyValue(iEnt, "buying", "3", "info_map_parameters");     dllfunc(DLLFunc_KeyValue, iEnt, 0); } SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[]) {     set_kvd(0, KV_ClassName, szClassName);     set_kvd(0, KV_KeyName, szKey);     set_kvd(0, KV_Value, szValue);     set_kvd(0, KV_fHandled, 0);         dllfunc(DLLFunc_KeyValue, iEnt, 0); }

How to remove properly an entity in the map:

Code:
#include <amxmodx> #include <fakemeta> new const g_RemoveEntity[] = "func_push"; public plugin_precache() {     register_plugin("Fine", "and", "you?");         // Remember to do this in plugin_precache, if you     // do this in plugin_init( ) this will not work!         register_forward(FM_Spawn, "HookFmSpawn", 1); } public HookFmSpawn(iEntity) {     if(!pev_valid(iEntity) )         return FMRES_IGNORED;         new szClassName[32];     pev(iEntity, pev_classname, szClassName, 31);         if(equali(szClassName, g_RemoveEntity) )     {         engfunc(EngFunc_RemoveEntity, iEntity);         return FMRES_SUPERCEDE;     }         return FMRES_IGNORED; }

Sry for my english!
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 06-25-2010 at 18:16.
Alucard^ is offline
Send a message via Skype™ to Alucard^