Raised This Month: $ Target: $400
 0% 

Color


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Keistas
Member
Join Date: Feb 2010
Old 05-01-2011 , 15:18   Color
Reply With Quote #1

Hello, maybe who can help me. Problem is:

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <gunxpmod>
#include <jctf>


new const XP_KILLCARRIER =        15 /* for killing the flag carrier */
new const XP_STEAL =            50 /* for stealing the dropped flag from the enemy base */
new const XP_PICKUP =            50 /* for picking the dropped enemy flag */
new const XP_DROP =            -20 /* for dropping the flag when killed */
new const XP_MANUALDROP =        -20 /* for dropping the flag using /dropflag  */
new const XP_RETURN =            30 /* for returning your flag */
new const XP_RETURN_ASSIST =        30 /* for assisting on returning the flag */
new const XP_CAPTURE =            100 /* for capturing the enemy flag */
new const XP_CAPTURE_ASSIST =        30 /* for assisting on capturing the enemy flag */

new g_iMaxPlayers

public plugin_init()
{
    
register_plugin("jCTF + GunXP: Get XP for flags""0.2""Digi")

    new 
szVersion[6]

    
get_cvar_string("jctf_version"szVersioncharsmax(szVersion))

    if(
str_to_float(szVersion) < 1.26)
        
set_fail_state("jCTF is required at least v1.26 !")

    
g_iMaxPlayers get_maxplayers()

    
RegisterHam(Ham_Killed"player""player_killed"1)
}

public 
player_killed(iVictimiKiller)
{
    if(
XP_KILLCARRIER != && iVictim != iKiller && <= iKiller <= g_iMaxPlayers && jctf_get_flagcarrier(iVictim) && jctf_get_team(iVictim) != jctf_get_team(iKiller))
    {
        
set_user_xp(iKillerget_user_xp(iKiller) + XP_KILLCARRIER)

        
client_print(iKillerprint_chat"[GunXP] %s%d XP for killing the flag carrier"XP_KILLCARRIER "+" ""XP_KILLCARRIER)
    }
}

