Raised This Month: $51 Target: $400
 12% 

[SOLUCIONADO] Time Projector (hud menssage)


  
 
 
Thread Tools Display Modes
Author Message
Erater
Junior Member
Join Date: Aug 2013
Old 08-07-2013 , 15:57   [SOLUCIONADO] Time Projector (hud menssage)
#1

Bueno antes que nada aclarar que es la primera vez que me registro en el foro..

Bueno tal vez lo que les voy a pedir para ustedes sea muy sencillo de hacer pero yo recien estoy comenzando y no pude realizarlo...

Bien me baje el Time Projector

Este es el Code:

Quote:
OFF:
(No saben lo que estuve para hacer este post, debido a que no encontraba un fucking proxy que me permita usar las herramientas del foro para enlazar este codigo PHP! - Si soy Argentino, pero no del lado oscuro (? malisimo pero por ahi lo entienden jaja)
PHP Code:
/* 
*  AMX X Mod script. 

* (c) Copyright 2003, ST4life 
* Remade by TaL
* This file is provided as is (no warranties). 
*/ 

#include <amxmodx> 

/* 
* TimeProjector displays the remaining time and the next map on the top right corner of the client 
* display as a hudmessage. 

* History: 

* v0.1: - first release 
*/ 


public show_timer(){ 
    new 
nextmap[32
    
get_cvar_string("amx_nextmap",nextmap,31
    new 
timeleft get_timeleft() 
    
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213
    
show_hudmessage(0,"Tiempo restante: %d:%02d^nProximo Mapa: %s",timeleft 60timeleft 60,nextmap
    return 
PLUGIN_CONTINUE 


public 
plugin_init() 

    
register_plugin("TimeProjector","0.1","ST4life"
    
set_task(1.0"show_timer",0,"",0,"b"
    return 
PLUGIN_CONTINUE 

Gracias a Tor
---------------------
Bueno.. Quisiera saber como agregarle una opcion "say" y "team_say" para que esconda o muestre el hud cuando el usuario quiera, algo similar al uq_jumpstats cuando colocamos /jof y nos marca el jumpof, etc y si lo volvemos a colocar se desactiva, mostrandonos un mensaje "Disabled".

Bueno me gustaria hacer que cuando el usuario coloque /timeoff se deshabilite y si lo volvemos a poner se habilite o para que se habilite colocar /timeon . A su vez que cada cierto tiempo mande un mensaje al server diciendo "Te molesta el HUD del Tiempo? puede deshabilitarlo colocando "comando" o bien habilitarlo colocando "comando".

Espero haberme explicado bien. Y desde ya gracias por su ayuda.

Last edited by Erater; 08-08-2013 at 15:08. Reason: SOLUCIONADO
Erater is offline
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 08-07-2013 , 16:11   Re: [PEDIDO] Time Projector (hud menssage)
#2

Podrías crear una variable, setearle cada vez que el usuario escriba las cosas, ej.

PHP Code:
new g_hud[33]

//code
public plugin_init()
{
    
register_clcmd("say /time""time")
}

public 
time(id)
{
    (
g_hud[id] == 1) ? (g_hud[id] = 0) : (g_hud[id] = 1)
    
    if (
g_hud[id] <= 0)
        
client_print(idprint_chat"Desactivado")
    else
        
client_print(idprint_chat"Activado")
}
// Cambias el viejo por esto que te voy a poner..
public show_timer(){ 
    new 
nextmap[32
    
get_cvar_string("amx_nextmap",nextmap,31
    new 
timeleft get_timeleft()
    if (
g_hud[id] >= 1) {
        
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213
        
show_hudmessage(0,"Tiempo restante: %d:%02d^nProximo Mapa: %s",timeleft 60timeleft 60,nextmap)
    } 
    return 
PLUGIN_CONTINUE 

Te explico, ya que sos nuevo. Lo que hice fue crear una variable, y al decir /time, SOLO POR SAY,
la variable va cambiando, originalmente empieza en 0, entonces puse, si es 0, le pones 1 y viceversa.

Al hacer esto, hice que te diga si desactiva o activa, y cree un simple if, para mostrar el hud. Ahora si vos queres con /timeoff y /timeon es otra cosa.
__________________
Quote:
Originally Posted by YakumoHiratsuhi View Post
@DiegoCS
No sé talvez solo sea yo, pero tu me caes mal campeón.


JAJAJAJAJAJAJAJAJA

Quote:
Originally Posted by meTaLiCroSS View Post
Con 12 años quien no habla mierda detras de un PC, esperate a que te diga algo en persona jajajajaj VIVO DE AHI NO SALE JAJAJA

Last edited by Matians; 08-07-2013 at 16:12.
Matians is offline
DiegoCS
Senior Member
Join Date: Mar 2013
Old 08-07-2013 , 16:20   Re: [PEDIDO] Time Projector (hud menssage)
#3

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

new g_onoff[33]
public 
show_timer(id){ 
    if (
g_onoff[id] == 0) return PLUGIN_HANDLED;
    else if (
g_onoff[id] == 1) return PLUGIN_CONTINUE;

    new 
nextmap[32
    
get_cvar_string("amx_nextmap",nextmap,31
    new 
timeleft get_timeleft() 
    
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213
    
show_hudmessage(0,"Tiempo restante: %d:%02d^nProximo Mapa: %s",timeleft 60timeleft 60,nextmap
    return 
PLUGIN_CONTINUE;


public 
plugin_init() { 
    
register_plugin("TimeProjector","0.1","ST4life")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_clcmd("say /time""timeonoff")
    
register_clcmd("say_team /time""timeonoff")
    
set_task(1.0"show_timer",0,"",0,"b")
    return 
PLUGIN_CONTINUE 


public 
timeonoff(id) {
    if (
g_onoff[id] == 1) {
        
g_onoff[id] = 0
        client_print
(idprint_chat"Time: Off")
    }
    else if (
g_onoff[id] == 0) {
        
g_onoff[id] = 1
        client_print
(idprint_chat"Time: On")
    }
}

public 
client_putinserver(idg_onoff[id] = 1

public event_round_start() {
        
client_print(0print_center"Te molesta el HUD del Tiempo? puede deshabilitarlo colocando /time")


Last edited by DiegoCS; 08-07-2013 at 18:00.
DiegoCS is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 08-07-2013 , 16:34   Re: [PEDIDO] Time Projector (hud menssage)
#4

Quote:
Originally Posted by DiegoCS View Post
PHP Code:
#include <amxmodx> 
#include <amxmisc>

new g_onoff[33], g_maxplayers
public show_timer(){ 
    if (
g_onoff[id] == 0) return;

    new 
nextmap[32
    
get_cvar_string("amx_nextmap",nextmap,31
    new 
timeleft get_timeleft() 
    
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213
    
show_hudmessage(0,"Tiempo restante: %d:%02d^nProximo Mapa: %s",timeleft 60timeleft 60,nextmap
    return 
PLUGIN_CONTINUE 


public 
plugin_init() { 
    
register_plugin("TimeProjector","0.1","ST4life")
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_clcmd("say /time""timeonoff")
    
register_clcmd("say_team /time""timeonoff")
    
set_task(1.0"show_timer",0,"",0,"b")
    
g_maxplayers get_maxplayers()
    return 
PLUGIN_CONTINUE 


public 
timeonoff(id) {
    if (
g_onoff[id] == 1) {
        
g_onoff[id] = 0
        client_print
(idprint_chat"Time: Off")
    }
    else if (
g_onoff[id] == 0) {
        
g_onoff[id] = 1
        client_print
(idprint_chat"Time: On")
    }
}

public 
client_putinserver(idg_onoff[id] = 1

public event_round_start() 
        for (new 
i=1<= g_maxplayersi++)
        
client_print(iprint_center"Te molesta el HUD del Tiempo? puede deshabilitarlo colocando /time"
en serio vendes plugins? ...

El plugin que posteaste no va a compilar ni siquiera si lo forzas a emitir los errores.

public show_timer() no está definido el id
public event_round_start() te faltan las llaves
for (new i=1; i <= g_maxplayers; i++) un for para mostrarle un mensaje a todos los jugadores?
client_print(0, print_chat, ...
__________________
ILUSION is offline
DiegoCS
Senior Member
Join Date: Mar 2013
Old 08-07-2013 , 16:35   Re: [PEDIDO] Time Projector (hud menssage)
#5

Quote:
Originally Posted by ILUSION View Post
en serio vendes plugins? ...

El plugin que posteaste no va a compilar ni siquiera si lo forzas a emitir los errores.

public show_timer() no está definido el id
public event_round_start() te faltan las llaves
for (new i=1; i <= g_maxplayers; i++) un for para mostrarle un mensaje a todos los jugadores?
client_print(0, print_chat, ...
me confundi ya que del celular cuesta ;) . ahora lo corrijo , te importa que venda plugins ?

Last edited by DiegoCS; 08-07-2013 at 16:39.
DiegoCS is offline
Matians
Veteran Member
Join Date: Nov 2010
Location: ME QUIEREN ROBAR
Old 08-07-2013 , 16:53   Re: [PEDIDO] Time Projector (hud menssage)
#6

Lo quiso decir en plan, haces un codigo tan desastroso y vendes plugins? No me imagino que tan desastrosos son tus plugins.
__________________
Quote:
Originally Posted by YakumoHiratsuhi View Post
@DiegoCS
No sé talvez solo sea yo, pero tu me caes mal campeón.


JAJAJAJAJAJAJAJAJA

Quote:
Originally Posted by meTaLiCroSS View Post
Con 12 años quien no habla mierda detras de un PC, esperate a que te diga algo en persona jajajajaj VIVO DE AHI NO SALE JAJAJA
Matians is offline
DiegoCS
Senior Member
Join Date: Mar 2013
Old 08-07-2013 , 16:58   Re: [PEDIDO] Time Projector (hud menssage)
#7

Quote:
Originally Posted by Matians View Post
Lo quiso decir en plan, haces un codigo tan desastroso y vendes plugins? No me imagino que tan desastrosos son tus plugins.
Off: al que le vendí el Zombie Infinitum ( el que vendo ahora ) no dijo lo mismo ;) .
DiegoCS is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 08-07-2013 , 17:01   Re: [PEDIDO] Time Projector (hud menssage)
#8

Ahora todo lo hace del cel, lo que se me hace mamon esque acomode los espacios, en cel seria
public puta(id)
{
ola(id)
}

en pc
public puta(id)
{
(espacios) ola(id)
}

pd: yo si ando en cel
edit: lol nisi quiera se puede poner el espacio desde el cel
__________________
Allied Modders En Español

Last edited by MexPower; 08-07-2013 at 17:02.
MexPower is offline
Erater
Junior Member
Join Date: Aug 2013
Old 08-07-2013 , 17:01   Re: [PEDIDO] Time Projector (hud menssage)
#9

Quote:
Te explico, ya que sos nuevo. Lo que hice fue crear una variable, y al decir /time, SOLO POR SAY,
la variable va cambiando, originalmente empieza en 0, entonces puse, si es 0, le pones 1 y viceversa.

Al hacer esto, hice que te diga si desactiva o activa, y cree un simple if, para mostrar el hud. Ahora si vos queres con /timeoff y /timeon es otra cosa.
Gracias por la explicacion deje el codigo asi:

DUDA: Como hago una especie de spoiler para insertar el codigo adentro y no alargar tanto el mensaje?

PHP Code:
#include <amxmodx> 

new g_hud[33]

//code
public plugin_init()
{
    
register_clcmd("say /time""time")
}

public 
time(id)
{
    (
g_hud[id] == 1) ? (g_hud[id] = 0) : (g_hud[id] = 1)
    
    if (
g_hud[id] <= 0)
        
client_print(idprint_chat"Desactivado")
    else
        
client_print(idprint_chat"Activado")


//old value

public show_timer(){ 
    new 
nextmap[32
    
get_cvar_string("amx_nextmap",nextmap,31
    new 
timeleft get_timeleft()
    if (
g_hud[id] >= 1) {
        
set_hudmessage(255,255,255,0.75,0.05,01.01.00.10.213
        
show_hudmessage(0,"Tiempo restante: %d:%02d^nProximo Mapa: %s",timeleft 60timeleft 60,nextmap)
    } 
    return 
PLUGIN_CONTINUE 

Y me tiro estos errores:
Quote:
amxmodx\scripting\timeprojector.sma<11>
: error 021: symbol already defined: "time"
amxmodx\scripting\timeprojector.sma<15>
error 010: invalid function or declaration
amxmodx\scripting\timeprojector.sma<17>
: error 010: invalid function or declaration
amxmodx\scripting\timeprojector.sma<27>
: error 017: undefined symbol "id"

4 Errors
(sera que le tengo que agregar <amxmisc> ?
-----------
Diego el tuyo me habia tirado errores tambien pero ahi vi que editaste ahora lo pruebo

EDIT: Diego estos errores me tira ahora al compilar el tuyo:

Quote:
amxmodx\scripting\timeprojector.sma<6>
: warning 209: function "show_timer" should return a value
amxmodx\scripting\timeprojector.sma<13>
: error 078: function uses both "return" and "return <value>"
amxmodx\scripting\timeprojector.sma<40>
: warning 203: symbol is never used: "g_maxplayers"

1 Errors.
Gracias por la ayuda a ambos!

Last edited by Erater; 08-07-2013 at 17:10.
Erater is offline
Old 08-07-2013, 17:03
DiegoCS
This message has been deleted by DiegoCS. Reason: tengan pruebas antes de comentar.
MexPower
Veteran Member
Join Date: Nov 2012
Old 08-07-2013 , 17:07   Re: [PEDIDO] Time Projector (hud menssage)
#10

Si uso la cabeza, tus comentarios no tienen nada que ver.

Las piedras y los palos me hieren pero las palabras no.
__________________
Allied Modders En Español
MexPower is offline
 



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 02:27.


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