Cerere Modificare PlugiN Viteza

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

22 Oct 2013, 18:42

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fun>

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


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
}
public client_putinserver( id )
{
	set_task( 3.0,"Speed",id,_,_,"b" )
}
public client_disconnect( id )
{
	remove_task(id)
}

public Speed(id)
{
	if( is_user_connected( id ) && !is_user_bot( id ) && is_user_alive( id ) )
	{
		new Float:Viteza
		Viteza = get_user_maxspeed( id )
		set_hudmessage(255, 0, 0, 0.25, 0.67, 0, 6.0, 12.0)
		show_hudmessage(id, "Viteza: %f",Viteza)
	}
}
Am urmatorul cod , dar nu functioneaza cum trebuie imi arata in hud ca merg cu 5.0000 s'au ceva de genu' . Rezolvarea care ar fi ?
RoyalServer 2
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times

22 Oct 2013, 22:19

Code: Select all

%f
->

Code: Select all

%2.3f
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

23 Oct 2013, 00:22

Code: Select all

new vVelocity[3];

pev(id, pev_velocity, vVelocity);

set_hudmessage(255, 0, 0, 0.25, 0.67, 0, 6.0, 12.0)
show_hudmessage(id, "Viteza: %d unitati/secunda", floatround(vector_length(vVelocity), floatround_floor))
+

Code: Select all

set_task( 3.0,"Speed",id,_,_,"b" )
->

Code: Select all

set_task( 0.1,"Speed",id,_,_,"b" )
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

23 Oct 2013, 16:30

| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>

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


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
}
public client_putinserver( id )
{
	set_task( 0.1,"Speed",id,_,_,"b" )
}
public client_disconnect( id )
{
	remove_task(id)
}

public Speed(id)
{
	if( is_user_connected( id ) && !is_user_bot( id ) && is_user_alive( id ) )
	{
		new vVelocity[3];

		pev(id, pev_velocity, vVelocity);

		set_hudmessage(255, 0, 0, 0.25, 0.67, 0, 6.0, 12.0)
		show_hudmessage(id, "Viteza: %d unitati/secunda", floatround(vector_length(vVelocity), floatround_floor))
	}
}
Functioneaza foarte bine dar imi da si o eroare la compilare: "Tag mismatch"
Apropo,imi explici si mie ce functie au fiecare,din ce ai folosit tu ?:)
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

23 Oct 2013, 20:34

Code: Select all

new vVelocity[3];
->

Code: Select all

new Float: vVelocity[3];

Code: Select all

pev(id, pev_velocity, vVelocity);
- pev_velocity:
aflii cu cat se deplaseaza un jucator pe cele 3 axe X, Y, Z.

Code: Select all

vVelocity[0] = X;
vVelocity[1] = Y;
vVelocity[2] = Z; (inaltimea)

Code: Select all

floatround(vector_length(vVelocity), floatround_floor))
-floatround:
rotunjesti primul parametru (vector_length(vVelocity)), iar al doilea parametru reprezinta tipul de rotujire (prin adaugare, scadere)
-vector_length:
leaga cele 3 directii X, Y, Z. De exemplu: la o problema de fizica daca ai un plan inclinat si trebuie sa folosesti forta gravitationala, atunci tu o sa imparti acea forta gravitationala in alte 2 forte. Aici e acelasi lucru doar ca sunt 3, nu 2.
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

23 Oct 2013, 20:39

Functioneaza perfect,o sa incerc sa il fac fara task deoarece cand ma opresc sta ceva timp pana ajunge la 000 unitati pentru ca la acel task pierde mereu o sutime.Multumesc frumos.

EDIT: Rap^ am incercat sa fac cu round start ca sa numai fac cu task si nu merge ;)) imi arati tu cum este corect ?:)
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times

23 Oct 2013, 23:30

Foloseste prethink
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
Rap^
Membru, skill +2
Membru, skill +2
Posts: 621
Joined: 01 Oct 2011, 00:25
Detinator Steam: Da
Reputatie: Fost Scripter eXtreamCS
Fost Super moderator
Location: Bucuresti
Has thanked: 16 times
Been thanked: 156 times

23 Oct 2013, 23:46

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

#pragma semicolon 1

static const

	PLUGIN[ ] =		"PLUGIN",
	VERSION[ ] =		"0.0.1",
	AUTHOR[ ] =		"Rap^^";


public plugin_init( )
{
	register_plugin( PLUGIN, VERSION, AUTHOR );
	
	register_forward( FM_PlayerPreThink, "ForwardPreThink" );
}

public ForwardPreThink(id)
{
	if( is_user_alive( id ) )
	{
		new Float: vVelocity[3];

		pev(id, pev_velocity, vVelocity);

		set_hudmessage(255, 0, 0, 0.25, 0.67, 0, 6.0, 12.0);
		show_hudmessage(id, "Viteza: %d unitati/secunda", floatround(vector_length(vVelocity), floatround_floor));
	}
}
Imagination is more important than knowledge.
Knowledge is limited - Imagination encircles the world.
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

24 Oct 2013, 16:09

Mersi,merge si asta ;))
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: Dot [Bot] and 10 guests