Estaba interiorizandome en el mundo del ReHLDS y todas sus raices, Reunion, ReAmxModX, ReGameDLL, etc... y me tope con el ReAPI
Que es un modulo nuevo que usa la API del ReGameDLL y el ReHLDS.
Al parecer es mucho mas rapido en la creacion de algun mod o plugin, estaba viendo ejemplos practicos como este (estaba en ruso, pero nada que el traductor no hiciese, es entendible)
Define reapi on your plugin
Código PHP:
#include <reapi>
In plugin_init , register a hook and hang on DeadPlayerWeapons handler on CSGameRules_DeadPlayerWeapons
Código PHP:
public plugin_init() { RegisterHookChain(RG_CSGameRules_DeadPlayerWeapons, "CSGameRules_DeadPlayerWeapons") }
Next, create a body-handler function
Código PHP:
public CSGameRules_DeadPlayerWeapons(const index) {
}
The next step for the overall presentation is desirable to look at the source ReGameDLL_CS player.cpp # L1473 ,
knowing that the function must return a certain value which does not expect GR_PLR_DROP_GUN_NO
and will depend on further executable code, the essence of this PackDeadPlayerItems function is
that throwing weapons on the ground after the player's death, try to prevent it,
for the refund of value GR_PLR_DROP_GUN_NO who does not expect to receive.
Código PHP:
public CSGameRules_DeadPlayerWeapons(const index) { SetHookChainReturn(ATYPE_INTEGER, GR_PLR_DROP_GUN_NO); }
Since, in the original function , virtually nothing, there is no need to call it once again, so use HC_SUPERCEDE
Código PHP:
public CSGameRules_DeadPlayerWeapons(const index) { SetHookChainReturn(ATYPE_INTEGER, GR_PLR_DROP_GUN_NO); return HC_SUPERCEDE; }
So a simple way, to prevent any appearance of weapons following the death of a player quite a come down for CSDM and GunGame mod.
Código PHP:
#include <amxmodx> #include <reapi>
public plugin_init() { RegisterHookChain(RG_CSGameRules_DeadPlayerWeapons, "CSGameRules_DeadPlayerWeapons") }
public CSGameRules_DeadPlayerWeapons(const index) { SetHookChainReturn(ATYPE_INTEGER, GR_PLR_DROP_GUN_NO); return HC_SUPERCEDE; }
Tambien existian estas Forwards caracteristicas del ReAPI
Código PHP:
Call Control original function and other hooks. Done by the return of striker one of four values: HC_CONTINUE - continue to cause hooks and original HC_OVERRIDE - continue to call the original, but to return its value HC_SUPERCEDE - continue to cause the hooks, but interrupt the original (If the function is not void, before locking her call, you must set its return value)
HC_BREAK - interrupt the hooks and the original
Setting the return value. Running Nativ SetHookChainReturn with two arguments, the first need to specify the return type, and the second value. Getting the return value. Nativ done GetHookChainReturn , it may be due to only post.
Replacing the arguments in the function. Nativ done SetHookChainArg , the first argument specifies the sequence number of arguments always begins with 1, the second type of argument, and in the third - the value.
Que conste que esto NO esta disponible en ingles y es una vaga traduccion de Google, si supiese mas del tema, con gusto lo traduciría o si alguien mas sabe, seria un buen aporte.
Somos un foro en español, si vas a publicar algo tiene que ser escrito así y traducido por una persona idónea para que lo que se lee tenga sentido y validez. Así como así no sirve de nada, mucho menos sin está traducido con google.