Raised This Month: $ Target: $400
 0% 

[Help] csdm spec


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
plazma
Senior Member
Join Date: Oct 2013
Old 10-18-2014 , 06:18   [Help] csdm spec
Reply With Quote #1

When I 'say /cs' work great but not work fine on ' /spec' on much time and I'm dead but not in Spec ScoreBoard why?



PHP Code:
new CsTeams:team[33];
new 
deaths[33];

public 
cmd_spec id )
{
    if( 
is_user_alive(id))
    {
        
deaths[id] = cs_get_user_deaths(id);
        
cs_set_user_deaths(iddeaths[id] - 1);
        
team[id] = cs_get_user_team(id);
        
cs_set_user_team(idCS_TEAM_SPECTATOR);
        
user_silentkill(id);
    }
    
    return 
PLUGIN_HANDLED;

__________________
Free Palestine ♥
plazma is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-18-2014 , 07:44   Re: [Help] csdm spec
Reply With Quote #2

can you please explain more i cant get you
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
plazma
Senior Member
Join Date: Oct 2013
Old 10-18-2014 , 08:03   Re: [Help] csdm spec
Reply With Quote #3

Nothing more ...
__________________
Free Palestine ♥
plazma is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-18-2014 , 08:12   Re: [Help] csdm spec
Reply With Quote #4

Quote:
Originally Posted by plazma View Post
Nothing more ...
i dont get what you need !!! so i cant help you!

and your english sucks~!


Edit : Post the whole code...

Last edited by Natsheh; 10-18-2014 at 08:13.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Decak
Senior Member
Join Date: Sep 2012
Old 10-18-2014 , 08:57   Re: [Help] csdm spec
Reply With Quote #5

Post complete code.
Decak is offline
plazma
Senior Member
Join Date: Oct 2013
Old 10-18-2014 , 10:34   Re: [Help] csdm spec
Reply With Quote #6

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csdm>


new CsTeams:team[33];
new 
deaths[33];

public 
plugin_init()
{
    
register_clcmd("say_team /spec""spec");
    
register_clcmd("say_team /back""back");
    
    
register_clcmd("say /spec""spec");
    
register_clcmd("say /back""back");  
    
    
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET)
}

public 
spec(id)
{
    
    if( 
cs_get_user_team(id) == CS_TEAM_SPECTATOR )
    {
        
client_print(idprint_chat"you are spec now!");
        return 
PLUGIN_HANDLED;
    }

    if( 
is_user_alive(id) )
    {
        
deaths[id] = cs_get_user_deaths(id);
        
cs_set_user_deaths(iddeaths[id] - 1);
    }
        
    
team[id] = cs_get_user_team(id);
    
cs_set_user_teamidCS_TEAM_SPECTATORCS_DONTCHANGE );
    
user_silentkill(id);
        
    return 
PLUGIN_HANDLED;
}

public 
back(id)
{
    if(
team[id])
    {
        
cs_set_user_team(idteam[id]);
        
csdm_respawn(id);
        
client_print(idprint_chat"now are in game");
    }
    else
    {
        
client_print(idprint_chat"not allow");
        return 
PLUGIN_HANDLED;
    }
        
    
team[id] = CS_TEAM_UNASSIGNED;
    
    return 
PLUGIN_HANDLED;

__________________
Free Palestine ♥

Last edited by plazma; 10-19-2014 at 09:56.
plazma is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-18-2014 , 13:23   Re: [Help] csdm spec
Reply With Quote #7

PHP Code:
public back(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    {
        
cs_set_user_team(idteam[id]);
        
csdm_respawn(id);
        
client_print(idprint_chat"now are in game");
    }
    else
    {
        
client_print(idprint_chat"not allow");
        return 
PLUGIN_HANDLED;
    }

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
plazma
Senior Member
Join Date: Oct 2013
Old 10-18-2014 , 14:52   Re: [Help] csdm spec
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
PHP Code:
public back(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    {
        
cs_set_user_team(idteam[id]);
        
csdm_respawn(id);
        
client_print(idprint_chat"now are in game");
    }
    else
    {
        
client_print(idprint_chat"not allow");
        return 
PLUGIN_HANDLED;
    }

My problem is for spec not for /back I say /spec I'm dead in scoreboard but not in Spec Mode only dead u see pic !!!!
__________________
Free Palestine ♥
plazma is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 10-19-2014 , 07:59   Re: [Help] csdm spec
Reply With Quote #9

Quote:
Originally Posted by plazma View Post
My problem is for spec not for /back I say /spec I'm dead in scoreboard but not in Spec Mode only dead u see pic !!!!
why do you need this?

PHP Code:
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET
and this ?

Code:
team[id] = CS_TEAM_UNASSIGNED;

Last edited by Natsheh; 10-19-2014 at 08:07.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Decak
Senior Member
Join Date: Sep 2012
Old 10-19-2014 , 08:25   Re: [Help] csdm spec
Reply With Quote #10

Code has bad optimise..
Decak is offline
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 17:45.


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