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

get_cvar_string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 09:03   get_cvar_string
Reply With Quote #1

Code:
   register_event("SendAudio", "incter", "a", "2=%!MRAD_terwin");
   register_event("SendAudio", "incct", "a", "2=%!MRAD_ctwin");
Code:
public incct() 
{
   new ha
   new rounds
   get_cvar_string("half",ha,3)
   if (ha == 1)
   {
      get_cvar_string("Team1-Wins",rounds,3);
      rounds = rounds + 1
      set_cvar_string("Team1-Wins",rounds);
      return PLUGIN_CONTINUE
   }
   else if (ha == 2)
   {
      get_cvar_string("Team2-Wins",rounds,3);
      rounds = rounds + 1
      set_cvar_string("Team2-Wins",rounds);
      return PLUGIN_CONTINUE
   }
   check_rounds()
   return PLUGIN_HANDLED
}
Quote:
Originally Posted by AMXX Compile Tool
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(69) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(72) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(74) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(79) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(81) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(91) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(94) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(96) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(101) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(103) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(112) : error 035: argument type mismatch (argument 2)
// F:\Back up\Sever Boot\elajtjumperz\cstrike\addons\amxmodx\scri pting\Gather.sma(113) : error 035: argument type mismatch (argument 2)
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
TheRadiance
Senior Member
Join Date: Nov 2007
Location: Kazakhstan
Old 07-15-2009 , 09:10   Re: get_cvar_string
Reply With Quote #2

PHP Code:
public incct() 
{
   new 
rounds;
   new 
ha get_cvar_num("half")
   if (
ha == 1)
   {
      
rounds get_cvar_num("Team1-Wins");
      
set_cvar_num("Team1-Wins",rounds++);
      return 
PLUGIN_CONTINUE
   
}
   else if (
ha == 2)
   {
      
rounds get_cvar_num("Team2-Wins");
      
set_cvar_num("Team2-Wins",rounds++);
      return 
PLUGIN_CONTINUE
   
}
   
check_rounds()
   return 
PLUGIN_HANDLED


Last edited by TheRadiance; 07-15-2009 at 09:14.
TheRadiance is offline
Send a message via ICQ to TheRadiance
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 09:26   Re: get_cvar_string
Reply With Quote #3

L 07/15/2009 - 16:25:41: [AMXX] Run time error 3 (plugin "gather.amxx") - debug not enabled!
L 07/15/2009 - 16:25:41: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 09:33   Re: get_cvar_string
Reply With Quote #4

new ha = get_cvar_num("half")
log_amx("%s",ha);

its not log anything

ONLY with get_cvar_string:/
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 10:05   Re: get_cvar_string
Reply With Quote #5

????
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-15-2009 , 10:23   Re: get_cvar_string
Reply With Quote #6

You are trying to read a string value into an integer variable. You should also use cvar pointers.

PHP Code:
new VarName// = integer
new FloatVarName// = float
new boolVarName// = boolean
new VarName[size]; // = array\string 
PHP Code:
new szValue];
get_cvar_string"half" szValue ); 
__________________

Last edited by Bugsy; 07-15-2009 at 10:25.
Bugsy is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 10:25   Re: get_cvar_string
Reply With Quote #7

i don't understan that.. Well i tell you what i want and if you want tell me how it will be done..

I want to check from cvar what "half" is. 1-2. If it is 1 i and team CT's wins i want to add 1 into cvar Team1-Wins if half = 2 and team ct's wins i want to add 1 into cvar Team2-Wins. for the terrorists will be a copy paste
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-15-2009 , 10:30   Re: get_cvar_string
Reply With Quote #8

Quote:
Originally Posted by ProIcons View Post
i don't understan that.. Well i tell you what i want and if you want tell me how it will be done..

I want to check from cvar what "half" is. 1-2. If it is 1 i and team CT's wins i want to add 1 into cvar Team1-Wins if half = 2 and team ct's wins i want to add 1 into cvar Team2-Wins. for the terrorists will be a copy paste
PHP Code:
switch ( get_cvar_num"half" ) )
{
    case 
1set_cvar_num"Team1-Wins" get_cvar_num"Team1-Wins" ) + );
    case 
2set_cvar_num"Team2-Wins" get_cvar_num"Team2-Wins" ) + );

or

PHP Code:
static szWin11 ];
formatexszWin 10 "Team%d-Wins" get_cvar_num"half" ) );
set_cvar_numszWin get_cvar_numszWin ) + ); 
__________________

Last edited by Bugsy; 07-15-2009 at 10:36.
Bugsy is offline
ProIcons
Senior Member
Join Date: Jan 2009
Location: Greece - Salonica
Old 07-15-2009 , 11:51   Re: get_cvar_string
Reply With Quote #9

set_cvar_num( "Team2-Wins" , get_cvar_num( "Team2-Wins" ) + 1 );

I want cvar_string...
__________________
function rb return $regsubex($$1-,/(.)/g,$+($chr(2) $+ $chr(3),$r(2,15),$chr(2),\1))
ProIcons is offline
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 07-15-2009 , 12:29   Re: get_cvar_string
Reply With Quote #10

Quote:
Originally Posted by ProIcons View Post
set_cvar_num( "Team2-Wins" , get_cvar_num( "Team2-Wins" ) + 1 );

I want cvar_string...
Why? The number of wins is a number right? What would make a difference?
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
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 10:42.


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