Raised This Month: $12 Target: $400
 3% 

Simple WarmUp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-11-2024 , 05:32   Simple WarmUp
Reply With Quote #1

Hi does anyone has a simple warmup plugin? i know theres a few around but didnt quite find it the way i want


1 - all players have knives
2 - the rounds resets in X seconds "cvar"
3 - all players has 35hp during warmup, after the restart goes back to normal
4 - increase player speed by 25% only during warmup too, can be set by cvar
5 - Hud with countdown for restart


thanks guys
tarsisd2 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 04-11-2024 , 08:47   Re: Simple WarmUp
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?p=950354
Tote is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-11-2024 , 13:55   Re: Simple WarmUp
Reply With Quote #3

I've searched already, but that plug-in doesn't have the features I want, if some could edit it for me
tarsisd2 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-12-2024 , 06:08   Re: Simple WarmUp
Reply With Quote #4

i tried to find some examples on how to do this, i know this is wrong but thats all i need, if someone can just fix the code also so i can learn

tried to add health and speed, but to reset when warm up is over

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimercvarhudhandlermp_freezetimevalue

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
        
    
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")    
    
    
register_event("CurWeapon","switchweapon","be","1=1","2!29"
    
    
register_dictionary("simple_warmup.txt")
    
    
cvar register_cvar("warmup_timer""60")
    
    
hudhandler CreateHudSyncObj()
}

public 
plugin_cfg() 
{
    
mp_freezetime get_cvar_pointer("mp_freezetime")
    
    
set_task(10.0"read_vars")
}

public 
read_vars()
{    
    
value get_pcvar_num(mp_freezetime)
}

public 
message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static 
message[64]
    
get_msg_arg_string(2messagecharsmax(message))
    
    if(
equal(message"#Game_Commencing"))
    {
        
hudtimer get_pcvar_num(cvar)
        
        if(
hudtimer == -1)
            return
        
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_START")    
        
set_msg_arg_string(2message)
        
        
set_task(1.0"restart"TASKID__"b")        
        
set_pcvar_num(mp_freezetime0)        
    }
    if(
equal(message"#Game_will_restart_in"))
    {
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_END")    
        
set_msg_arg_string(2message)
    }
}

public 
restart()
{            
    if(
hudtimer <= 0)
    {
        
remove_task(TASKID)
        
set_cvar_num("sv_restartround"1)
        
set_pcvar_num(mp_freezetimevalue)        
    } 
    else 
    {
        
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)    
        
ShowSyncHudMsg(0hudhandler"%L"LANG_PLAYER"COUNTING"hudtimer)
    }    
    
hudtimer--
}

public 
switchweapon(id)
{
    if(
task_exists(TASKID)) 
    {
        
engclient_cmd(id"weapon_knife")
    }
    {
    if(
is_user_alive(id))
        
set_user_health(idPLAYER_HEALTH)
        
set_user_maxspeed(id,MAX_SPEED)

tarsisd2 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 04-12-2024 , 08:09   Re: Simple WarmUp
Reply With Quote #5

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimer, cvar, hudhandler, mp_freezetime, value

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_message(get_user_msgid("TextMsg") ,"message_TextMsg")    
	
	register_event("CurWeapon","switchweapon","be","1=1","2!29") 
	
	register_dictionary("simple_warmup.txt")
	
	cvar = register_cvar("warmup_timer", "60")
	
	hudhandler = CreateHudSyncObj()
	
	RegisterHam(Ham_Spawn, "player", "fw_spawn", 1)
}

public plugin_cfg() 
{
	mp_freezetime = get_cvar_pointer("mp_freezetime")
	
	set_task(10.0, "read_vars")
}

public fw_spawn(id) {
	if(task_exists(TASKID)) {
		set_user_health(0, PLAYER_HEALTH)
		set_user_maxspeed(0, MAX_SPEED)
	}
}

public read_vars()
{    
	value = get_pcvar_num(mp_freezetime)
}

public message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
	static message[64]
	get_msg_arg_string(2, message, charsmax(message))
	
	if(equal(message, "#Game_Commencing"))
	{
		hudtimer = get_pcvar_num(cvar)
		
		if(hudtimer == -1)
			return
		
		formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_START")    
		set_msg_arg_string(2, message)
		
		set_user_health(0, PLAYER_HEALTH)
		set_user_maxspeed(0, MAX_SPEED)
		
		set_task(1.0, "restart", TASKID, _, _, "b")        
		set_pcvar_num(mp_freezetime, 0)        
	}
	if(equal(message, "#Game_will_restart_in"))
	{
		formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_END")    
		set_msg_arg_string(2, message)
	}
}

