Quote:
Originally Posted by Gabe Iggy
Post the code to see how are you trying.
EDIT: Try this:
PHP Code:
/* Mod Template generated by Pawn Studio */
#include <amxmodx> #include <amxmisc> #include <hamsandwich>
#define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Unknown"
/* Initialization */
#define RESPAWN_TIME 5.0 #define RESPAWN_ID 48575
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); RegisterHam(Ham_Respawn, "weapon_shotgun", "respawn_hook"); RegisterHam(Ham_Touch, "weapon_shotgun", "touch_hook", 1); //post }
public touch_hook(id, other) { //weapon is picked up, assumed it dissapeared from the world //we set a task to respawn it set_task(RESPAWN_TIME, "respawn_task", RESPAWN_ID+id); }
public respawn_hook(id) { // prevent natural respawn return HAM_SUPERCEDE; }
public respawn_task(tid) { new id = tid - RESPAWN_ID; ExecuteHam(Ham_Respawn, id); }
Untested. Done extremely quick.
|
Ok ty, and how can i find the respawn ID for different game modes? Like for example DOD, TFC, SVEN, CS etc etc. I have plans to extend my community in the future and make more servers.
Oh and sry, I have completly removed my code after pasting yours, but my method was using Ham_Spawn only and it used pev_nextthink but didn't work.
When I get the shotgun server seems to crash