Raised This Month: $62 Target: $400
 15% 

Need a simple auto respawn plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dhruv
Junior Member
Join Date: Dec 2019
Old 12-05-2019 , 04:39   Need a simple auto respawn plugin
Reply With Quote #1

Hello Guys... i need a plugin when its cvar is set to 1 it will auto respawn players in 2 seconds and give the player gun if he is terrorist ak47 and if he is ct then m16a4... thanks
dhruv is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-05-2019 , 14:39   Re: Need a simple auto respawn plugin
Reply With Quote #2

Untested:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fun> #define PLUGIN "Respawn" #define VERSION "1.0" #define AUTHOR "NapoleoN#" new pRespawnEnabled public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_Killed, "player", "PostPlayerKilled", 1)         pRespawnEnabled = register_cvar("amx_respawn","1") } public PostPlayerKilled(iVictim, iAttacker, shouldgib) {     if(get_pcvar_num(pRespawnEnabled)) {         set_task(2.0, "RespawnVictim", iVictim)     } } public RespawnVictim(id) {     if(get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {         ExecuteHamB(Ham_CS_RoundRespawn, id)         set_task(0.5, "GiveWeapons", id) // Delay the give weapon option to avoid spawning weapons too fast.     } } public GiveWeapons(id) {     if(is_user_alive(id)) {         if(cs_get_user_team(id) == CS_TEAM_CT) {             give_item(id, "weapon_m4a1")             cs_set_user_bpammo(id, CSW_M4A1, 90)         }             else if(cs_get_user_team(id) == CS_TEAM_T) {             give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         }     } }
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
dhruv
Junior Member
Join Date: Dec 2019
Old 12-06-2019 , 04:04   Re: Need a simple auto respawn plugin
Reply With Quote #3

Ok i will test it and let you know
dhruv is offline
dhruv
Junior Member
Join Date: Dec 2019
Old 12-07-2019 , 07:17   Re: Need a simple auto respawn plugin
Reply With Quote #4

Quote:
Originally Posted by Napoleon_be View Post
Untested:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fun> #define PLUGIN "Respawn" #define VERSION "1.0" #define AUTHOR "NapoleoN#" new pRespawnEnabled public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_Killed, "player", "PostPlayerKilled", 1)         pRespawnEnabled = register_cvar("amx_respawn","1") } public PostPlayerKilled(iVictim, iAttacker, shouldgib) {     if(get_pcvar_num(pRespawnEnabled)) {         set_task(2.0, "RespawnVictim", iVictim)     } } public RespawnVictim(id) {     if(get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {         ExecuteHamB(Ham_CS_RoundRespawn, id)         set_task(0.5, "GiveWeapons", id) // Delay the give weapon option to avoid spawning weapons too fast.     } } public GiveWeapons(id) {     if(is_user_alive(id)) {         if(cs_get_user_team(id) == CS_TEAM_CT) {             give_item(id, "weapon_m4a1")             cs_set_user_bpammo(id, CSW_M4A1, 90)         }             else if(cs_get_user_team(id) == CS_TEAM_T) {             give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         }     } }
working good.. need some changes
1. Remove guns ak and m4 for t ct remove that
2. instead make buy menu time unlimited
3. add hostname it should change the hostname to which i want
4. when new player connect he cant spawn.. plz fix that

thanks

Last edited by dhruv; 12-07-2019 at 07:18.
dhruv is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-07-2019 , 07:19   Re: Need a simple auto respawn plugin
Reply With Quote #5

3. How is the hostname related to any of this? You don't need a plugin to change a cvar.
__________________


Dear admins. If somehow you managed to read this, plz fix.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
dhruv
Junior Member
Join Date: Dec 2019
Old 12-07-2019 , 07:28   Re: Need a simple auto respawn plugin
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
3. How is the hostname related to any of this? You don't need a plugin to change a cvar.
i need it to automatic change hostname and when i stop plugin change hostname to original
dhruv is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 12-07-2019 , 16:27   Re: Need a simple auto respawn plugin
Reply With Quote #7

