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

[Inc/Stock] Printf


  
 
 
Thread Tools Display Modes
sofi1990
Junior Member
Join Date: Aug 2012
Location: Argentina
Old 08-30-2012 , 15:37   Re: [Inc/Stock] Printf
#11

Quote:
Originally Posted by Neeeeeeeeeel.- View Post
PHP Code:
#include < amxmodx >

enum 
    DEFAULT, 
    
RED
    
BLUE
    
GRAY
    
GREEN 


public 
plugin_init( )
    
register_clcmd"say""hook_say" );

public 
hook_sayid )
{
     new 
chat292 ], szName32 ];
     
read_argschatcharsmaxchat ) ); // chat ahora equivale a lo que escribis en say...

     
get_user_nameidszNamecharsmaxszName ) ); // aca obtenes el nombre del player

     
if( equaliszName"tu tag" ) ) // si szName es igual al string "tu tag" ... (no es sensible a mayusculas y minusculas)
     
{
          
// aca tenes que hacer chequeos de si estan vivos o muertos y blablabla que no tengo ganas de hacer asique se lo mando a todos sin importar nada...
          
printf0GREY"%s: %s"szNamechat );
     }

     return 
PLUGIN_HANDLED;
}

stock printf(idcolor, const msg[], any:...) { 
     
    static 
Buffer[192], MsgSayTextMsgTeamInfoTeam[11
     
    if(!
MsgSayText) { 
         
        
MsgTeamInfo get_user_msgid("TeamInfo"
         
        
MsgSayText get_user_msgid("SayText"
         
    } 
         
    
vformat(Buffer[1], charsmax(Buffer) - 1msg4
     
    static const 
Teams[4][11] = { 
        
"UNASSIGNED"
        
"TERRORIST"
        
"CT"
        
"SPECTATOR" 
    

     
    if(
color) { 
         
        if(
color == GREEN) { 
             
            
Buffer[0] = 0x04 
             
            message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)  
         
            
write_byte(id)  
         
            
write_string(Buffer)    
         
            
message_end() 
             
        } 
        else { 
             
            
Buffer[0] = 0x03 
         
            get_user_team
(idTeamcharsmax(Team)) 
             
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)  
         
            
write_byte(id)  
         
            
write_string(Teams[color])    
         
            
message_end() 
             
            
message_begin(MSG_ONE_UNRELIABLEMsgSayText_id)  
         
            
write_byte(id)  
         
            
write_string(Buffer)    
         
            
message_end() 
         
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)  
         
            
write_byte(id)  
         
            
write_string(Team)    
         
            
message_end() 
             
        } 
         
    } 
    else { 
         
        
Buffer[0] = 0x01 
         
        message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)  
         
        
write_byte(id)  
         
        
write_string(Buffer)    
         
        
message_end() 
         
    } 


gracias neeel dspues te cuento
__________________
sjskjsks
sofi1990 is offline
Send a message via MSN to sofi1990
sofi1990
Junior Member
Join Date: Aug 2012
Location: Argentina
Old 08-30-2012 , 15:43   Re: [Inc/Stock] Printf
#12

asdad muchos errores , gracias igual

Quote:
/tmp/textRkA4QS.sma(24) : error 017: undefined symbol "GREY"
/tmp/textRkA4QS.sma(24) : warning 215: expression has no effect
/tmp/textRkA4QS.sma(24) : warning 215: expression has no effect
/tmp/textRkA4QS.sma(24) : warning 215: expression has no effect
/tmp/textRkA4QS.sma(24) : error 001: expected token: ";", but found ")"
/tmp/textRkA4QS.sma(24) : error 029: invalid expression, assumed zero
/tmp/textRkA4QS.sma(24) : fatal error 107: too many error messages on one line
__________________
sjskjsks
sofi1990 is offline
Send a message via MSN to sofi1990
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-30-2012 , 15:47   Re: [Inc/Stock] Printf
#13

Quote:
Originally Posted by sofi1990 View Post
asdad muchos errores , gracias igual
por q neeeeeeeel no sabe hacer plugins por eso.. aca lo tenes

PHP Code:
#include < amxmodx > 

enum {  
    DEFAULT,  
    
RED,  
    
BLUE,  
    
GRAY,  
    
GREEN  
}  

public 
plugin_init( ) 
    
register_clcmd"say""hook_say" ); 

public 
hook_sayid 

     new 
chat292 ], szName32 ]; 
     
