Raised This Month: $ Target: $400
 0% 

source to orangebox - ConCommands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
russy
Senior Member
Join Date: Sep 2010
Old 05-03-2011 , 16:05   source to orangebox - ConCommands
Reply With Quote #1

I'm tring to convert an old source engine plugin that uses metamod to the orangebox engine those who know my SM plugin can guess what the mod is lol.

i've made quite abit of progress but i am now having trouble converting ConCommands over.

old code:
Code:
int numArgs = engine->Cmd_Argc() - 1;
and ofc this doesn't work since this type was replaced in the oangebox engine

new code:
Code:
int numArgs = args.ArgC() - 1;
rather anoyingly this desn't work either and i am now stuck >.<
the error:
Code:
1>zhcommand.cpp(191): error C2065: 'args' : undeclared identifier
1>zhcommand.cpp(191): error C2228: left of '.ArgC' must have class/struct/union
1>          type is ''unknown-type''
I will be greatful for any help.

Last edited by russy; 05-05-2011 at 18:55.
russy is offline
JasonGauthierDK
Member
Join Date: Jun 2010
Old 05-04-2011 , 14:07   Re: source to orangebox - ConCommands
Reply With Quote #2

Not sure if this will work, but what the hell: http://developer.valvesoftware.com/w...MAND_arguments
JasonGauthierDK is offline
russy
Senior Member
Join Date: Sep 2010
Old 05-04-2011 , 15:04   Re: source to orangebox - ConCommands
Reply With Quote #3

i've already been using that which is how i knew

int numArgs = engine->Cmd_Argc() - 1;

should be

int numArgs = args.ArgC() - 1;
russy is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 05-04-2011 , 23:56   Re: source to orangebox - ConCommands
Reply With Quote #4

Did you correct the function prototype though?
(Which is a few lines below on that wiki page)
__________________
asherkin is offline
russy
Senior Member
Join Date: Sep 2010
Old 05-05-2011 , 05:07   Re: source to orangebox - ConCommands
Reply With Quote #5

i've already changed the "Registering console commands and variables" and i can't find anything for the other two to do with it.
russy is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-05-2011 , 08:37   Re: source to orangebox - ConCommands
Reply With Quote #6

http://wiki.alliedmods.net/Porting_to_Orange_Box
psychonic is offline
russy
Senior Member
Join Date: Sep 2010
Old 05-05-2011 , 12:17   Re: source to orangebox - ConCommands
Reply With Quote #7

yep i've also been using that lol but still stuck at the same piont

EDIT: Ok after looking for ages lol i've found the prototype and changed it but i still get that error but it's also created more errors as well as fixing them >.<

for example:
Code:
    int numArgs = args.ArgC - 1; // This still errors as normal
    
    int numParams = 0;
    
    for (int i = 0; i < numArgs; ++i)// From here down is shows no problem but when i try and compile it i get the error below:
    {    
        if (numParams >= paramList->Count())
            return NOT_ENOUGH_PARAMS;
            
        switch(paramList->Element(i)->type) 
        {
            case TYPE_STRING:            
                params[i] = new char[256];        
                    
                ++numParams;            
                switch (paramList->Element(i)->multi)
                {
                    case SINGLE_PARAM: 
                        strcpy((char*)params[i], args.Arg(i+1));
                    break;
                    
                    case MULTI_PARAM:
                        char buf[256];
                        strcpy(buf, args.Arg(i+1));
                        strcat(buf, " ");
                        int j;
                        for (j = i+1; j < numArgs; ++j)
                        {
                            strcat(buf, args.Arg(j+1));
                            strcat(buf, " ");
                        }
                        strcpy((char*)params[i], buf);
                        i = j;
                    break;
                }
            break;
new error:
Code:
1>zhcommand.cpp(209): error C2228: left of '.Arg' must have class/struct/union
1>          type is ''unknown-type''
1>zhcommand.cpp(214): error C2065: 'args' : undeclared identifier

Last edited by russy; 05-05-2011 at 18:36.
russy is offline
A.Davis
New Member
Join Date: May 2011
Old 05-14-2011 , 15:06   Re: source to orangebox - ConCommands
Reply With Quote #8

I've got the same problem.
- Did yu solved it?
A.Davis is offline
russy
Senior Member
Join Date: Sep 2010
Old 05-14-2011 , 15:33   Re: source to orangebox - ConCommands
Reply With Quote #9

i'm afraid not, i'm looking to fix it.
russy 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 23:53.


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