Raised This Month: $ Target: $400
 0% 

Reliable Channel/Remove Nick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extream87
Senior Member
Join Date: Aug 2011
Old 08-22-2013 , 18:41   Reliable Channel/Remove Nick
Reply With Quote #1

Bellow is not the full code, but serves for what i want explain.

I want remove from the admins name g_Teamscore[nCT], g_Teamscore[nT] when the map change.

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "1.0" #define AUTHOR "author" #define ACCESS_LEVEL ADMIN_LEVEL_C new pname[100] new stname[100] new newname[70] new bool:bl new g_pSwitchAfter public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_logevent( "LogeventEndRound", 2, "1=Round_End" )     register_clcmd("say .uname15555555u", "name15", ACCESS_LEVEL)     register_clcmd("say .uname15555555us", "name15end", ACCESS_LEVEL)     register_clcmd("say .d2", "d2", ACCESS_LEVEL)     g_pSwitchAfter = register_cvar( "amx_swap", "1" );     register_clcmd("say .live", "live", ACCESS_LEVEL) } public LogeventEndRound(id) {           if (bl == true)     {     if( ++g_iRounds >= 2 && get_pcvar_num ( g_pSwitchAfter ))     {     client_cmd(0,"say .uname15555555u")     new iPlayers[ 32 ], iNum, iPlayer     get_players( iPlayers, iNum )             for ( new a = 0; a < iNum; a++ )     {             iPlayer = iPlayers[ a ];                         switch ( cs_get_user_team( iPlayer ) )             {                 case CS_TEAM_T: cs_set_user_team( iPlayer, CS_TEAM_CT )                 case CS_TEAM_CT: cs_set_user_team( iPlayer, CS_TEAM_T )             }         }     }     } } public live(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {         bl = true     } } public d2(id) {     name15end(id)     server_cmd( "changelevel de_dust2" ) } public name15(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {     get_user_info(id, "name", pname, 49)     get_user_info(id, "name", stname, 49)         format(newname, 300, "%s %d-%d", pname, g_Teamscore[nCT], g_Teamscore[nT])     set_user_info(id, "name", newname)     } } public name15end(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {       set_user_info(id, "name", stname)     } } public client_disconnect(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {     name15end(id)     } }

Last edited by extream87; 08-22-2013 at 19:36.
extream87 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-22-2013 , 20:39   Re: Reliable Channel/Remove Nick
Reply With Quote #2

simply removing the score from name...

Code:
public name15(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {     get_user_info(id, "name", pname, 49)     get_user_info(id, "name", stname, 49)         format(newname, 300, "%s", pname)     set_user_info(id, "name", newname)     } }

but then there is no reason for function name15( id ) or name15end( id )
__________________
Blizzard_87 is offline
extream87
Senior Member
Join Date: Aug 2011
Old 08-22-2013 , 20:44   Re: Reliable Channel/Remove Nick
Reply With Quote #3

But i need to set the score in name cause im gonna use if round=15 the teams change and i want set the score in the admin names.
(This case is not seted to 15 is seted 2)

Last edited by extream87; 08-22-2013 at 20:48.
extream87 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-22-2013 , 20:58   Re: Reliable Channel/Remove Nick
Reply With Quote #4

Quote:
Originally Posted by extream87 View Post
But i need to set the score in name cause im gonna use if round=15 the teams change and i want set the score in the admin names.
(This case is not seted to 15 is seted 2)
no idea what your on about...

but try this

Code:
    if( ++g_iRounds >= 2 && get_pcvar_num ( g_pSwitchAfter ))

to this

Code:
    if( ++g_iRounds >= 15 && get_pcvar_num ( g_pSwitchAfter ))
__________________
Blizzard_87 is offline
extream87
Senior Member
Join Date: Aug 2011
Old 08-22-2013 , 21:09   Re: Reliable Channel/Remove Nick
Reply With Quote #5

LOL.

Well, this set the name+score.
Code:
public name15(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {     get_user_info(id, "name", pname, 49)     get_user_info(id, "name", stname, 49)         format(newname, 300, "%s %d-%d", pname, g_Teamscore[nCT], g_Teamscore[nT])     set_user_info(id, "name", newname)     } }

And for put again the normal nick without score?

Last edited by extream87; 08-22-2013 at 21:09.
extream87 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 08-22-2013 , 21:26   Re: Reliable Channel/Remove Nick
Reply With Quote #6

