Modificare showkeys

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
R1kKk-
Membru, skill +1
Membru, skill +1
Posts: 178
Joined: 12 Apr 2013, 15:57
Detinator Steam: Da
CS Status: Batman!
Detinator server CS: HNS.JOINET.RO
SteamID: Privat...
Has thanked: 20 times
Been thanked: 17 times
Contact:

19 Dec 2013, 21:11

Salut. Am acest showkeys, este doar pentru spectatori. As vrea sa mi-l modificati ca sa fie si pe comanda pentru cei vii.
Stiu ca sunt multe de genul, insa acesta este live, nu arata ca tii constant daca apesi repede pe taste.
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>

#define PLUGIN 	"key listener"
#define VERSION "0.7"
#define AUTHOR 	"cheap_suit"

new cvar_x
new cvar_y

new g_spectarget[33]
new g_specmode[33]

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
	
	register_event("TextMsg", 	"event_textmsg", 	"b",	"2&#Spec_Mode")
	register_event("StatusValue", 	"event_statusvalue", 	"bd", 	"1=2")
	register_event("SpecHealth2", 	"event_spechealth2", 	"bd")
	register_event("ResetHUD", 	"event_resethud", 	"be")
	
	cvar_x = register_cvar("keylistenhud_x", "-1.0")
	cvar_y = register_cvar("keylistenhud_y", "0.5")
}

public client_connect(id) 	reset(id)
public client_disconnect(id) 	reset(id)
public event_resethud(id) 	reset(id)

public reset(id)
	g_spectarget[id] = 0, g_specmode[id] = false	
	
public event_textmsg(id)
{
	static specmode[12]
	read_data(2, specmode, 11)

	if(equal(specmode, "#Spec_Mode2") || equal(specmode, "#Spec_Mode4"))
		g_specmode[id] = true
	else
		g_specmode[id] = false
	
	return PLUGIN_CONTINUE
}

