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(PLUGIN, VERSION, AUTHOR)
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,szTmp, charsmax( szTmp ) )
points[id] = 10;
new szPrefix[64]
format(szPrefix, 63, "^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(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /spec","setSpectate")
}
public setSpectate( id )
{
if(get_cvar_num("surf_allow_spectate") == 1)
{
if( !is_user_alive(id) )
{
cs_set_user_team(id, CS_TEAM_CT, CS_CT_GIGN);
dllfunc(DLLFunc_Spawn, id);
return PLUGIN_HANDLED;
}
else if( is_user_alive(id) )
{
strip_user_weapons(id)
set_pev(id, pev_deadflag, DEAD_DEAD)
}
engclient_cmd(id, "jointeam" , "6") //connormcleod
}
else
{
client_print(id, print_chat, "%L",LANG_PLAYER,"NO_USE")
}
return PLUGIN_HANDLED;
}
__________________