public 
jctf_flag(iEventiPlayeriFlagTeambool:bAssist)
{
    new 
iXP

    
switch(iEvent)
    {
        case 
FLAG_STOLEN:
        {
            
iXP XP_STEAL

            
if(iXP != 0
            
client_print(iPlayerprint_chat"[GunXP] %s%d XP kad paemei prieso VELIAVA"XP_STEAL "+" ""XP_STEAL)
        }

        case 
FLAG_PICKED:
        {
            
iXP XP_PICKUP

            
if(iXP != 0)
                
client_print(iPlayerprint_chat"[GunXP] %s%d XP kad paemei prieso veliava"XP_PICKUP "+" ""XP_PICKUP)
        }

        case 
FLAG_DROPPED:
        {
            
iXP XP_DROP

            
if(iXP != 0)
                
client_print(iPlayerprint_chat"[GunXP] %s%d XP kad ismetei prieso veliava"XP_DROP "+" ""XP_DROP)
        }

        case 
FLAG_MANUALDROP:
        {
            
iXP XP_MANUALDROP

            
if(iXP != 0)
                
client_print(iPlayerprint_chat"[GunXP] %s%d XP uz tai kad tycia ismetei prieso veliava"XP_MANUALDROP "+" ""XP_MANUALDROP)
        }

        case 
FLAG_RETURNED:
        {
            if(
bAssist)
            {
                
iXP XP_RETURN_ASSIST

                
if(iXP != 0)
                    
client_print(iPlayerprint_chat"[GunXP] %s%d XP uz tai kad padejai susigrazinti veliava"XP_RETURN_ASSIST "+" ""XP_RETURN_ASSIST)
            }
            else
            {
                
iXP XP_RETURN

                
if(iXP != 0)
                    
client_print(iPlayerprint_chat"[GunXP] %s%d XP kad grazinai veliava"XP_RETURN "+" ""XP_RETURN)
            }
        }

        case 
FLAG_CAPTURED:
        {
            if(
bAssist)
            {
                
iXP XP_CAPTURE_ASSIST

                
if(iXP != 0)
                    
client_print(iPlayerprint_chat"[GunXP] %s%d XP uz tai kad padejai susigrazinti prieso veliava"XP_CAPTURE_ASSIST "+" ""XP_CAPTURE_ASSIST)
            }
            else
            {
                
iXP XP_CAPTURE

                
if(iXP != 0)
                    
client_print(iPlayerprint_chat"[GunXP] %s%d XP uz tai kad pavogei prieso VELIAVA"XP_CAPTURE "+" ""XP_CAPTURE)
            }
        }
    }

    if(
iXP != 0)
        
set_user_xp(iPlayerget_user_xp(iPlayer) + iXP)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/ 
I want set color this text: [GunXP] %s%d XP kad grazinai veliava
How can be: [GunXP] %s%d XP kad grazinai veliava

Thanks who help me.
Keistas is offline
!Morte
Veteran Member
Join Date: May 2010
Old 05-01-2011 , 16:24   Re: Color
Reply With Quote #2

use chatcolor stock.
__________________
First Zombie Class
[ZP] Zombie Class: Houndeye Zombie
Quote:
Originally Posted by lucas_7_94 View Post
tenes que saber pawn antes de intentar hacer algo digno.
!Morte is offline
Send a message via MSN to !Morte Send a message via Skype™ to !Morte
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-01-2011 , 16:26   Re: Color
Reply With Quote #3

Simpliest way to send a colored message is to send a SayText message.

Code:
message_begin(MSG_ONE, gMsg_SayText, _, id)
write_byte(id) // team color based on this player
write_string(szText)
message_end()
Use ^x04 for green, ^x01 for normal color and ^x03 for id's team color.

If that's not enough then search for the colorchat stock.
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-01-2011 , 16:32   Re: Color
Reply With Quote #4

You can find it there
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Keistas
Member
Join Date: Feb 2010
Old 05-01-2011 , 17:00   Re: Color
Reply With Quote #5

Quote:
Originally Posted by Hunter-Digital View Post
Simpliest way to send a colored message is to send a SayText message.

Code:
message_begin(MSG_ONE, gMsg_SayText, _, id)
write_byte(id) // team color based on this player
write_string(szText)
message_end()
Use ^x04 for green, ^x01 for normal color and ^x03 for id's team color.

If that's not enough then search for the colorchat stock.
Where set this code?
Can you write full code?
I include colorchat

Last edited by Keistas; 05-01-2011 at 17:02.
Keistas is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-02-2011 , 03:23   Re: Color
Reply With Quote #6

Keistas
Read the ColorChat thread, there is manual for you.
__________________

SonicSonedit is offline
Keistas
Member
Join Date: Feb 2010
Old 05-02-2011 , 15:38   Re: Color
Reply With Quote #7

What is problem?

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <gunxpmod>
#include <jctf>
 
 
 
new g_msgSayText
 
new const XP_KILLCARRIER =      15 /* for killing the flag carrier */
new const XP_STEAL =            50 /* for stealing the dropped flag from the enemy base */
new const XP_PICKUP =           50 /* for picking the dropped enemy flag */
new const XP_DROP =         -20 /* for dropping the flag when killed */
new const XP_MANUALDROP =       -20 /* for dropping the flag using /dropflag  */
new const XP_RETURN =           30 /* for returning your flag */
new const XP_RETURN_ASSIST =        30 /* for assisting on returning the flag */
new const XP_CAPTURE =          100 /* for capturing the enemy flag */
new const XP_CAPTURE_ASSIST =       30 /* for assisting on capturing the enemy flag */
 
new g_iMaxPlayers
 
public plugin_init()
{
    
register_plugin("jCTF + GunXP: Get XP for flags""0.2""Digi")
    
    new 
szVersion[6]
    
    
get_cvar_string("jctf_version"szVersioncharsmax(szVersion))
    
    if(
str_to_float(szVersion) < 1.26)
        
set_fail_state("jCTF is required at least v1.26 !")
    
    
g_iMaxPlayers get_maxplayers()
    
    
RegisterHam(Ham_Killed"player""player_killed"1)
    
    
g_msgSayText get_user_msgid("SayText")
}
 
public 
player_killed(iVictimiKiller)
{
    if(
XP_KILLCARRIER != && iVictim != iKiller && <= iKiller <= g_iMaxPlayers && jctf_get_flagcarrier(iVictim) && jctf_get_team(iVictim) != jctf_get_team(iKiller))
    {
        
set_user_xp(iKillerget_user_xp(iKiller) + XP_KILLCARRIER)
        
        
print_color(iKiller"/g[GunXP] /y%s%d XP for killing the flag carrier"XP_KILLCARRIER "+" ""XP_KILLCARRIER)
    }
}
 
public 
jctf_flag(iEventiPlayeriFlagTeambool:bAssist)
{
    new 
iXP
    
    
switch(iEvent)
    {
        case 
FLAG_STOLEN:
        {
            
iXP XP_STEAL
            
            
if(iXP != 0
                
client_print(iPlayerprint_center"[GunXP] %s%d XP kad paemei prieso VELIAVA"XP_STEAL "+" ""XP_STEAL)
        }
        
        case 
FLAG_PICKED:
        {
            
iXP XP_PICKUP
            
            
if(iXP != 0)
                
client_print(iPlayerprint_center"[GunXP] %s%d XP kad paemei prieso veliava"XP_PICKUP "+" ""XP_PICKUP)
        }
        
        case 
FLAG_DROPPED:
        {
            
iXP XP_DROP
            
            
if(iXP != 0)
                
client_print(iPlayerprint_center"[GunXP] %s%d XP kad ismetei prieso veliava"XP_DROP "+" ""XP_DROP)
        }
        
        case 
FLAG_MANUALDROP:
        {
            
iXP XP_MANUALDROP
            
            
if(iXP != 0)
                
client_print(iPlayerprint_center"[GunXP] %s%d XP uz tai kad tycia ismetei prieso veliava"XP_MANUALDROP "+" ""XP_MANUALDROP)
        }
        
        case 
FLAG_RETURNED:
        {
            if(
bAssist)
            {
                
iXP XP_RETURN_ASSIST
                
                
if(iXP != 0)
                    
client_print(iPlayerprint_center"[GunXP] %s%d XP uz tai kad padejai susigrazinti veliava"XP_RETURN_ASSIST "+" ""XP_RETURN_ASSIST)
            }
            else
            {
                
iXP XP_RETURN
                
                
if(iXP != 0)
                    
client_print(iPlayerprint_center"[GunXP] %s%d XP kad grazinai veliava"XP_RETURN "+" ""XP_RETURN)
            }
        }
        
        case 
FLAG_CAPTURED:
        {
            if(
bAssist)
            {
                
iXP XP_CAPTURE_ASSIST
                
                
if(iXP != 0)
                    
client_print(iPlayerprint_center"[GunXP] %s%d XP uz tai kad padejai susigrazinti prieso veliava"XP_CAPTURE_ASSIST "+" ""XP_CAPTURE_ASSIST)
            }
            else
            {
                
iXP XP_CAPTURE
                
                
if(iXP != 0)
                    
client_print(iPlayerprint_center"[GunXP] %s%d XP uz tai kad pavogei prieso VELIAVA"XP_CAPTURE "+" ""XP_CAPTURE)
            }
        }
    }
    
    if(
iXP != 0)
        
set_user_xp(iPlayerget_user_xp(iPlayer) + iXP)
}
 
stock print_color(const id, const input[], any:...)
{
    
    new 
iCount 1iPlayers[32]
    
    static 
szMsg[191]
    
vformat(szMsgcharsmax(szMsg), input3)
    
    
replace_all(szMsg190"/g""^4"// green txt
    
replace_all(szMsg190"/y""^1"// orange txt
    
replace_all(szMsg190"/ctr""^3"// team txt
    
replace_all(szMsg190"/w""^0"// team txt
    
    
if(idiPlayers[0] = id
    
else get_players(iPlayersiCount"ch")
    
    for (new 
0iCounti++)
    {
        if (
is_user_connected(iPlayers[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayers[i])
            
write_byte(iPlayers[i])
            
write_string(szMsg)
            
message_end()
        }
    }

What is problem?
Not make color.

[IMG]http://img855.**************/img855/1795/62865575.jpg[/IMG]
Keistas is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-02-2011 , 16:07   Re: Color
Reply With Quote #8

Quote:
Originally Posted by Keistas View Post
Quote:
PHP Code:
client_print(iPlayerprint_center"[GunXP] %s%d XP kad paemei prieso VELIAVA"XP_STEAL "+" ""XP_STEAL
Replace all client_print() functions.
__________________
Hunter-Digital is offline
Keistas
Member
Join Date: Feb 2010
Old 05-02-2011 , 17:12   Re: Color
Reply With Quote #9

I replace:
PHP Code:
print_color 
but error show:

jctf_gunxp_getxp.sma<77> : error 035: argument type mismatch <argument 2>
Keistas is offline
jc980
Veteran Member
Join Date: Jan 2010
Location: God is with us...
Old 05-03-2011 , 01:25   Re: Color
Reply With Quote #10

Quote:
Originally Posted by Keistas View Post
I replace:
PHP Code:
print_color 
but error show:

jctf_gunxp_getxp.sma<77> : error 035: argument type mismatch <argument 2>
remove print_center.
__________________
jc980 is offline
Reply



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 04:30.


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