Raised This Month: $ Target: $400
 0% 

ED_Alloc: no free edicts


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-25-2009 , 08:03   Re: ED_Alloc: no free edicts
Reply With Quote #7

here the full code

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

new g_spieler_anzahl_checked 0
new g_first_round 0
new g_MaxPlayers

public plugin_init() 
{
    
register_plugin("Versteck dich""1.0""Dr.One")
    
register_event("HLTV""Start_new_round""a""1=0""2=0")
    
g_MaxPlayers get_maxplayers()
    
register_logevent("round_end"2"1=Round_End")
    
register_event"ResetHUD""Event_ResetHUD""be" );
}
public 
Start_new_round()
{
    
/*Zuerst abfrage für spieler anzhal auf dem server*/
    
new g_Spieler_anzahl;
    
g_Spieler_anzahl get_playersnum(1);
    
    
/*nun abfragen ob wir das spiel stanten können*/
    
if( g_Spieler_anzahl && g_spieler_anzahl_checked == 0)
    {
        
Start_the_MOD()
        
client_print(0,print_chat,"Enough players on server!The game has begonn")
        
server_cmd("sv_restart 10")
        
g_spieler_anzahl_checked 1
        g_first_round 
1
    
}
    else if( 
g_Spieler_anzahl 3)
    {
        
client_print(0,print_chat,"Not enough players on server!Waiting for more players to begin the game")
        
g_spieler_anzahl_checked 0
    
}
    else if(
g_spieler_anzahl_checked == && g_Spieler_anzahl 3)
    {
        
g_spieler_anzahl_checked 0
        g_first_round 
0
    
}
}
public 
Start_the_MOD()
{
    
/*alles für erste runde kommt hier rein*/
    
client_print(0,print_chat,"ich wills")
    
/*fürs erste setzen wir alle in T*/
    
for(new id 1id <= g_MaxPlayersid++)
    {
        if(
is_user_connected(id))
        {
            
cs_set_user_team(id,CS_TEAM_T)
        }
    }
    
/*jetzt einer geht Random zu CT*/
    
new iPlayers32 ], iNumiPlayer;
    
get_playersiPlayersiNum );
    
    
iPlayer iPlayersrandomiNum ) ];
    if(
is_user_connected(iPlayer)||cs_get_user_team(iPlayer) == CS_TEAM_CT || cs_get_user_team(iPlayer) == CS_TEAM_T)
    {
        
cs_set_user_team(iPlayer,CS_TEAM_CT)
    }
}
public 
round_end()
{
    if(
g_spieler_anzahl_checked == 1)
    {
        new 
alive_Ts[33], Ts[33], alive_CTs[33], CTs[33]
        new 
alive_Ts_numTs_numalive_CTs_numCTs_numid
        
for(new 1<= g_MaxPlayersi++)
        {
            if(!
is_user_connected(i))
                continue
                
            switch(
cs_get_user_team(i))
            {
                case 
CS_TEAM_CT:
                {
                    
CTs[CTs_num++] = i
                    
if(is_user_alive(i))
                    
alive_CTs[alive_CTs_num++] = i
                
}
                case 
CS_TEAM_T:
                {
                    
Ts[Ts_num++] = i
                    
if(is_user_alive(i))
                    
alive_Ts[alive_Ts_num++] = i
                
}
            }
        }

        if(
CTs_num Ts_num 2)
            return  
// not enough players
    
        
if(alive_Ts_num 0)
        {
            
cs_set_user_team(alive_Ts[random(alive_Ts_num)], CS_TEAM_CT)
        }
        
        else if(
alive_CTs_num 0)
        {
            
id alive_CTs[random(alive_CTs_num)]
        }
            
        else if(
Ts_num 0)
        {
            
cs_set_user_team(Ts[random(Ts_num)], CS_TEAM_CT)
        }
            
        else if(
CTs_num 0)
        {
            
id CTs[random(CTs_num)]
        }

        for(new 
i=0i<CTs_numi++)
        {
            if(
CTs[i] != id)
            
cs_set_user_team(CTs[i], CS_TEAM_T)
        }
    }
}
public 
Event_ResetHUD()
{
    if(
g_spieler_anzahl_checked == 1)
    {
        for(new 
id 1id <= g_MaxPlayersid++)
        {
            if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
            {
                
                
//return PLUGIN_HANDLED 
                
if(is_user_alive(id))
                {
                    
set_user_maxspeed(id,0.0)
                    
strip_user_weaponsid )
                    
set_user_godmode(id,1)
                    
UTIL_FadeToBlack(id,30.0,false,true
                    
//message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"),{0,0,0},0) 
                    //write_byte(id) 
                    //write_byte(4) 
                    //message_end() 

                
}
                    
            }
        }
    }

__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
 



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:34.


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