Raised This Month: $ Target: $400
 0% 

how to do this ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
0920357689
Senior Member
Join Date: Apr 2008
Old 08-03-2010 , 15:33   how to do this ???
Reply With Quote #1

PHP Code:
new str[] = 
{
"cvar_1",
"cvar_2",
"cvar_3",
"cvar_4"
}
public 
plugin_init()
{
cvar_1 get_cvar_num("amx_cvar_1");
cvar_2 get_cvar_num("amx_cvar_2");

in plugin_init
how to do[this can make? use 'for' to get_cvar_num]
PHP Code:
public plugin_init()
{
  for(
i=0;i<4;i++)
  {
    
str[i] = get_cvar_num("xxxxx")
  }

0920357689 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-03-2010 , 16:21   Re: how to do this ???
Reply With Quote #2

Learn from the begining.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 08-03-2010 , 16:32   Re: how to do this ???
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Learn from the begining.
where to start....
0920357689 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-03-2010 , 19:05   Re: how to do this ???
Reply With Quote #4

Using pcvars will make this much much easier.

Here is a quick example:
PHP Code:
new cvar_pointers[4]
new 
cvar_values[4]

// ...

cvar_pointers[0] = register_cvar(...)
cvar_pointers[1] = register_cvar(...)
...

// ...

for(...)
{
    
cvar_values[i] = get_pcvar_num(cvar_pointers[i])

__________________

Last edited by fysiks; 08-03-2010 at 19:08.
fysiks is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 08-03-2010 , 23:21   Re: how to do this ???
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
Using pcvars will make this much much easier.

Here is a quick example:
PHP Code:
new cvar_pointers[4]
new 
cvar_values[4]
 
// ...
 
cvar_pointers[0] = register_cvar(...)
cvar_pointers[1] = register_cvar(...)
...
 
// ...
 
for(...)
{
    
cvar_values[i] = get_pcvar_num(cvar_pointers[i])


but i want to auto build CFG
if use this will no annotation


my english very bad...sorry




this is ok?
PHP Code:
// ...
new cvar_pointers[][] = 
{
   {
register_cvar(...),annotate,cvar_num},
   {
register_cvar(...),annotate,cvar_num},
...
}
 
// ...
 
for(...)
{
    
cvar_pointers[i][2] = get_pcvar_num(cvar_pointers[i][0])


Last edited by 0920357689; 08-03-2010 at 23:27.
0920357689 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-03-2010 , 23:39   Re: how to do this ???
Reply With Quote #6

Learn the basics of scripting before writing plugins. There are multiple beginner tutorials in the code snippet tut section.
__________________
Bugsy is offline
0920357689
Senior Member
Join Date: Apr 2008
Old 08-04-2010 , 00:00   Re: how to do this ???
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
Learn the basics of scripting before writing plugins. There are multiple beginner tutorials in the code snippet tut section.
my english very limited
if find my language no have this teaching


and...amxx is what computer language???


my english very bad..sorry
0920357689 is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 08-04-2010 , 00:16   Re: how to do this ???
Reply With Quote #8

AMXX is based on Pawn, and what language do u speak? If you are that bad at English, try getting help in the multilingual section?
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
0920357689
Senior Member
Join Date: Apr 2008
Old 08-04-2010 , 00:48   Re: how to do this ???
Reply With Quote #9

Quote:
Originally Posted by nikhilgupta345 View Post
AMXX is based on Pawn, and what language do u speak? If you are that bad at English, try getting help in the multilingual section?
Chinese - CHT


and
get_cvar_num and get_pcvar_num
have what difference???
0920357689 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-04-2010 , 02:21   Re: how to do this ???
Reply With Quote #10

Quote:
Originally Posted by 0920357689 View Post
Chinese - CHT


and
get_cvar_num and get_pcvar_num
have what difference???
Since you are not good at English, why should we waste our time explaining soemthing in english?
__________________
fysiks 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 00:14.


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