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

[Inc/Stock] Printf


  
 
 
Thread Tools Display Modes
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-30-2012 , 18:44   Re: [Inc/Stock] Printf
#21

Quote:
Originally Posted by leonard19941 View Post
[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;


como se dijo antes.. no tiene soporte para 0; tenes que hacer vos un bucle
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 08-30-2012 , 23:20   Re: [Inc/Stock] Printf
#22

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
PHP Code:
stock printcolor(idcolor, const msg[], any:...) { 
?
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 08-31-2012 , 11:39   Re: [Inc/Stock] Printf
#23

Ponele soporte para 0 ¬¬ o por lo menos un return que no tire el server pito corto.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
SergiCruz
Senior Member
Join Date: Mar 2012
Location: Andalucía, España
Old 08-31-2012 , 11:43   Re: [Inc/Stock] Printf
#24

__________________
PodBot waypointer. Feel free to ask for waypoints for zm_ maps.
SergiCruz is offline
Send a message via MSN to SergiCruz
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 08-31-2012 , 12:56   Re: [Inc/Stock] Printf
#25

El módulo de ConnorMcLeod es bastante powerful.

Pero en fin, dime si este code te sirve para todos los players

PHP Code:
enum 
    DEFAULT, 
    
RED
    
BLUE
    
GRAY
    
GREEN 


stock printf(idcolor = DEFAULT, const msg[], any:...) 

    static 
Buffer[192], MsgSayTextMsgTeamInfo
    
    
if(!MsgSayText
    { 
        
MsgTeamInfo get_user_msgid("TeamInfo"
        
MsgSayText get_user_msgid("SayText")   
    } 
    
    if(
numargs() == 3)
    {
        
copy(Buffer[1], charsmax(Buffer) - 1msg)
    }
    else
    {
        
vformat(Buffer[1], charsmax(Buffer) - 1msg4)
    }
    
    if(
id)
    {    
        if(!
is_user_connected(id))
        {
            return 
0
        
}
        
        if(DEFAULT < 
color GREEN
        { 
            static const 
g_Teams[4][11] =
            {
                
"UNASSIGNED"
                
"TERRORIST"
                
"CT"
                
"SPECTATOR" 
            
}
                
                
            
Buffer[0] = 0x03 
                
            
new Team[11]
            
get_user_team(idTeamcharsmax(Team)) 
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)  
            
write_byte(id)  
            
write_string(g_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 if(
color == GREEN
        { 
            
Buffer[0] = 0x04 
                
            message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)  
            
write_byte(id)  
            
write_string(Buffer)    
            
message_end()     
        }
        
        else 
        { 
            
Buffer[0] = 0x01 
            
            message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)  
            
write_byte(id)  
            
write_string(Buffer)    
            
message_end() 
        } 
    }
    else
    {
        
// No tiene soporte a ML
        
        
new Players[32], Num
        get_players
(PlayersNum"ch")
        if(!
Num)
        {
            return 
0
        
}
        
        if(DEFAULT < 
color GREEN
        { 
            static const 
g_Teams[4][11] =
            {
                
"UNASSIGNED"
                
"TERRORIST"
                
"CT"
                
"SPECTATOR" 
            
}
                
                
            
Buffer[0] = 0x03 
                
            
new Team[11]
            
get_user_team(idTeamcharsmax(Team)) 
            
message_begin(MSG_BROADCASTMsgTeamInfo_0)  
            
write_byte(Players[0])  
            
write_string(g_Teams[color])    
            
message_end() 
                
            
message_begin(MSG_BROADCASTMsgSayText_0)  
            
write_byte(Players[0])  
            
write_string(Buffer)    
            
message_end() 
                
            
message_begin(MSG_BROADCASTMsgTeamInfo_0)  
            
write_byte(Players[0])  
            
write_string(Team)    
            
message_end() 
        } 
        
        else if(
color == GREEN
        { 
            
Buffer[0] = 0x04 
                
            message_begin
(MSG_BROADCASTMsgSayText_0)  
            
write_byte(Players[0])  
            
write_string(Buffer)    
            
message_end()     
        }
        
        else 
        { 
            
Buffer[0] = 0x01 
            
            message_begin
(MSG_BROADCASTMsgSayText_0)  
            
write_byte(Players[0])  
            
write_string(Buffer)    
            
message_end() 
        }         
    }

__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).


Last edited by gladius; 08-31-2012 at 12:57.
gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 08-31-2012 , 13:58   Re: [Inc/Stock] Printf
#26

PHP Code:
stock printf(idcolor = DEFAULT, const msg[], any:...) 

    static 
Buffer[192], MsgSayTextMsgTeamInfoplayers[32], icount
    
    
if(!MsgSayText
    { 
        
MsgTeamInfo get_user_msgid("TeamInfo"
        
MsgSayText get_user_msgid("SayText")   
    } 

    if(
numargs() == 3)
        
copy(Buffer[1], charsmax(Buffer) - 1msg)
    else
        
vformat(Buffer[1], charsmax(Buffer) - 1msg4)

    
count=1;i=0;
    if(
idplayers[0] = id;else get_players(playerscount"ch")
        
    for(
0counti++)
    {
        if(!
is_user_connected(players[i])) continue
        
        if(DEFAULT < 
color GREEN
        { 
            static const 
g_Teams[3][10] =
            {
                
"TERRORIST",
                
"CT"
                
"SPECTATOR" 
            
}

            
Buffer[0] = 0x03 
                
            
new Team[11]
            
get_user_team(idTeamcharsmax(Team)) 
            
message_begin(MSG_ONE_UNRELIABLEMsgTeamInfo_id)  
            
write_byte(id)  
            
write_string(g_Teams[color-1])    
            
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 
        {
            if(
colorBuffer[0] = 0x04 
            
else Buffer[0] = 0x01
            
            message_begin
(MSG_ONE_UNRELIABLEMsgSayText_id)  
            
write_byte(id)  
            
write_string(Buffer)    
            
message_end()
        }
        }

Con el de ConnorMcLeod creo que ya estaría :\
__________________

Last edited by Destro-; 08-31-2012 at 14:04.
Destro- is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 08-31-2012 , 21:35   Re: [Inc/Stock] Printf
#27

ahora cuando llego al trabajo le agrego soporte para '0', ML y veo el tema del zp
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 09-01-2012 , 18:23   Re: [Inc/Stock] Printf
#28

Quote:
Originally Posted by rak View Post
ahora cuando llego al trabajo le agrego soporte para '0', ML y veo el tema del zp
Quote:
Originally Posted by rak View Post
ahora cuando llego al trabajo le agrego soporte para '0', ML y veo el tema del zp
buen aporte rak, una pregunta tal vez sea estupida, el say puede en lugar de tener los colores default(anaranjado,gris,azul,rojo) puede tener amarillo por ejemplo?
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 09-01-2012 , 22:25   Re: [Inc/Stock] Printf
#29

Quote:
Originally Posted by Roccoxx View Post
buen aporte rak, una pregunta tal vez sea estupida, el say puede en lugar de tener los colores default(anaranjado,gris,azul,rojo) puede tener amarillo por ejemplo?
nop.. seria slowhack
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Old 09-03-2012, 09:59
Roccoxx
This message has been deleted by Roccoxx.
 



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 20:01.


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