public restart()
{            
	if(hudtimer <= 0)
	{
		remove_task(TASKID)
		set_cvar_num("sv_restartround", 1)
		set_pcvar_num(mp_freezetime, value)        
	} 
	else 
	{
		set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)    
		ShowSyncHudMsg(0, hudhandler, "%L", LANG_PLAYER, "COUNTING", hudtimer)
	}    
	hudtimer--
}

public switchweapon(id)
{
	if(task_exists(TASKID)) 
	{
		engclient_cmd(id, "weapon_knife")
	}
}
Tote is offline
Tote
Senior Member
Join Date: Jul 2023
Old 04-12-2024 , 08:12   Re: Simple WarmUp
Reply With Quote #6

use logic & reasoning.

you were doing the set hp and set speed in the curweapon event (which is called everytime switch weapons) so it would be setting hp and speed each time you switch to other weapon.

So 1. You set the stuff when its started.
2. You set it in spawn too so when player spawns & the warmup is still enabled then it will set
Tote is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-12-2024 , 11:57   Re: Simple WarmUp
Reply With Quote #7

Quote:
Originally Posted by Tote View Post
use logic & reasoning.

you were doing the set hp and set speed in the curweapon event (which is called everytime switch weapons) so it would be setting hp and speed each time you switch to other weapon.

So 1. You set the stuff when its started.
2. You set it in spawn too so when player spawns & the warmup is still enabled then it will set
you are a life saver man, thanks for explaining too, thanks so much
tarsisd2 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-15-2024 , 08:04   Re: Simple WarmUp
Reply With Quote #8

for some reason the plugin is not working, the plugin is running, i can see the HUD msg but its just a normal round, everyone can use any weapons and its not restarting, i set up 30 seconds round until restart but it doesnt work

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimercvarhudhandlermp_freezetimevalue

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")    
    
    
register_event("CurWeapon","switchweapon","be","1=1","2!29"
    
    
register_dictionary("simple_warmup.txt")
    
    
cvar register_cvar("warmup_timer""30")
    
    
hudhandler CreateHudSyncObj()
    
    
RegisterHam(Ham_Spawn"player""fw_spawn"1)
}

public 
plugin_cfg() 
{
    
mp_freezetime get_cvar_pointer("mp_freezetime")
    
    
set_task(10.0"read_vars")
}

public 
fw_spawn(id) {
    if(
task_exists(TASKID)) {
        
set_user_health(0PLAYER_HEALTH)
        
set_user_maxspeed(0MAX_SPEED)
    }
}

public 
read_vars()
{    
    
value get_pcvar_num(mp_freezetime)
}

public 
message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static 
message[64]
    
get_msg_arg_string(2messagecharsmax(message))
    
    if(
equal(message"#Game_Commencing"))
    {
        
hudtimer get_pcvar_num(cvar)
        
        if(
hudtimer == -1)
            return
        
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_START")    
        
set_msg_arg_string(2message)
        
        
set_user_health(0PLAYER_HEALTH)
        
set_user_maxspeed(0MAX_SPEED)
        
        
set_task(1.0"restart"TASKID__"b")        
        
set_pcvar_num(mp_freezetime0)        
    }
    if(
equal(message"#Game_will_restart_in"))
    {
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_END")    
        
set_msg_arg_string(2message)
    }
}

