Raised This Month: $32 Target: $400
 8% 

[HELP] get_pdata_int and StatusText


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keyblade
Member
Join Date: Nov 2010
Location: China
Old 10-02-2011 , 02:04   [HELP] get_pdata_int and StatusText
Reply With Quote #1

2 problems

1.if i use this:
PHP Code:
new name[32]
new 
TEAM get_pdata_int(id1145)
if( 
TEAM == )
{
    
pev(idpev_netnamename31)
    
client_print(idprint_chat"%s"name)

or

PHP Code:
new name[32]
new 
TEAM get_pdata_int(id1145)
if( 
TEAM == )
{
    
pev(idpev_netnamename31)
    
client_print(idprint_chat"%s"name)

when i am T or CT, these two codes both don't work(i can't get the name)

where is wrong?

2.how to change the StatusText properly?

i use this:
PHP Code:
register_event("StatusText""StatusText_Event""b"
public 
StatusText_Event(id)
{
    new 
text[64]
    
format(text63"AAAABBBBCCCC")
    
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("StatusText"), {000}, id)
    
write_byte(0)
    
write_string(text)
    
message_end()

when i aim player, the text(AAAABBBBCCCC) will display forever....

can anyone give me an example?


thank you for your help
keyblade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2011 , 06:13   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #2

1. Use cs_get_user_team(id) and CS_TEAM_T and CS_TEAM_CT and get_user_name.
2. StatusText is not sent every new player if the text doesn't need to be changed, so it's better to hook StatusValue and to send it there, have a look at xPaw aim country plugin for code example.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
keyblade
Member
Join Date: Nov 2010
Location: China
Old 10-02-2011 , 07:26   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #3

all of the codes are under Round_Start_Event

PHP Code:
register_logevent("Round_Start_Event"2"1=Round_Start"
cs_get_user_team(id) also don't work. in the game it says native error(cs_get_user_team)

i use
new TEAM = get_pdata_int(id, 114, 5)
client_print(id, print_chat, "%d", TEAM)

and i see the number 31660448 in print_chat

how can i handle it...



and if i use register_clcmd and make the codes under its function, it works fine

Last edited by keyblade; 10-02-2011 at 07:30.
keyblade is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2011 , 09:58   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #4

Show your code.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
keyblade
Member
Join Date: Nov 2010
Location: China
Old 10-02-2011 , 10:10   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "TEST"
#define VERSION "1.0"
#define AUTHOR "Ice-Action |#KeyBlade"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("Round_Start_Event"2"1=Round_Start")
}
 
public 
Round_Start_Event(id)
{
    new 
TEAM get_pdata_int(id1145)
    
client_print(idprint_chat"%d"TEAM)

keyblade is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 10-02-2011 , 10:31   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #6

Quote:
Originally Posted by keyblade View Post
PHP Code:
#include <amxmodx>
#include <fakemeta>
 
#define PLUGIN "TEST"
#define VERSION "1.0"
#define AUTHOR "Ice-Action |#KeyBlade"
 
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("Round_Start_Event"2"1=Round_Start")
}
 
public 
Round_Start_Event(id)
{
    new 
TEAM get_pdata_int(id1145)
    
client_print(idprint_chat"%d"TEAM)

Round start event doesnt provide you with a player id, you have to loop throught them manually
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
keyblade
Member
Join Date: Nov 2010
Location: China
Old 10-02-2011 , 10:42   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #7

Quote:
Originally Posted by abdul-rehman View Post
Round start event doesnt provide you with a player id, you have to loop throught them manually
really?if so,why can i see the client_print?
keyblade is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-02-2011 , 10:45   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #8

Quote:
Originally Posted by keyblade View Post
really?if so,why can i see the client_print?
because the value of id = 0, so it's printed to everyone.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
keyblade
Member
Join Date: Nov 2010
Location: China
Old 10-02-2011 , 11:06   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #9

Quote:
Originally Posted by drekes View Post
because the value of id = 0, so it's printed to everyone.
i see...

how can i know what information does a event provide?
keyblade is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-02-2011 , 11:12   Re: [HELP] get_pdata_int and StatusText
Reply With Quote #10

Game event messages with their arguemnts: http://wiki.amxmodx.org/Half-Life_1_Game_Events

For logevents, you can see arguments in the console when the event happens while having "log on".

And to get a player entity id from a logevent, you need to get the name from the log message by using parse_loguser() and then use that name on get_user_index().
__________________
Hunter-Digital 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 18:21.


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