Raised This Month: $ Target: $400
 0% 

[H3LP] Weapon Respawn Time


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-21-2017 , 10:39   Re: [H3LP] Weapon Respawn Time
Reply With Quote #1

Quote:
Originally Posted by Gabe Iggy View Post
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.
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

Last edited by DarthMan; 04-21-2017 at 10:48.
DarthMan is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-21-2017 , 12:09   Re: [H3LP] Weapon Respawn Time
Reply With Quote #2

Quote:
Originally Posted by DarthMan View Post
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
Respawn IDs are completely arbitrary, I use them to identify the task.

Any error message when the game crash?
__________________

Last edited by gabuch2; 04-21-2017 at 12:09.
gabuch2 is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-21-2017 , 12:26   Re: [H3LP] Weapon Respawn Time
Reply With Quote #3

Quote:
Originally Posted by Gabe Iggy View Post
Respawn IDs are completely arbitrary, I use them to identify the task.

Any error message when the game crash?
Nope, it just crashes and gives an error HLDS has stopped working and needs to be closed.

Last edited by DarthMan; 04-21-2017 at 12:26.
DarthMan is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-21-2017 , 11:49   Re: [H3LP] Weapon Respawn Time
Reply With Quote #4

Each game has its own weapons id names

You need to search
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 18:00.


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