Raised This Month: $ Target: $400
 0% 

[H3LP] Weapon Respawn Time


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-21-2017 , 09:50   Re: [H3LP] Weapon Respawn Time
Reply With Quote #10

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(PLUGINVERSIONAUTHOR);
    
RegisterHam(Ham_Respawn"weapon_shotgun""respawn_hook");
    
RegisterHam(Ham_Touch"weapon_shotgun""touch_hook"1); //post
}

public 
touch_hook(idother)
{
    
//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_Respawnid);

Untested. Done extremely quick.
__________________

Last edited by gabuch2; 04-21-2017 at 10:00. Reason: changed 9mmar to shotgun because 9mmar may be case sensitive
gabuch2 is offline
 



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 18:00.


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