Raised This Month: $51 Target: $400
 12% 

REQUEST Cvars


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-26-2012 , 07:21   REQUEST Cvars
Reply With Quote #1

I have a plugin, that I will submit it, I already made it, but I want update to version 1.1

I don't understad in cvars.

I need this example:

new_cvar_Domain (url of the website with .html files)
http://bla.com/something.html
http://bla.com/stuff.html
http_//bla.com/etc,.,.,.,

In the menu I have :

PHP Code:
new const g_szMenuItems[][] = { 
    
"something"
    
"stuff"
    
"anotherstuff"
    
"bla"
    
"lol^n" 
}; 

 
new const 
g_szWebpages[][] = { 
    
"something.html"
    
"stuff.html"
    
"anotherstuff.html"
    
"bla.html"
    
"lol.html" 
}; 
PHP Code:
public plugin_init() 

    
register_plugin(gPLUGINgVERSIONgAUTHOR);
    
cvar_Domain register_cvar("pluginname_domain""url of the website with .html files")


Last edited by bazhenov93; 03-26-2012 at 17:31.
bazhenov93 is offline
r4ndomz
Senior Member
Join Date: Jul 2009
Location: The Hood
Old 03-26-2012 , 18:33   Re: REQUEST Cvars
Reply With Quote #2

What? I dont get what youre trying to do
__________________
HideNSeek bug fixed here:http://forums.alliedmods.net/showpos...&postcount=951

PM me if you want a nice HideNSeek shop
NEED PLUGIN TESTERS PM ME
r4ndomz is offline
Send a message via Skype™ to r4ndomz
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-26-2012 , 21:51   Re: REQUEST Cvars
Reply With Quote #3

A cvar is probably not an appropriate method for loading several URLs. I suggest putting them in a file and reading the file into a global array in plugin_init().
__________________
fysiks is offline
bazhenov93
Veteran Member
Join Date: Oct 2010
Old 03-27-2012 , 10:07   Re: REQUEST Cvars
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
A cvar is probably not an appropriate method for loading several URLs. I suggest putting them in a file and reading the file into a global array in plugin_init().
ok thanks, gonna try, but first need find that code (load from a file)
bazhenov93 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-27-2012 , 12:32   Re: REQUEST Cvars
Reply With Quote #5

Quote:
Originally Posted by bazhenov93 View Post
ok thanks, gonna try, but first need find that code (load from a file)
If you look at the Bot Apology plugin in my signature you can see a simple example of reading from a file. Also, you might want to search through the Tutorials section to see if there are any tutorial. However, note that it's recommended that you do NOT use read_file() and write_file() but instead use what you see in my plugin.
__________________
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 04:04.


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