Raised This Month: $ Target: $400
 0% 

Arrays


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-17-2010 , 21:00   Re: Arrays
Reply With Quote #11

OK I understand now. The question now is how do you select one of the values? By index? randomly?
__________________
Bugsy is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 03-17-2010 , 21:21   Re: Arrays
Reply With Quote #12

Quote:
Originally Posted by Bugsy View Post
OK I understand now. The question now is how do you select one of the values? By index? randomly?
Not really, I just want to know do i make myself a .ini file which is renamed as config.ini.

Inside it has some customization you can change it there, but you can't change it inside the plugin itself.
zombieplague is offline
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 03-17-2010 , 21:37   Re: Arrays
Reply With Quote #13

Quote:
Originally Posted by zombieplague View Post
but you can't change it inside the plugin itself.
This request doesn't make sense, you'll always be able to change it inside the plugin.
Seta00 is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 03-17-2010 , 22:21   Re: Arrays
Reply With Quote #14

Quote:
Originally Posted by Seta00 View Post
This request doesn't make sense, you'll always be able to change it inside the plugin.
I not really sure, because in zombieplague there is a .ini called zombieplage.ini where you can change the model inside.

I just want to know how to do that.

As in making myself a .ini.
zombieplague is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-17-2010 , 23:11   Re: Arrays
Reply With Quote #15

Seta, I think he means you are not required to modify the strings in the source itself. Everything is modified in the ini which is then read by the plugin.

To retrieve data stored in a file you just need basic file i\o functions. Once you have the data, you will need to manipulate it depending on which of the values you want to obtain.

In your plugin you can create X number of empty string arrays and populate them with the data from your file. You can then use these strings throughout your plugin.
__________________
Bugsy is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 03-18-2010 , 00:14   Re: Arrays
Reply With Quote #16

Quote:
Originally Posted by Bugsy View Post
Seta, I think he means you are not required to modify the strings in the source itself. Everything is modified in the ini which is then read by the plugin.

To retrieve data stored in a file you just need basic file i\o functions. Once you have the data, you will need to manipulate it depending on which of the values you want to obtain.

In your plugin you can create X number of empty string arrays and populate them with the data from your file. You can then use these strings throughout your plugin.
Can you show me an example ?
zombieplague is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-18-2010 , 00:24   Re: Arrays
Reply With Quote #17

A simple example:

http://forums.alliedmods.net/showthr...737#post760737
__________________
fysiks is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 03-20-2010 , 00:41   Re: Arrays
Reply With Quote #18

Quote:
Originally Posted by fysiks View Post
PHP Code:
 new sorryfile[64]
 
get_configsdir(sorryfilesizeof(sorryfile) - 1)
 
add(sorryfilesizeof(sorryfile) - 1"/bot_apology.ini")
 
 if( !
file_exists(sorryfile) )
 {
  
copy(g_sorry_phrases[0], SORRYS_LEN"sorry")
  
g_sorry_count 1
  
return
 } 
This part ?

I not really sure can give an example of models ?
zombieplague is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-20-2010 , 00:55   Re: Arrays
Reply With Quote #19

Quote:
Originally Posted by zombieplague View Post
This part ?

I not really sure can give an example of models ?
I gave you an example of what Bugsy said (which has nothing to do with models). It's an example.

My suggestion is to do the plugin without reading a file and get it to work (strings should be hardcoded into an array). Then after that you can retreive the strings from the file to put in to the array.
__________________
fysiks is offline
zombieplague
Veteran Member
Join Date: Apr 2009
Old 03-20-2010 , 02:24   Re: Arrays
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
I gave you an example of what Bugsy said (which has nothing to do with models). It's an example.

My suggestion is to do the plugin without reading a file and get it to work (strings should be hardcoded into an array). Then after that you can retreive the strings from the file to put in to the array.
I know but do i change the model of players every new round ? then set the HUMAN = sas, and many more in the .ini ?
zombieplague 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:44.


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