Raised This Month: $ Target: $400
 0% 

Chat cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fixed
Member
Join Date: Feb 2010
Old 03-04-2010 , 15:50   Chat cvars
Reply With Quote #1

I dont know what I shall call the title but I hope that u guys can help me.
I want to make a code where I start call this (I dont know if I do it the right way)

PHP Code:
new Text 
and then I make it to a amx_cvar

PHP Code:
Text register_cvar"amx_Text""Test"); 
PHP Code:
ColorChat(0GREEN"Hello %s" Text); 
I really dont know how to do it, but I hope this help to explain.
__________________
fixed is offline
Old 03-04-2010, 16:02
wrecked_
This message has been deleted by wrecked_. Reason: Misunderstood.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-04-2010 , 16:07   Re: Chat cvars
Reply With Quote #2

Quote:
Originally Posted by wrecked_ View Post
The description didn't help very much, but this might benefit you.
You are completely wrong, you should remove your code to prevent some users from being confused.



register_cvar only returns a pointer to this cvar, aka a usable index of cvar that is used with natives [s/g]et_pcvar_XXXX

PHP Code:
new g_cvar_pointer_Text

public plugin_init()
{
    
g_cvar_pointer_Text register_cvar"amx_Text""Test"); 
}

public 
TextFunction()
{
    new 
szStringText[32]
    
get_pcvar_stringg_cvar_pointer_Text szStringText charsmaxszStringText ) )
    
ColorChat(0GREEN"Hello %s" szStringText)

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-04-2010 , 16:29   Re: Chat cvars
Reply With Quote #3

Oh wow, my bad.

I misunderstood his original post. I thought he was registering a normal cvar and didn't understand the 2nd param. Didn't even register to me that he was trying to use a string.

Deleted.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-05-2010 , 01:14   Re: Chat cvars
Reply With Quote #4

This is a normal cvar (all cvars are normal lol), even if you check only the cvar value, you can't just check the pointer, check the link i put in last post.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 08:48.


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