Raised This Month: $ Target: $400
 0% 

Plugin which crashes my server.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FiFiX
Senior Member
Join Date: May 2008
Location: Poland
Old 06-24-2011 , 05:21   Plugin which crashes my server.
Reply With Quote #1

So, it's plugin which makes restart after first round. I wanted to remove nades and c4 in that round. I've made the plugin:

Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <hamsandwich>

#define PLUGIN "RR"
#define VERSION "1.0"
#define AUTHOR "FiFiX"

#define TASK_TIMER 43000

new r_counter;

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
    
    RegisterHam(Ham_AddPlayerItem, "player", "Player_AddPlayerItem");
    
    register_event("TextMsg","first_round","a","2&#Game_C");
    register_event("HLTV", "ev_roundstart", "a", "1=0", "2=0");
    
}

public first_round()
{
    if(!r_counter)
    {
        set_cvar_num("sv_alltalk", 1);
        set_cvar_num("mp_friendlyfire", 0);
        pause("ac","M_Antirusher_2.6_alfa.amxx");
        r_counter = 1;
    }
}

public ev_roundstart()
{
    if(!r_counter) return;

    switch(r_counter)
    {
        case 1:set_task(2.0, "restart_map", TASK_TIMER);
        case 2:set_task(1.0, "restart", TASK_TIMER);
    }   
    r_counter++;
}

public restart()    
{
    r_counter = 0;
    unpause("ac","M_Antirusher_2.6_alfa.amxx");
    set_cvar_num("sv_alltalk", 0);
    set_cvar_num("mp_friendlyfire", 1);
    set_cvar_num("sv_restart", 1);
}

public Player_AddPlayerItem( id , iWeapon ) 
{
    if(!r_counter) 
        return HAM_IGNORED;
            
    switch( cs_get_weapon_id( iWeapon ) ) 
    {
        case CSW_C4: 
        {
            cs_set_user_plant(id, 0, 0)
            entity_set_int(id, EV_INT_body, 0) 
            SetHamReturnInteger( false )
            return HAM_SUPERCEDE
        }
        case CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE: 
        {
            SetHamReturnInteger( false )
            return HAM_SUPERCEDE
        }
    }
    return HAM_IGNORED
 }
 
public restart_map()
{
    new jac1=random_num(0,255);
    new jac2=random_num(0,255);
    new jac3=random_num(0,255);  
    
    set_hudmessage(jac1, jac2, jac3, 0.65, 0.75, 2, 0.02, 1.0, 0.01, 0.1, 10); 
    show_hudmessage(0,"====================^n RUNDA ROZGRZEWKOWA ^n KampNO Classic[TP] ^n====================");

    if(r_counter) 
        set_task(1.0, "restart_map", TASK_TIMER);
        
    return PLUGIN_HANDLED;
}

Sometimes it crashes the server, always after that first round... Thats from console:
Code:
L 06/22/2011 - 14:31:46: Team "CT" triggered "CTs_Win" (CT "1") (T "0")
 L 06/22/2011 - 14:31:46: World triggered "Round_End"
 L 06/22/2011 - 14:31:51: "Czisburger z  serem<245><STEAM_0:1:25620904><TERRORIST>" triggered  "Spawned_With_The_Bomb"
 L 06/22/2011 - 14:31:51: "Czisburger z  serem<245><STEAM_0:1:25620904><TERRORIST>" triggered  "Spawned_With_The_Bomb"
 L 06/22/2011 - 14:31:52: Server cvar "sv_alltalk" = "0"
 L 06/22/2011 - 14:31:52: Server cvar "mp_friendlyfire" = "1"
 L 06/22/2011 - 14:31:52: Server cvar "sv_restart" = "1"
 L 06/22/2011 - 14:31:52: World triggered "Restart_Round_(1_second)"
 L 06/22/2011 - 14:31:52: Team "CT" scored "1" with "6" players
 L 06/22/2011 - 14:31:52: Team "TERRORIST" scored "0" with "6" players
 L 06/22/2011 - 14:31:52: Server cvar "sv_restart" = "0"
 L 06/22/2011 - 14:31:53: "Czisburger z  serem<245><STEAM_0:1:25620904><TERRORIST>" triggered  "Spawned_With_The_Bomb"
 L 06/22/2011 - 14:31:59: World triggered "Round_Start"
 email debug.log to [email protected]
 Wed Jun 22 14:32:01 CEST 2011: Server restart in 10 seconds
Any ideas why? There's no error logs etc.
FiFiX is offline
Send a message via Skype™ to FiFiX
 


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 23:27.


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