AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to do this ??? (https://forums.alliedmods.net/showthread.php?t=134342)

0920357689 08-03-2010 15:33

how to do this ???
 
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")
  }



ConnorMcLeod 08-03-2010 16:21

Re: how to do this ???
 
Learn from the begining.

0920357689 08-03-2010 16:32

Re: how to do this ???
 
Quote:

Originally Posted by ConnorMcLeod (Post 1260684)
Learn from the begining.

where to start....

fysiks 08-03-2010 19:05

Re: how to do this ???
 
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])



0920357689 08-03-2010 23:21

Re: how to do this ???
 
Quote:

Originally Posted by fysiks (Post 1260893)
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])



Bugsy 08-03-2010 23:39

Re: how to do this ???
 
Learn the basics of scripting before writing plugins. There are multiple beginner tutorials in the code snippet tut section.

0920357689 08-04-2010 00:00

Re: how to do this ???
 
Quote:

Originally Posted by Bugsy (Post 1261146)
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

nikhilgupta345 08-04-2010 00:16

Re: how to do this ???
 
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?

0920357689 08-04-2010 00:48

Re: how to do this ???
 
Quote:

Originally Posted by nikhilgupta345 (Post 1261162)
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???

fysiks 08-04-2010 02:21

Re: how to do this ???
 
Quote:

Originally Posted by 0920357689 (Post 1261172)
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?


All times are GMT -4. The time now is 00:14.

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