public 
restart()
{            
    if(
hudtimer <= 0)
    {
        
remove_task(TASKID)
        
set_cvar_num("sv_restartround"1)
        
set_pcvar_num(mp_freezetimevalue)        
    } 
    else 
    {
        
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)    
        
ShowSyncHudMsg(0hudhandler"%L"LANG_PLAYER"COUNTING"hudtimer)
    }    
    
hudtimer--
}

public 
switchweapon(id)
{
    if(
task_exists(TASKID)) 
    {
        
engclient_cmd(id"weapon_knife")
    }

tarsisd2 is offline
Ace67
Senior Member
Join Date: Sep 2020
Location: France
Old 04-16-2024 , 16:40   Re: Simple WarmUp
Reply With Quote #9

Quote:
Originally Posted by tarsisd2 View Post
for some reason the plugin is not working, the plugin is running, i can see the HUD msg but its just a normal round, everyone can use any weapons and its not restarting, i set up 30 seconds round until restart but it doesnt work

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Simple Knife Warump"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimercvarhudhandlermp_freezetimevalue

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_message(get_user_msgid("TextMsg") ,"message_TextMsg")    
    
    
register_event("CurWeapon","switchweapon","be","1=1","2!29"
    
    
register_dictionary("simple_warmup.txt")
    
    
cvar register_cvar("warmup_timer""30")
    
    
hudhandler CreateHudSyncObj()
    
    
RegisterHam(Ham_Spawn"player""fw_spawn"1)
}

public 
plugin_cfg() 
{
    
mp_freezetime get_cvar_pointer("mp_freezetime")
    
    
set_task(10.0"read_vars")
}

public 
fw_spawn(id) {
    if(
task_exists(TASKID)) {
        
set_user_health(0PLAYER_HEALTH)
        
set_user_maxspeed(0MAX_SPEED)
    }
}

public 
read_vars()
{    
    
value get_pcvar_num(mp_freezetime)
}

public 
message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static 
message[64]
    
get_msg_arg_string(2messagecharsmax(message))
    
    if(
equal(message"#Game_Commencing"))
    {
        
hudtimer get_pcvar_num(cvar)
        
        if(
hudtimer == -1)
            return
        
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_START")    
        
set_msg_arg_string(2message)
        
        
set_user_health(0PLAYER_HEALTH)
        
set_user_maxspeed(0MAX_SPEED)
        
        
set_task(1.0"restart"TASKID__"b")        
        
set_pcvar_num(mp_freezetime0)        
    }
    if(
equal(message"#Game_will_restart_in"))
    {
        
formatex(messagecharsmax(message), "%L"LANG_PLAYER"WARUMP_END")    
        
set_msg_arg_string(2message)
    }
}

public 
restart()
{            
    if(
hudtimer <= 0)
    {
        
remove_task(TASKID)
        
set_cvar_num("sv_restartround"1)
        
set_pcvar_num(mp_freezetimevalue)        
    } 
    else 
    {
        
set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2)    
        
ShowSyncHudMsg(0hudhandler"%L"LANG_PLAYER"COUNTING"hudtimer)
    }    
    
hudtimer--
}

public 
switchweapon(id)
{
    if(
task_exists(TASKID)) 
    {
        
engclient_cmd(id"weapon_knife")
    }

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Simple Knife Warmup"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimer, cvar, hudhandler, mp_freezetime, value

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_message(get_user_msgid("TextMsg") ,"message_TextMsg");    
    
    register_event("CurWeapon","switchweapon","be","1=1","2!29"); 
    
    register_dictionary("simple_warmup.txt");
    
    cvar = register_cvar("warmup_timer", "30");
    
    hudhandler = CreateHudSyncObj();
    
    RegisterHam(Ham_Spawn, "player", "fw_spawn", 1);
}

public plugin_cfg() 
{
    mp_freezetime = get_cvar_pointer("mp_freezetime");
    
    set_task(10.0, "read_vars");
}

public fw_spawn(id) 
{
    if(task_exists(TASKID)) 
    {
        set_user_health(id, PLAYER_HEALTH);
        set_user_maxspeed(id, MAX_SPEED);
    }
}

