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

Simple WarmUp


Post New Thread Reply   
 
Thread Tools Display Modes
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-24-2024 , 17:00   Re: Simple WarmUp
Reply With Quote #21

@tarsisd2 apparently, the events were for decoration

__________________
mlibre is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 04-25-2024 , 16:10   Re: Simple WarmUp
Reply With Quote #22

Quote:
Originally Posted by tarsisd2 View Post
of course man

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

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

#define PLUGIN "Simple Knife Warmup"
#define VERSION "1.2"  // Version update
#define AUTHOR "Sn!ff3r EL3"

#define TASKID 1234
#define PLAYER_HEALTH 35
#define MAX_SPEED 250.0 // Adjusted max speed

new hudtimercvarhudhandlermp_freezetimevalue

// Error handling for critical functions
public plugin_init() 
{
    if (!
register_plugin(PLUGINVERSIONAUTHOR)) {
        
printf("Error: Could not register plugin %s"PLUGIN);
        return 
PLUGIN_FAILED;
    }

    if ((
cvar register_cvar("warmup_timer""30")) == INVALID_CVAR) {
        
printf("Error: Could not register cvar warmup_timer");
        return 
PLUGIN_FAILED;
    }
    
    
register_message(get_user_msgid("TextMsg"), "message_TextMsg");
    
register_dictionary("simple_warmup.txt");

    
hudhandler CreateHudSyncObj();

    
RegisterHam(Ham_Spawn"player""fw_spawn"1);
}

// Error handling for retrieving cvar pointer
public plugin_cfg() 
{
    if ((
mp_freezetime get_cvar_pointer("mp_freezetime")) == INVALID_CVAR) {
        
printf("Error: Could not retrieve cvar pointer for mp_freezetime");
        return 
PLUGIN_FAILED;
    }
    
    
set_task(10.0"read_vars");
}

public 
fw_spawn(id
{
    if(
task_exists(TASKID)) 
    {
        
set_user_health(idPLAYER_HEALTH);
        
set_user_maxspeed(idMAX_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_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 
    {
        
hudtimer--;
        
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);
    }    
}

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

public 
reset_speed(id)
{
    if(
task_exists(TASKID)) 
    {
        
set_user_maxspeed(idMAX_SPEED);
    }

L 04/25/2024 - 16:06:51: [FUN] Invalid player 2
L 04/25/2024 - 16:06:51: [AMXX] Run time error 10 (plugin ""Warmup.amxx") (native "set_user_health")
JuanitoAlimana is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 04-26-2024 , 04:14   Re: Simple WarmUp
Reply With Quote #23

Quote:
Originally Posted by mlibre View Post
@tarsisd2 apparently, the events were for decoration

man, i can manage servers, coding is not my strong suit, so im not really sure what to do here
tarsisd2 is offline
Tote
Senior Member
Join Date: Jul 2023
Old 04-26-2024 , 08:50   Re: Simple WarmUp
Reply With Quote #24

Quote:
Originally Posted by JuanitoAlimana View Post
L 04/25/2024 - 16:06:51: [FUN] Invalid player 2
L 04/25/2024 - 16:06:51: [AMXX] Run time error 10 (plugin ""Warmup.amxx") (native "set_user_health")
just check

if(is_user_connected)
Tote is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 04-26-2024 , 16:26   Re: Simple WarmUp
Reply With Quote #25

Quote:
Originally Posted by Tote View Post
just check

if(is_user_connected)
It didn't work but I solved it using is_user_alive
JuanitoAlimana is offline
Old 04-26-2024, 16:36
JuanitoAlimana
This message has been deleted by JuanitoAlimana. Reason: I posted twice
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 13:48.


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