Raised This Month: $ Target: $400
 0% 

Need help of player custom tag in say.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-21-2010 , 06:43   Need help of player custom tag in say.
Reply With Quote #1

Here is my code, I already lost in here.
I hope someone can complete my code.
1.I want player can use say /tag XXX to change his tag.
2.If a player tag length is more then the define, show him a message.
3.If a player who had tag before and he use /tag again, then replace the the tag in the file.
4.Player tag will save into a file by name.
Thanks all!

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN	"Basic Chat Format"
#define VERSION	"1.0"
#define AUTHOR	"WS.Chu:)"

#define SzTag "[None]"
#define SzTagLnegth 6

new SzPlayers[33][32]
new SzNum[33]
new SzLevels[33]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say", "hook_say")
}

public hook_say(id)
{
	new chat[192]
	read_args(chat, 191)
	remove_quotes(chat)
	
	new name[64], message[256]
	get_user_name(id, name, 63)
	
	new CsTeams:userteam =cs_get_user_team(id)
	if(equal(chat, ""))
		return PLUGIN_HANDLED_MAIN
	
	if(get_user_flags(id) & ADMIN_LEVEL_A)
	{
		SzLevels = "[ADMIN_A]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_B)
	{
		SzLevels = "[ADMIN_B]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_C)
	{
		SzLevels = "[ADMIN_C]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_D)
	{
		SzLevels = "[VIP]"
	}
	else
	{
		SzLevels = "[Player]"
	}
	
	if (!equal(name, SzTag, SzTagLnegth))
	{
		if (is_user_alive(id))
		{
			format(message, 255, "^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
			else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
		{
			format(message, 255, "^x01*DEAD* ^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
			else 
		{
			format(message, 255, "^x01*SPEC* ^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
	}
	return PLUGIN_HANDLED
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-21-2010 , 13:31   Re: Need help of player custom tag in say.
Reply With Quote #2

Quote:
Originally Posted by GarbageBox View Post
Here is my code, I already lost in here.
I hope someone can complete my code.
1.I want player can use say /tag XXX to change his tag.
2.If a player tag length is more then the define, show him a message.
3.If a player who had tag before and he use /tag again, then replace the the tag in the file.
4.Player tag will save into a file by name.
Thanks all!

Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN	"Basic Chat Format"
#define VERSION	"1.0"
#define AUTHOR	"WS.Chu:)"

#define SzTag "[None]"
#define SzTagLnegth 6

new SzPlayers[33][32]
new SzNum[33]
new SzLevels[33]

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("say", "hook_say")
}

public hook_say(id)
{
	new chat[192]
	read_args(chat, 191)
	remove_quotes(chat)
	
	new name[64], message[256]
	get_user_name(id, name, 63)
	
	new CsTeams:userteam =cs_get_user_team(id)
	if(equal(chat, ""))
		return PLUGIN_HANDLED_MAIN
	
	if(get_user_flags(id) & ADMIN_LEVEL_A)
	{
		SzLevels = "[ADMIN_A]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_B)
	{
		SzLevels = "[ADMIN_B]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_C)
	{
		SzLevels = "[ADMIN_C]"
	}
	else
	if(get_user_flags(id) & ADMIN_LEVEL_D)
	{
		SzLevels = "[VIP]"
	}
	else
	{
		SzLevels = "[Player]"
	}
	
	if (!equal(name, SzTag, SzTagLnegth))
	{
		if (is_user_alive(id))
		{
			format(message, 255, "^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
			else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
		{
			format(message, 255, "^x01*DEAD* ^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
			else 
		{
			format(message, 255, "^x01*SPEC* ^x04%s %s ^x03%s ^x01: %s", SzLevels, SzTag, name, chat)
			color_chat(0, id, message)
		}
	}
	return PLUGIN_HANDLED
}
No one is gonna "Complete" your code. This is scripting help, not "Do everything I want you to FOR me."
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Reply


Thread Tools
Display Modes

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 21:51.


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