public read_vars()
{    
    value = get_pcvar_num(mp_freezetime);
}

public message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static message[64];
    get_msg_arg_string(2, message, charsmax(message));
    
    if(equal(message, "#Game_Commencing"))
    {
        hudtimer = get_pcvar_num(cvar);
        
        if(hudtimer == -1)
            return;
        
        formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_START");    
        set_msg_arg_string(2, message);
        
        set_task(1.0, "restart", TASKID, _, _, "b");        
        set_pcvar_num(mp_freezetime, 0);        
    }
    if(equal(message, "#Game_will_restart_in"))
    {
        formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_END");    
        set_msg_arg_string(2, message);
    }
}

public restart()
{            
    if(hudtimer <= 0)
    {
        remove_task(TASKID);
        set_cvar_num("sv_restartround", 1);
        set_pcvar_num(mp_freezetime, value);        
    } 
    else 
    {
        hudtimer--;
        set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2);    
        ShowSyncHudMsg(0, hudhandler, "%L", LANG_PLAYER, "COUNTING", hudtimer);
    }    
}

public switchweapon(id)
{
    if(task_exists(TASKID)) 
    {
        engclient_cmd(id, "weapon_knife");
    }
}
__________________
CS:CZ > CS 1.6
Ace67 is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-17-2024 , 07:19   Re: Simple WarmUp
Reply With Quote #10

Quote:
Originally Posted by Ace67 View Post
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Simple Knife Warmup"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 300.0

new hudtimer, cvar, hudhandler, mp_freezetime, value

public plugin_init() 
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    register_message(get_user_msgid("TextMsg") ,"message_TextMsg");    
    
    register_event("CurWeapon","switchweapon","be","1=1","2!29"); 
    
    register_dictionary("simple_warmup.txt");
    
    cvar = register_cvar("warmup_timer", "30");
    
    hudhandler = CreateHudSyncObj();
    
    RegisterHam(Ham_Spawn, "player", "fw_spawn", 1);
}

public plugin_cfg() 
{
    mp_freezetime = get_cvar_pointer("mp_freezetime");
    
    set_task(10.0, "read_vars");
}

public fw_spawn(id) 
{
    if(task_exists(TASKID)) 
    {
        set_user_health(id, PLAYER_HEALTH);
        set_user_maxspeed(id, MAX_SPEED);
    }
}

public read_vars()
{    
    value = get_pcvar_num(mp_freezetime);
}

public message_TextMsg(const MsgId, const MsgDest, const MsgEntity)
{    
    static message[64];
    get_msg_arg_string(2, message, charsmax(message));
    
    if(equal(message, "#Game_Commencing"))
    {
        hudtimer = get_pcvar_num(cvar);
        
        if(hudtimer == -1)
            return;
        
        formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_START");    
        set_msg_arg_string(2, message);
        
        set_task(1.0, "restart", TASKID, _, _, "b");        
        set_pcvar_num(mp_freezetime, 0);        
    }
    if(equal(message, "#Game_will_restart_in"))
    {
        formatex(message, charsmax(message), "%L", LANG_PLAYER, "WARUMP_END");    
        set_msg_arg_string(2, message);
    }
}

public restart()
{            
    if(hudtimer <= 0)
    {
        remove_task(TASKID);
        set_cvar_num("sv_restartround", 1);
        set_pcvar_num(mp_freezetime, value);        
    } 
    else 
    {
        hudtimer--;
        set_hudmessage(255,255,255,-1.0,0.9,0,6.0,1.0,0.1,0.2);    
        ShowSyncHudMsg(0, hudhandler, "%L", LANG_PLAYER, "COUNTING", hudtimer);
    }    
}

public switchweapon(id)
{
    if(task_exists(TASKID)) 
    {
        engclient_cmd(id, "weapon_knife");
    }
}
its working now, players has 35hp on warmup, the only problem is that the speed is still the same, i tried to change the MAX_SPEED value too but it has no difference in the game
tarsisd2 is offline
Old 04-17-2024, 09:57
Ace67
This message has been deleted by Ace67.
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 17:22.


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