Updated version. Allthough i'm not sure what you mean with changing hostname (Do you mean the server name?) Untill i get clear intell on that, i'll just leave it for now.

1. Guns on respawn have been removed
2. added a server command that changes mp_buytime to 0, allthough i'm not sure if this would work, you gotta test it.
3. will be worked on
4. Should be fixed.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <cstrike> #include <fun> #define PLUGIN "Respawn" #define VERSION "1.0" #define AUTHOR "NapoleoN#" new pRespawnEnabled public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         RegisterHam(Ham_Killed, "player", "PostPlayerKilled", 1)         pRespawnEnabled = register_cvar("amx_respawn","1")         server_cmd("mp_buytime 0") } public client_putinserver(id) {     RespawnVictim(id) } public PostPlayerKilled(iVictim, iAttacker, shouldgib) {     if(get_pcvar_num(pRespawnEnabled)) {         set_task(2.0, "RespawnVictim", iVictim)     } } public RespawnVictim(id) {     if(get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {         ExecuteHamB(Ham_CS_RoundRespawn, id)         // set_task(0.5, "GiveWeapons", id) // Delay the give weapon option to avoid spawning weapons too fast.     } } /*public GiveWeapons(id) {     if(is_user_alive(id)) {         if(cs_get_user_team(id) == CS_TEAM_CT) {             give_item(id, "weapon_m4a1")             cs_set_user_bpammo(id, CSW_M4A1, 90)         }                 else if(cs_get_user_team(id) == CS_TEAM_T) {             give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         }     } }*/
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-08-2019 , 09:04   Re: Need a simple auto respawn plugin
Reply With Quote #8

Just a change in spawn, you should spawn the player after he chooses a team.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Respawn"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new pRespawnEnabledbool:FirstSpawn[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Killed"player""PostPlayerKilled"1)
    
    
pRespawnEnabled register_cvar("amx_respawn","1")
    
    
register_event("TeamInfo" "TeamInfo" "a")
    
    
server_cmd("mp_buytime 0")
}

public 
client_connect(id) {
    
FirstSpawn[id] = true
}

public 
PostPlayerKilled(iVictimiAttackershouldgib) {
    if(
get_pcvar_num(pRespawnEnabled)) {
        
set_task(2.0"RespawnVictim"iVictim)
    }
}

public 
RespawnVictim(id) {
    if(
get_pcvar_num(pRespawnEnabled) && !is_user_alive(id)) {
        
ExecuteHamB(Ham_CS_RoundRespawnid
    }
}

public 
TeamInfo()
{
    new 
id szTeam];
    
    
id read_data)
    
read_dataszTeam charsmaxszTeam ) )
    
    switch( 
szTeam] )
    {
        case 
'T'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        case 
'C'
        {
            if(
FirstSpawn[id])
            {
                
set_task(2.0"RespawnVictim"id)
                
FirstSpawn[id] = false
            
}
        }
        
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.

Last edited by iceeedr; 12-08-2019 at 09:05.
iceeedr is offline
Send a message via Skype™ to iceeedr
ZaX
Senior Member
Join Date: Jan 2015
Old 12-08-2019 , 10:33   Re: Need a simple auto respawn plugin
Reply With Quote #9

Quote:
Originally Posted by dhruv View Post
4. when new player connect he cant spawn.. plz fix that
He didnt want to respawn new connected players
ZaX is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 12-09-2019 , 05:11   Re: Need a simple auto respawn plugin
Reply With Quote #10

@Napoleon_be by HostName, he means Server name .. just execute a server cmd for him xD
He wants to show this Mod running status in hostname and should change back to original when he turns it off

Ex:
(ServerName ) PLUGIN ON -- > "Cool server Sexy MOD RUNNING"
(ServerName ) PLUGIN OFF -- > "Just a server"
instinctpt1 is offline
Reply


Thread Tools
Display Modes

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 01:09.


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