public event_statusvalue(id)
{
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public event_spechealth2(id)
{
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public set_spec_target(index, target)
{
	if(target > 0)
		g_spectarget[index] = target
}

public fwd_playerpostthink(id)
{
	if(is_user_alive(id) || !g_specmode[id])
		return FMRES_IGNORED
	
	new target = g_spectarget[id]
	if((target < 1) || !is_user_alive(target))
		return FMRES_IGNORED
	
	new button = pev(target, pev_button)
	
	static key[6][6]
	formatex(key[0], 5, "%s", (button & IN_FORWARD) && !(button & IN_BACK) ? " W " : "   ")
	formatex(key[1], 5, "%s", (button & IN_BACK) && !(button & IN_FORWARD) ? " S " : "   ")
	formatex(key[2], 5, "%s", (button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) ? "A" : "   ")
	formatex(key[3], 5, "%s", (button & IN_MOVERIGHT) && !(button & IN_MOVELEFT) ? "D" : "   ")
	formatex(key[4], 5, "%s", (button & IN_DUCK) ? " DUCK " : "      ")
	formatex(key[5], 5, "%s", (button & IN_JUMP) ? " JUMP " : "      ")
	
	set_hudmessage(255, 255, 0, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
	show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5])
	
	return FMRES_IGNORED
}
Multumesc anticipat.
Image Image Image
Rapidserver
User avatar
R1kKk-
Membru, skill +1
Membru, skill +1
Posts: 178
Joined: 12 Apr 2013, 15:57
Detinator Steam: Da
CS Status: Batman!
Detinator server CS: HNS.JOINET.RO
SteamID: Privat...
Has thanked: 20 times
Been thanked: 17 times
Contact:

21 Dec 2013, 16:09

Up careva?
Image Image Image
Askwrite
Moderator ajutator
Moderator ajutator
Posts: 345
Joined: 26 Apr 2013, 20:59
Detinator Steam: Da
CS Status: Scriptez...!
Reputatie: Fost moderator ajutator
Has thanked: 6 times
Been thanked: 55 times
Contact:

22 Dec 2013, 14:21

Showkeys | Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <colorchat>

#define PLUGIN 	"key listener"
#define VERSION "0.7"
#define AUTHOR 	"cheap_suit"

new cvar_x
new cvar_y

new g_spectarget[33]
new g_specmode[33]
new bool:ShowkeysON[33];

public plugin_init()  {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
	
	register_event("TextMsg", 	"event_textmsg", 	"b",	"2&#Spec_Mode")
	register_event("StatusValue", 	"event_statusvalue", 	"bd", 	"1=2")
	register_event("SpecHealth2", 	"event_spechealth2", 	"bd")
	register_event("ResetHUD", 	"event_resethud", 	"be")
	
	cvar_x = register_cvar("keylistenhud_x", "-1.0")
	cvar_y = register_cvar("keylistenhud_y", "0.5")
	
	register_clcmd("say /showkeys","cmdShowkeys");
	register_clcmd("say_team /showkeys","cmdShowkeys");
}

public client_connect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public client_disconnect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public event_resethud(id) {	
	reset(id) 
}

public reset(id) {
	g_spectarget[id] = 0, g_specmode[id] = false	
}

public cmdShowkeys(id) {
	if(!ShowkeysON[id]) {
		ColorChat(id, RED, "[Showkeys] ^4Ai activat showkeys !");
		ShowkeysON[id] = true;
		return PLUGIN_HANDLED
		}else{
		ColorChat(id, RED, "[Showkeys] ^4Ai dezactivat showkeys !");
		ShowkeysON[id] = false;
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
	
}



public event_textmsg(id) {
	static specmode[12]
	read_data(2, specmode, 11)
	
	if(equal(specmode, "#Spec_Mode2") || equal(specmode, "#Spec_Mode4"))
		g_specmode[id] = true
	else
		g_specmode[id] = false
	
	return PLUGIN_CONTINUE
}

public event_statusvalue(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public event_spechealth2(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public set_spec_target(index, target) {
	if(target > 0)
		g_spectarget[index] = target
}

public fwd_playerpostthink(id) {
	if(is_user_alive(id) || !g_specmode[id])
		return FMRES_IGNORED
	if(is_user_alive(id) && ShowkeysON[id]) {
		new target = g_spectarget[id]
		if((target < 1) || !is_user_alive(target))
			return FMRES_IGNORED
		
		new button = pev(target, pev_button)
		
		static key[6][6]
		formatex(key[0], 5, "%s", (button & IN_FORWARD) && !(button & IN_BACK) ? " W " : "   ")
		formatex(key[1], 5, "%s", (button & IN_BACK) && !(button & IN_FORWARD) ? " S " : "   ")
		formatex(key[2], 5, "%s", (button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) ? "A" : "   ")
		formatex(key[3], 5, "%s", (button & IN_MOVERIGHT) && !(button & IN_MOVELEFT) ? "D" : "   ")
		formatex(key[4], 5, "%s", (button & IN_DUCK) ? " DUCK " : "      ")
		formatex(key[5], 5, "%s", (button & IN_JUMP) ? " JUMP " : "      ")
		
		set_hudmessage(255, 255, 0, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
		show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5])
	}
	return FMRES_IGNORED
}
Incearca asa.
Last edited by Askwrite on 22 Dec 2013, 14:44, edited 1 time in total.
User avatar
R1kKk-
Membru, skill +1
Membru, skill +1
Posts: 178
Joined: 12 Apr 2013, 15:57
Detinator Steam: Da
CS Status: Batman!
Detinator server CS: HNS.JOINET.RO
SteamID: Privat...
Has thanked: 20 times
Been thanked: 17 times
Contact:

22 Dec 2013, 14:28

Nu merge..
Image Image Image
Askwrite
Moderator ajutator
Moderator ajutator
Posts: 345
Joined: 26 Apr 2013, 20:59
Detinator Steam: Da
CS Status: Scriptez...!
Reputatie: Fost moderator ajutator
Has thanked: 6 times
Been thanked: 55 times
Contact:

22 Dec 2013, 14:43

| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <colorchat>
#include <cstrike>

#define PLUGIN 	"key listener"
#define VERSION "0.7"
#define AUTHOR 	"cheap_suit"


new cvar_x
new cvar_y

new g_spectarget[33]
new g_specmode[33]
new bool:ShowkeysON[33];

public plugin_init()  {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
	
	register_event("TextMsg", 	"event_textmsg", 	"b",	"2&#Spec_Mode")
	register_event("StatusValue", 	"event_statusvalue", 	"bd", 	"1=2")
	register_event("SpecHealth2", 	"event_spechealth2", 	"bd")
	register_event("ResetHUD", 	"event_resethud", 	"be")
	
	cvar_x = register_cvar("keylistenhud_x", "-1.0")
	cvar_y = register_cvar("keylistenhud_y", "0.6")
	
	register_clcmd("say /showkeys","cmdShowkeys");
	register_clcmd("say_team /showkeys","cmdShowkeys");
}

public client_connect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public client_disconnect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public event_resethud(id) {	
	reset(id) 
}

public reset(id) {
	g_spectarget[id] = 0, g_specmode[id] = false	
}

public cmdShowkeys(id) {
	if(!ShowkeysON[id]) {
		ColorChat(id, RED, "[Showkeys] ^4Ai activat showkeys !");
		ShowkeysON[id] = true;
		return PLUGIN_HANDLED
		}else{
		ColorChat(id, RED, "[Showkeys] ^4Ai dezactivat showkeys !");
		ShowkeysON[id] = false;
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
	
}



public event_textmsg(id) {
	static specmode[12]
	read_data(2, specmode, 11)
	
	if(equal(specmode, "#Spec_Mode2") || equal(specmode, "#Spec_Mode4"))
		g_specmode[id] = true
	else
		g_specmode[id] = false
	
	return PLUGIN_CONTINUE
}

public event_statusvalue(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public event_spechealth2(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public set_spec_target(index, target) {
	if(target > 0)
		g_spectarget[index] = target
}

public fwd_playerpostthink(id) { 
	if(!is_user_alive(id) || g_specmode[id]) {
		new target = g_spectarget[id]
		if((target < 1) || !is_user_alive(target))
			return FMRES_IGNORED
		
		new button = pev(target, pev_button)
		
		static key[6][6]
		formatex(key[0], 5, "%s", (button & IN_FORWARD) && !(button & IN_BACK) ? " W " : "   ")
		formatex(key[1], 5, "%s", (button & IN_BACK) && !(button & IN_FORWARD) ? " S " : "   ")
		formatex(key[2], 5, "%s", (button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) ? "A" : "   ")
		formatex(key[3], 5, "%s", (button & IN_MOVERIGHT) && !(button & IN_MOVELEFT) ? "D" : "   ")
		formatex(key[4], 5, "%s", (button & IN_DUCK) ? " DUCK " : "      ")
		formatex(key[5], 5, "%s", (button & IN_JUMP) ? " JUMP " : "      ")
		
		set_hudmessage(255, 10, 150, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
		show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5])
	}
	else if(is_user_alive(id) && ShowkeysON[id]) {
		if((id < 1) || !is_user_alive(id))
			return FMRES_IGNORED
		
		new buttonkey = pev(id, pev_button)
		
		static keybutton[6][6]
		formatex(keybutton[0], 5, "%s", (buttonkey & IN_FORWARD) && !(buttonkey & IN_BACK) ? " W " : "   ")
		formatex(keybutton[1], 5, "%s", (buttonkey & IN_BACK) && !(buttonkey & IN_FORWARD) ? " S " : "   ")
		formatex(keybutton[2], 5, "%s", (buttonkey & IN_MOVELEFT) && !(buttonkey & IN_MOVERIGHT) ? "A" : "   ")
		formatex(keybutton[3], 5, "%s", (buttonkey & IN_MOVERIGHT) && !(buttonkey & IN_MOVELEFT) ? "D" : "   ")
		formatex(keybutton[4], 5, "%s", (buttonkey & IN_DUCK) ? " DUCK " : "      ")
		formatex(keybutton[5], 5, "%s", (buttonkey & IN_JUMP) ? " JUMP " : "      ")
		
		set_hudmessage(255, 10, 150, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
		show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", keybutton[0], keybutton[2], keybutton[1], keybutton[3], keybutton[4], keybutton[5])
	}
	return FMRES_IGNORED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3081\\ f0\\ fs16 \n\\ par }
*/
Last edited by Askwrite on 22 Dec 2013, 16:02, edited 1 time in total.
User avatar
R1kKk-
Membru, skill +1
Membru, skill +1
Posts: 178
Joined: 12 Apr 2013, 15:57
Detinator Steam: Da
CS Status: Batman!
Detinator server CS: HNS.JOINET.RO
SteamID: Privat...
Has thanked: 20 times
Been thanked: 17 times
Contact:

22 Dec 2013, 14:52

AskWrite wrote:
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>
#include <colorchat>
#include <cstrike>

#define PLUGIN 	"key listener"
#define VERSION "0.7"
#define AUTHOR 	"cheap_suit"


new cvar_x
new cvar_y

new g_spectarget[33]
new g_specmode[33]
new bool:ShowkeysON[33];

public plugin_init()  {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_forward(FM_PlayerPostThink, "fwd_playerpostthink")
	
	register_event("TextMsg", 	"event_textmsg", 	"b",	"2&#Spec_Mode")
	register_event("StatusValue", 	"event_statusvalue", 	"bd", 	"1=2")
	register_event("SpecHealth2", 	"event_spechealth2", 	"bd")
	register_event("ResetHUD", 	"event_resethud", 	"be")
	
	cvar_x = register_cvar("keylistenhud_x", "-1.0")
	cvar_y = register_cvar("keylistenhud_y", "0.6")
	
	register_clcmd("say /showkeys","cmdShowkeys");
	register_clcmd("say_team /showkeys","cmdShowkeys");
}

public client_connect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public client_disconnect(id) {	
	reset(id) 
	ShowkeysON[id] = false;
}
public event_resethud(id) {	
	reset(id) 
}

public reset(id) {
	g_spectarget[id] = 0, g_specmode[id] = false	
}

public cmdShowkeys(id) {
	if(!ShowkeysON[id]) {
		ColorChat(id, RED, "[Showkeys] ^4Ai activat showkeys !");
		ShowkeysON[id] = true;
		return PLUGIN_HANDLED
		}else{
		ColorChat(id, RED, "[Showkeys] ^4Ai dezactivat showkeys !");
		ShowkeysON[id] = false;
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
	
}



public event_textmsg(id) {
	static specmode[12]
	read_data(2, specmode, 11)
	
	if(equal(specmode, "#Spec_Mode2") || equal(specmode, "#Spec_Mode4"))
		g_specmode[id] = true
	else
		g_specmode[id] = false
	
	return PLUGIN_CONTINUE
}

public event_statusvalue(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public event_spechealth2(id) {
	if(is_user_connected(id) && !is_user_alive(id))
		set_spec_target(id, read_data(2))
}

public set_spec_target(index, target) {
	if(target > 0)
		g_spectarget[index] = target
}

public fwd_playerpostthink(id) { 
	if(!is_user_alive(id) || g_specmode[id]) {
		new target = g_spectarget[id]
		if((target < 1) || !is_user_alive(target))
			return FMRES_IGNORED
		
		new button = pev(target, pev_button)
		
		static key[6][6]
		formatex(key[0], 5, "%s", (button & IN_FORWARD) && !(button & IN_BACK) ? " W " : "   ")
		formatex(key[1], 5, "%s", (button & IN_BACK) && !(button & IN_FORWARD) ? " S " : "   ")
		formatex(key[2], 5, "%s", (button & IN_MOVELEFT) && !(button & IN_MOVERIGHT) ? "A" : "   ")
		formatex(key[3], 5, "%s", (button & IN_MOVERIGHT) && !(button & IN_MOVELEFT) ? "D" : "   ")
		formatex(key[4], 5, "%s", (button & IN_DUCK) ? " DUCK " : "      ")
		formatex(key[5], 5, "%s", (button & IN_JUMP) ? " JUMP " : "      ")
		
		set_hudmessage(255, 10, 150, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
		show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", key[0], key[2], key[1], key[3], key[4], key[5])
	}
	else if(is_user_alive(id) && ShowkeysON[id]) {
		if((id < 1) || !is_user_alive(id))
			return FMRES_IGNORED
		
		new buttonkey = pev(id, pev_button)
		
		static keybutton[6][6]
		formatex(keybutton[0], 5, "%s", (buttonkey & IN_FORWARD) && !(buttonkey & IN_BACK) ? " W " : "   ")
		formatex(keybutton[1], 5, "%s", (buttonkey & IN_BACK) && !(buttonkey & IN_FORWARD) ? " S " : "   ")
		formatex(keybutton[2], 5, "%s", (buttonkey & IN_MOVELEFT) && !(buttonkey & IN_MOVERIGHT) ? "A" : "   ")
		formatex(keybutton[3], 5, "%s", (buttonkey & IN_MOVERIGHT) && !(buttonkey & IN_MOVELEFT) ? "D" : "   ")
		formatex(keybutton[4], 5, "%s", (buttonkey & IN_DUCK) ? " DUCK " : "      ")
		formatex(keybutton[5], 5, "%s", (buttonkey & IN_JUMP) ? " JUMP " : "      ")
		
		set_hudmessage(255, 10, 150, get_pcvar_float(cvar_x), get_pcvar_float(cvar_y), 0, _, 0.1, _, _, 1)
		show_hudmessage(id, "%s^n%s %s %s^n^n%s %s", keybutton[0], keybutton[2], keybutton[1], keybutton[3], keybutton[4], keybutton[5])
	}
	return FMRES_IGNORED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3081\\ f0\\ fs16 \n\\ par }
*/
Merci, ai un os :)
Image Image Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests