PLUGIN

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
AL[e]X112
Membru, skill +1
Membru, skill +1
Posts: 182
Joined: 03 Jun 2012, 19:26
Detinator Steam: Da
CS Status: ...
Detinator server CS: DA
Has thanked: 13 times
Contact:

08 Jul 2012, 14:16

Salut doresc si eu pluginul speedometer,eu am sma-ul dar dar la mine apare alba culoarea,dar eu vreau sa fie rosie:

Code: Select all

#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Speedometer"
#define VERSION "1.2"
#define AUTHOR "AciD"

#define FREQ 0.1

new bool:plrSpeed[33]

new TaskEnt,SyncHud,showspeed,color, maxplayers, r, g, b

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
	register_forward(FM_Think, "Think")
	
	TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))	
	set_pev(TaskEnt, pev_classname, "speedometer_think")
	set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
	
	register_clcmd("say /speed", "toogleSpeed")
	
	showspeed = register_cvar("showspeed", "1")
	color = register_cvar("speed_colors", "255 255 255")
	
	SyncHud = CreateHudSyncObj()
	
	maxplayers = get_maxplayers()
	
	new colors[16], red[4], green[4], blue[4]
	get_pcvar_string(color, colors, sizeof colors - 1)
	parse(colors, red, 3, green, 3, blue, 3)
	r = str_to_num(red)
	g = str_to_num(green)
	b = str_to_num(blue)
}

public Think(ent)
{
	if(ent == TaskEnt) 
	{
		SpeedTask()
		set_pev(ent, pev_nextthink,  get_gametime() + FREQ)
	}
}

public client_putinserver(id)
{
	plrSpeed[id] = showspeed > 0 ? true : false
}

public toogleSpeed(id)
{
	plrSpeed[id] = plrSpeed[id] ? false : true
	return PLUGIN_HANDLED
}

SpeedTask()
{
	static i, target
	static Float:velocity[3]
	static Float:speed, Float:speedh
	
	for(i=1; i<=maxplayers; i++)
	{
		if(!is_user_connected(i)) continue
		if(!plrSpeed[i]) continue
		
		target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
		pev(target, pev_velocity, velocity)

		speed = vector_length(velocity)
		speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
		
		set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
		ShowSyncHudMsg(i, SyncHud, "%3.2f km/h^n%3.2f viteza", speed, speedh)
	}
}
Si un plugin care face urmoatoarea chestie:
Image
Si un plugin care vezi ce pe butoane apasa cel pe care te uit da sa apara ca in imaginea asta :
Image
http://WWW.DEAGLE.RO/forum
CONNECT CS.DEAGLE.RO
User avatar
J3FF
Membru, skill +1
Membru, skill +1
Posts: 472
Joined: 27 Oct 2007, 19:02
Detinator Steam: Nu
CS Status: ON and Ready 2 PLAY
Detinator server CS: Nu
Location: SiBiU
Has thanked: 25 times
Been thanked: 39 times
Contact:

08 Jul 2012, 14:39

1.
| Afiseaza codul
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Speedometer"
#define VERSION "1.2"
#define AUTHOR "AciD"

#define FREQ 0.1

new bool:plrSpeed[33]

new TaskEnt,SyncHud,showspeed,color, maxplayers, r, g, b

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   register_cvar("AcidoX", "Speedometer 1.1", FCVAR_SERVER)
   register_forward(FM_Think, "Think")
   
   TaskEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))   
   set_pev(TaskEnt, pev_classname, "speedometer_think")
   set_pev(TaskEnt, pev_nextthink, get_gametime() + 1.01)
   
   register_clcmd("say /speed", "toogleSpeed")
   
   showspeed = register_cvar("showspeed", "1")
   color = register_cvar("speed_colors", "255 0 0")
   
   SyncHud = CreateHudSyncObj()
   
   maxplayers = get_maxplayers()
   
   new colors[16], red[4], green[4], blue[4]
   get_pcvar_string(color, colors, sizeof colors - 1)
   parse(colors, red, 3, green, 3, blue, 3)
   r = str_to_num(red)
   g = str_to_num(green)
   b = str_to_num(blue)
}

public Think(ent)
{
   if(ent == TaskEnt) 
   {
      SpeedTask()
      set_pev(ent, pev_nextthink,  get_gametime() + FREQ)
   }
}

public client_putinserver(id)
{
   plrSpeed[id] = showspeed > 0 ? true : false
}

public toogleSpeed(id)
{
   plrSpeed[id] = plrSpeed[id] ? false : true
   return PLUGIN_HANDLED
}

SpeedTask()
{
   static i, target
   static Float:velocity[3]
   static Float:speed, Float:speedh
   
   for(i=1; i<=maxplayers; i++)
   {
      if(!is_user_connected(i)) continue
      if(!plrSpeed) continue
      
      target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
      pev(target, pev_velocity, velocity)

      speed = vector_length(velocity)
      speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
      
      set_hudmessage(r, g, b, -1.0, 0.7, 0, 0.0, FREQ, 0.01, 0.0)
      ShowSyncHudMsg(i, SyncHud, "%3.2f km/h^n%3.2f viteza", speed, speedh)
   }
}


2. http://forums.alliedmods.net/showthread.php?p=100362

3. http://forums.alliedmods.net/showthread.php?p=484967
Unii ma mai stiu de e t n a d

Image
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 29 guests