Raised This Month: $ Target: $400
 0% 

[Error] Send Player Spec After 2 Round AFK


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
FonixPro20
Member
Join Date: Mar 2018
Location: Usa
Old 12-26-2018 , 15:00   [Error] Send Player Spec After 2 Round AFK
Reply With Quote #1

i'm not should if set player to spec will work good any bugs ?

PHP Code:
#include <amxmodx> 

#include <hamsandwich> 

#include <fakemeta> 

#include <cstrike> 

#define PLUGIN "New Plug-In"

#define VERSION "1.0"

#define AUTHOR "author"


#define TIME 25.0

#define    szPrefix "[TEAM]"


new Float:player_origin[33][3

new 
AFK_time[33];

new const 
thunder_sound[] = "ambience/thunder_clap.wav"

new 
g_Lightningg_Smoke

  

public 
plugin_init()

    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""e_Spawn"1); 



public 
plugin_precache() 



    
precache_sound(thunder_sound

    
g_Lightning precache_model("sprites/lgtning.spr"

    
g_Smoke precache_model("sprites/steam1.spr"



  

public 
e_Spawn(id

{
    
    if(
is_user_alive(id) && !( get_user_flagsid ) & ADMIN_IMMUNITY ) )
    {
        
set_task(0.8"get_spawn"id); 

    } 
    return 
HAM_IGNORED



  

public 
get_spawn(id
{
    
remove_task(id);

    
pev(idpev_originplayer_origin[id]); 

    
set_task(TIME"check_afk"id);

}

  

public 
check_afk(id)
{    
    if (  
AFK_time[id] > )
    {
        new 
name[32] ;
        
get_user_name(idnamecharsmax(name)); 
        
        
user_silentkill(id);
        
cs_set_user_team(idCS_TEAM_SPECTATOR);
        
        
AFK_time[id] = 0
        
        ChatColor
(0"!g%s !t%s !nWas Transfer To SPEC for beeing AFK More Than 2 Round's !g!!"szPrefixname)
        return 
PLUGIN_HANDLED;
    }
    
    if(
is_user_alive(id) && same_origin(id) )
        
    {
        
user_kill(id);
        
        
AFK_time[id]++

        
magnificcentKill(id);

        new 
name[32] ;
        
        
get_user_name(idnamecharsmax(name)); 

        
ChatColor("!g%s !t%s !nWas Slayed for beeing AFK !g!!" szPrefixname);
        return 
PLUGIN_HANDLED;
    } 
    return 
PLUGIN_HANDLED;



  

public 
same_origin(id



    new 
Float:origin[3]; 

    
pev(idpev_originorigin); 

    for(new 
03i++) 

        if(
origin[i] != player_origin[id][i]) 

        return 
0

    return 
1



  

stock magnificcentKill(const id



    new 
iOrigin[3], iPos[3

    

    
get_user_origin(idiOrigin

    
iOrigin[2] -= 26 

    iPos
[0] = iOrigin[0] + 150 

    iPos
[1] = iOrigin[1] + 150 

    iPos
[2] = iOrigin[2] + 800 

        

    makeThunder
(iPosiOrigin

    
makeSmoke(iOrigin1010

    
makeBlood(iOrigin

    

    
user_silentkill(id



  

stock makeBlood(iorigin[3]) 



    
message_begin(MSG_BROADCASTSVC_TEMPENTITY

    
write_byte(TE_LAVASPLASH

    
write_coord(iorigin[0]) 

    
write_coord(iorigin[1]) 

    
write_coord(iorigin[2]) 

    
message_end() 



  

stock makeSmoke(iorigin[3], scaleframerate 



    
message_begin(MSG_BROADCASTSVC_TEMPENTITY

    
write_byte(TE_SMOKE

    
write_coord(iorigin[0]) 

    
write_coord(iorigin[1]) 

    
write_coord(iorigin[2]) 

    
write_short(g_Smoke

    
write_byte(scale

    
write_byte(framerate

    
message_end() 



  

stock makeThunder(start[3], end[3]) 



    
message_begin(MSG_BROADCASTSVC_TEMPENTITY

    
write_byte(TE_BEAMPOINTS

    
write_coord(start[0]) 

    
write_coord(start[1]) 

    
write_coord(start[2]) 

    
write_coord(end[0]) 

    
write_coord(end[1]) 

    
write_coord(end[2]) 

    
write_short(g_Lightning

    
write_byte(1

    
write_byte(5

    
write_byte(7

    
write_byte(20

    
write_byte(30

    
write_byte(200

    
write_byte(200

    
write_byte(200

    
write_byte(200

    
write_byte(200

    
message_end() 

    

    
message_begin(MSG_PVSSVC_TEMPENTITYend

    
write_byte(TE_SPARKS

    
write_coord(end[0]) 

    
write_coord(end[1]) 

    
write_coord(end[2]) 

    
message_end() 

    

    
emit_sound(,CHAN_ITEMthunder_sound1.0ATTN_NORM0PITCH_NORM

}  



stock ChatColor(const id, const input[], any:...)

{

        new 
count 1players[32];

        static 
msg[191];

        
vformat(msg190input3);

       

        
replace_all(msg190"!g""^4"); // Green Color

        
replace_all(msg190"!n""^1"); // Default Color

        
replace_all(msg190"!t""^3"); // Team Color

        
replace_all(msg190"!t2""^0"); // Team2 Color

       

        
if (idplayers[0] = id; else get_players(playerscount"ch");

        {

                for (new 
0counti++)

                {

                        if (
is_user_connected(players[i]))

                        {

                                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);

                                
write_byte(players[i]);

                                
write_string(msg);

                                
message_end();

                        }

                }

        }


Thanks .
FonixPro20 is offline
Send a message via ICQ to FonixPro20 Send a message via AIM to FonixPro20 Send a message via Yahoo to FonixPro20 Send a message via Skype™ to FonixPro20
 



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 07:32.


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