this function already resets player( admins ) name
Code:
public name15end(id) {     if (get_user_flags(id) & ACCESS_LEVEL)     {       set_user_info(id, "name", stname)     } }

but i dont know why your variable string length is 100... players name can only go as long as 32 characters
__________________
Blizzard_87 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-23-2013 , 00:58   Re: Reliable Channel/Remove Nick
Reply With Quote #7

Try this

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
#define ACCESS_LEVEL ADMIN_LEVEL_C

new pname[32][32
new 
stname[32][32
new 
newname[32][40]
new 
bool:bl
new g_pSwitchAfter
new g_iRounds
new maxplayers

enum
{
    
nT,
    
nCT
}

new 
g_Teamscore[2]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_logevent"LogeventEndRound"2"1=Round_End" 
    
register_clcmd("say .uname15555555u""name15"ACCESS_LEVEL)
    
register_clcmd("say .uname15555555us""name15end"ACCESS_LEVEL)
    
register_clcmd("say .d2""d2"ACCESS_LEVEL)
    
g_pSwitchAfter register_cvar"amx_swap""1" );
    
register_clcmd("say .live""live"ACCESS_LEVEL)
    
maxplayers get_maxplayers()
}

public 
LogeventEndRound(id)
{      
    if (
bl == true)
    {
        if( ++
g_iRounds >= 15 && get_pcvar_num g_pSwitchAfter ))
        {

            new 
iPlayers32 ], iNumiPlayer
            get_players
iPlayersiNum "h" )
                
            for ( new 
0iNuma++ )
            {
                
iPlayer iPlayers];

                
name15iPlayerACCESS_LEVEL );
                switch ( 
cs_get_user_teamiPlayer ) )
                {
                    case 
CS_TEAM_Tcs_set_user_teamiPlayerCS_TEAM_CT )
                    case 
CS_TEAM_CTcs_set_user_teamiPlayerCS_TEAM_T )
                }
            }
        }
    }
}

public 
live(idlevel)
{
    if( 
access(idlevel) )
    {
        
bl true
        g_iRounds 
0
    
}
}

public 
d2(idlevel)
{
    if( 
access(idlevel) )
    {
        
name15end(idlevel)
        
server_cmd"changelevel de_dust2" )
    }
}

public 
name15(idlevel)
{
    if( 
access(idlevel) )
    {
        
get_user_info(id"name"pname[id], charsmax(pname[]))
        
get_user_info(id"name"stname[id], charsmax(stname[]))
        
        
formatex(newname[id], charsmax(newname[]), "%s %d-%d"pname[id], g_Teamscore[nCT], g_Teamscore[nT])
        
set_user_info(id"name"newname[id])
    }


public 
name15end(idlevel)
{
    if( 
access(idlevel) )
    {  
        
set_user_info(id"name"stname[id])
    }
}

public 
plugin_end()
{
    for(new 
id=1id<=maxplayersid++)
    {
        if( 
pev_valid(id) == )
        {
            
engfunc(EngFunc_SetClientKeyValueidengfunc(EngFunc_GetInfoKeyBufferid), "name"stname[id])
        }
    }
}

// THIS IS USELESS
// public client_disconnect(id) 
// {
    // if (get_user_flags(id) & ACCESS_LEVEL)
    // {
        // name15end(id)
    // }
// } 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
extream87
Senior Member
Join Date: Aug 2011
Old 08-23-2013 , 06:57   Re: Reliable Channel/Remove Nick
Reply With Quote #8

ConnorMcLeod i really aprecciate your help thanks .

Can you tell me one more thing plz. After change teams in 15 rounds how i can set the value of g_Teamscore[nCT], g_Teamscore[nT]) to g_Teamscore2[nCT], g_Teamscore2[nT]) to continue count in secont part?

Next im gonna try to do: if g_Teamscore2[nCT] = 16 chat_print... CT Team Win the match.

Last edited by extream87; 08-23-2013 at 08:16.
extream87 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-23-2013 , 11:16   Re: Reliable Channel/Remove Nick
Reply With Quote #9

You are asking for really basic stuff, if you don't know basic stuff, learn more and ask for people to make full plugins, in suggestion/request forum.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
seriousspot
BANNED
Join Date: Mar 2013
Location: Lithuania / Norway
Old 08-23-2013 , 21:00   Re: Reliable Channel/Remove Nick
Reply With Quote #10

its slowhacking method, why just don't display score instead of changing client's name with score?
seriousspot 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 18:47.


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