read_argschatcharsmaxchat ) ); // chat ahora equivale a lo que escribis en say... 

     
get_user_nameidszNamecharsmaxszName ) ); // aca obtenes el nombre del player 

     
if( equaliszName"tu tag" ) ) // si szName es igual al string "tu tag" ... (no es sensible a mayusculas y minusculas) 
     

          
// aca tenes que hacer chequeos de si estan vivos o muertos y blablabla que no tengo ganas de hacer asique se lo mando a todos sin importar nada... 
          
printf0GRAY"%s: %s"szNamechat );
          return 
PLUGIN_HANDLED;
     } 

     return 
PLUGIN_CONTINUE


stock printf(idcolor, const msg[], any:...) {  
      
    static 
Buffer[192], MsgSayTextMsgTeamInfoTeam[11]  
      
    if(!
MsgSayText) {  
          
        
MsgTeamInfo get_user_msgid("TeamInfo")  
          
        
MsgSayText get_user_msgid("SayText")  
          
    }  
          
    
vformat(Buffer[1], charsmax(Buffer) - 1msg4)  
      
    static const 
Teams[4][11] = {  
        
"UNASSIGNED",  
        
"TERRORIST",  
        
"CT",  
        
"SPECTATOR"  
    
}  
      
    if(
color) {  
          
        if(
color == GREEN) {  
              
            
Buffer[0] = 0x04  
              
            message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)   
          
            
write_byte(id)   
          
            
write_string(Buffer)     
          
            
message_end()  
              
        }  
        else {  
              
            
Buffer[0] = 0x03  
          
            get_user_team
(idTeamcharsmax(Team))  
              
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)   
          
            
write_byte(id)   
          
            
write_string(Teams[color])     
          
            
message_end()  
              
            
message_begin(MSG_ONE_UNRELIABLEMsgSayText_id)   
          
            
write_byte(id)   
          
            
write_string(Buffer)     
          
            
message_end()  
          
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)   
          
            
write_byte(id)   
          
            
write_string(Team)     
          
            
message_end()  
              
        }  
          
    }  
    else {  
          
        
Buffer[0] = 0x01  
          
        message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)   
          
        
write_byte(id)   
          
        
write_string(Buffer)     
          
        
message_end()  
          
    }  

---

ahora agrego soporte para zp xD y no creo que le agrege para 0
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 08-30-2012 at 15:48.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 08-30-2012 , 15:48   Re: [Inc/Stock] Printf
#14

Fijate que edité.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
sofi1990
Junior Member
Join Date: Aug 2012
Location: Argentina
Old 08-30-2012 , 17:03   Re: [Inc/Stock] Printf
#15

server shuting down -.- (cuando escribo)
__________________
sjskjsks

Last edited by sofi1990; 08-30-2012 at 17:04.
sofi1990 is offline
Send a message via MSN to sofi1990
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viña del Mar, Chile
Old 08-30-2012 , 17:05   Re: [Inc/Stock] Printf
#16

Quote:
Originally Posted by meTaLiCroSS View Post
No me cabe la logica de porque lo llamaste printf lol ni que fuera la funcion de C
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-30-2012 , 17:24   Re: [Inc/Stock] Printf
#17

me gusto como quedaba :B
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-30-2012 , 17:41   Re: [Inc/Stock] Printf
#18

printf -> printfurcias -> printrak -> rak es furcia
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 08-30-2012 , 18:05   Re: [Inc/Stock] Printf
#19

printfail

sobre el drama de sofi
PHP Code:
printf0GRAY"%s: %s"szNamechat 
por esto:
PHP Code:
for( new 1<= g_maxplayersi++ )
{
  if( !
is_user_connected) )
     continue;
  
printfiGRAY"%s: %s"szNamechat )

tenes que crear 1 variable global ( g_maxplayers ) y en plugin_init g_maxplayers = get_maxplayers( )
__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'

Last edited by r0ma; 08-30-2012 at 18:06.
r0ma is offline
Send a message via MSN to r0ma
leonard19941
Veteran Member
Join Date: Jun 2011
Old 08-30-2012 , 18:41   Re: [Inc/Stock] Printf
#20

[R]ak me tira el server, esto fue lo que probe:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <chatcolor>

#define VERSION "1.0"

public plugin_init( )
{
    
register_plugin"Test Include Chat Color"VERSION"[R]ak" );
    
    
register_clcmd"say /test""ClCmd_Test" );
}

public 
ClCmd_Testid )
{
    
ChatColor0RED"^x04[ Zombie Plague ] ^x01ADMIN ^x04x[R]ak^x01: Dio ^x041640834 de Exp. ^x01a ^x03Neeeeeeeeeel.-^x01." );
    
    return 
PLUGIN_HANDLED;


__________________
leonard19941 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 23:21.


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