Raised This Month: $ Target: $400
 0% 

[HELP] How to export variables?


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-31-2013 , 07:59   Re: [HELP] How to export variables?
Reply With Quote #11

Quote:
Originally Posted by JoooN View Post
Ok transfer to script help forum plz
I have no access on this board, i can't

Quote:
Originally Posted by Kia View Post
You can use this on plugin_init()

PHP Code:
 register_cvar("my_var""Test"FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY
+ you have to set string so if value changes it is updated.
See timeleft plugin.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2013 , 08:55   Re: [HELP] How to export variables?
Reply With Quote #12

Moved to scripting section.
__________________
Arkshine is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-31-2013 , 09:36   Re: [HELP] How to export variables?
Reply With Quote #13

Quote:
Originally Posted by ConnorMcLeod View Post
I have no access on this board, i can't



+ you have to set string so if value changes it is updated.
See timeleft plugin.
Maybe something like this?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

new const VERSION[ ] = "7.0"
new const EXPCVAR[ ] = "my_variable"
public plugin_init( )
{
    
register_plugin"ExportVariables"7.0"JoooN" );
    
register_cvarEXPCVARVERSIONFCVAR_SERVER );
    
set_cvar_stringEXPCVARVERSION ); 
I dont know how to end it.
And is there any tutorial that explains how to end or totally how to script?
Edit: I found the tutorial just im learning, so I think we should end it with PLUGIN_HANDLED ryt?

Last edited by JoooN; 07-31-2013 at 09:42.
JoooN is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 07-31-2013 , 10:01   Re: [HELP] How to export variables?
Reply With Quote #14

you don't need to return anything at plugin_init.
__________________
Kia is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-31-2013 , 10:05   Re: [HELP] How to export variables?
Reply With Quote #15

Quote:
Originally Posted by Kia View Post
you don't need to return anything at plugin_init.
Okay so my code is correct?
How to close the plugin then? Like } ? Can you close the process?
JoooN is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 07-31-2013 , 10:08   Re: [HELP] How to export variables?
Reply With Quote #16

Yes.
__________________
Kia is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-31-2013 , 10:15   Re: [HELP] How to export variables?
Reply With Quote #17

Quote:
Originally Posted by Kia View Post
Yes.
Tried compiling this:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

new const VERSION[ ] = "7.0"
new const EXPCVAR[ ] = "my_variable"
public plugin_init( )
{
    
register_plugin"ExportVariables"7.0"JoooN" );
    
register_cvarEXPCVARVERSIONFCVAR_SERVER );
    
set_cvar_stringEXPCVARVERSION );  

Faced with compile error
And sorry if im asking too much cuz this is my first plugin I made with MY HANDS (Not copy or edit )

Last edited by JoooN; 07-31-2013 at 10:20.
JoooN is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 07-31-2013 , 10:22   Re: [HELP] How to export variables?
Reply With Quote #18

Code:
register_plugin( "ExportVariables", 7.0, "JoooN" );
-->
Code:
register_plugin( "ExportVariables", "7.0", "JoooN" );
TheDS1337 is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 07-31-2013 , 10:28   Re: [HELP] How to export variables?
Reply With Quote #19

Quote:
Originally Posted by DeagLe.Studio View Post
Code:
register_plugin( "ExportVariables", 7.0, "JoooN" );
-->
Code:
register_plugin( "ExportVariables", "7.0", "JoooN" );
Thanks
Finally made a small plugin after months xD
JoooN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-31-2013 , 12:27   Re: [HELP] How to export variables?
Reply With Quote #20

I usually do that :

PHP Code:
    set_pcvar_string
    
(
        
register_cvar(CVAR_NAMECVAR_STRING_VALUEFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY), 
        
CVAR_STRING_VALUE
    
); 
But you can write :

PHP Code:
    new pcvar register_cvar(CVAR_NAMECVAR_STRING_VALUEFCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY);
    
set_pcvar_string(pcvarCVAR_STRING_VALUE); 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-31-2013 at 12:28.
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 00:15.


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