AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] csdm spec (https://forums.alliedmods.net/showthread.php?t=250091)

plazma 10-18-2014 06:18

[Help] csdm spec
 
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;


http://i.imgur.com/s1tXpzz.png

Natsheh 10-18-2014 07:44

Re: [Help] csdm spec
 
can you please explain more i cant get you

plazma 10-18-2014 08:03

Re: [Help] csdm spec
 
Nothing more ...

Natsheh 10-18-2014 08:12

Re: [Help] csdm spec
 
Quote:

Originally Posted by plazma (Post 2212515)
Nothing more ...

i dont get what you need !!! so i cant help you!

and your english sucks~!


Edit : Post the whole code...

Decak 10-18-2014 08:57

Re: [Help] csdm spec
 
Post complete code.

plazma 10-18-2014 10:34

Re: [Help] csdm spec
 
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;



Natsheh 10-18-2014 13:23

Re: [Help] csdm spec
 
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;
    }



plazma 10-18-2014 14:52

Re: [Help] csdm spec
 
Quote:

Originally Posted by Natsheh (Post 2212636)
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 !!!!

Natsheh 10-19-2014 07:59

Re: [Help] csdm spec
 
Quote:

Originally Posted by plazma (Post 2212692)
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;

Decak 10-19-2014 08:25

Re: [Help] csdm spec
 
Code has bad optimise..


All times are GMT -4. The time now is 17:45.

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