Raised This Month: $ Target: $400
 0% 

saytext and /spec problem


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 01-09-2013 , 03:54   saytext and /spec problem
Reply With Quote #1

Here is my code
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

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


new points[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /rank","check")
    
register_message(get_user_msgid("SayText"),"handleSayText");

}

public 
handleSayText(msgId,msgDest,msgEnt)
{
    new 
id get_msg_arg_int(1);
    if(!
is_user_connected(id))      return PLUGIN_CONTINUE;
    new 
szTmp[256],szTmp2[256];
    
get_msg_arg_string(2,szTmpcharsmaxszTmp ) )
        
    
points[id] = 10;
    new 
szPrefix[64]
    
format(szPrefix63"^x04(%i)",points[id])
    
//new szPrefix[64] = "^x04[VIP]";
        
    
if(!equal(szTmp,"#Cstrike_Chat_All"))
    {        
        
add(szTmp2,charsmax(szTmp2),szPrefix);
        
add(szTmp2,charsmax(szTmp2)," ");
        
add(szTmp2,charsmax(szTmp2),szTmp);//msg
        
    
}
    else if(
equal(szTmp,"#Cstrike_Chat_AllSpec"))// || ( equal(szTmp, "#Cstrike_Chat_Spec") ) )
    
{
        
add(szTmp2,charsmax(szTmp2),szPrefix);
        
add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01: %s2");        
    }
        
add(szTmp2,charsmax(szTmp2),szPrefix);
        
add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01: %s2");
    }
        
    
set_msg_arg_string(2,szTmp2);
        
     
    return 
PLUGIN_CONTINUE;

On my server everyone can see every message from every player. This code works fine, unless I go spectator, then when someone alive is writing, tag won't show up and vice versa. I've tried many things and couldn't get it to work, how do I fix this?

Also I've got another problem.
I've found this code http://forums.alliedmods.net/showpos...61&postcount=7
It was working fine but I've discovered that going spec sometimes blocks the player that I am spectating, it's like I spawn inside spectated player and he can't move. After player is blocked this way it says enemy: playername like he was aiming at me.

Here is the code i'm using right now
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fun>

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

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /spec","setSpectate")

}

public 
setSpectateid 
{

    if(
get_cvar_num("surf_allow_spectate") == 1)
    {
        if( !
is_user_alive(id) ) 
        {
            
cs_set_user_team(idCS_TEAM_CTCS_CT_GIGN);
            
dllfunc(DLLFunc_Spawnid);
            return 
PLUGIN_HANDLED;
        }
        else if( 
is_user_alive(id) ) 
        {         
            
strip_user_weapons(id
            
set_pev(idpev_deadflagDEAD_DEAD
        } 
        
engclient_cmd(id"jointeam" "6"//connormcleod
    
}
    else
    {
        
client_print(idprint_chat"%L",LANG_PLAYER,"NO_USE")
    }
    return 
PLUGIN_HANDLED;

__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
 



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 13:43.


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