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

[HEP] With Print code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Versus1994
Senior Member
Join Date: Jan 2013
Old 12-08-2014 , 05:21   [HEP] With Print code
Reply With Quote #1

Hey,

when I try to add

PHP Code:
Print(0"Text."); 
To my plugin I get error:

Code:
error 017: undefined symbol "Print"
What should I add after or before this code?
Or how could I change this code to other just to print out on hud message?
Versus1994 is offline
Versus1994
Senior Member
Join Date: Jan 2013
Old 12-08-2014 , 05:50   Re: [HEP] With Print code
Reply With Quote #2

I fixed it on my own.
Versus1994 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-08-2014 , 05:55   Re: [HEP] With Print code
Reply With Quote #3

Just use below code as example:
Code:
#include <amxmodx>

new g_iMsgSayText

public plugin_init() 
{
    register_clcmd("say /test", "test_color")
    register_clcmd("say_team /test", "test_color")    
    
    g_iMsgSayText = get_user_msgid("SayText")
}

public test_color(id)
{
    print_colored(id, "!g[ZP] !yThis is testing !tcolor!")
}

stock print_colored(const index, const input [ ], const any:...)
{ 
    new message[191]
    vformat(message, 190, input, 3)
    replace_all(message, 190, "!y", "^1")
    replace_all(message, 190, "!t", "^3")
    replace_all(message, 190, "!g", "^4")

    if(index)
    {
        // Print to single person
        message_begin(MSG_ONE, g_iMsgSayText, _, index)
        write_byte(index)
        write_string(message)
        message_end()
    }
    else
    {
        // Print to all players
        new players[32], count, i, id
        get_players(players, count, "ch")
        for( i = 0; i < count; i ++ )
        {
            id = players[i]
            if(!is_user_connected(id)) continue;

            message_begin(MSG_ONE_UNRELIABLE, g_iMsgSayText, _, id)
            write_byte(id)
            write_string(message)
            message_end()
        }
    }
}
!g = Green color.
!y = Yellow color.
!t = Team color.
zmd94 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 22:00.


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