AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need Assistance (https://forums.alliedmods.net/showthread.php?t=12709)

Leapor 04-22-2005 10:17

Need Assistance
 
Hay have a problem with a few things so there will be lots of need help post's in here

firstly i only just need to get my array.h file working

i keep getting constant errors on this
Code:
public:     float_s(){ isFree = false;}     std::vector;<REAL> v;     ~float_s() { v.clear(); }     bool isFree;     void reset() {         z = v.begin();

The Errors im getting are
Code:

error C2039: 'vector' : is not a member of 'std'
error C2501: 'float_s::vector' : missing storage-class or type specifiers
 error C2059: syntax error : '<'
error C2238: unexpected token(s) preceding ';'

We'll just start with these errors for the time

XxAvalanchexX 04-22-2005 14:08

Are you sure this is the Small scripting language? ;-)

xeroblood 04-22-2005 16:16

Looks like C++ to me, are you writing a module?

Either way, you std::vector syntax is wrong.. looks like you want:

Code:

std::vector<REAL> v;
Reference here: std::vector

Leapor 04-23-2005 00:49

:evil: I cant get it to work

Code:
std::vector<REAL> v;

i went to that website and it said alot of different stuff...but not what im looking for...

this is the code im using (the bottom part of the code is the error part)
Code:
#include "extdll.h" #include <string.h> #include <stdarg.h> #include <stdio.h> #include <cstdlib> #include <string> #include "vector.h" #include <list> #include <map> #include "adminxxmodule.h" #define destroy(x) if(x){delete(x);x=0;} #define destarr(x) if(x){delete[]x;x=0;} using namespace std; typedef std::map<std::string,std::string> keytab; enum {     list_int=1,     list_float,     list_string, }; enum {     a_shift=1,     a_unshift,     a_pop,     a_push,     a_n, }; class map_t { public:     map_t(){ isFree = false;}     keytab v;     ~map_t() { v.clear(); }     bool isFree;     void reset() {         z = v.begin();     }     int next() {         if (z == v.end() || ++z == v.end()) {             return 0;         }         return 1;     }     std::string key()     {         return z->first;     }     std::string val()     {         return z->second;     } private:     keytab::iterator z; }; class float_s { public:     float_s(){ isFree = false;}     std::vector<REAL> v     ~float_s() { v.clear(); }     bool isFree;     void reset() {         z = v.begin();     }     int next() {         if (z == v.end() || ++z == v.end()) {             return 0;         }         return 1;     }     REAL iter()     {         return *z;     } private:     std::vector<REAL>::iterator z; };

Error's im getting
Code:

array.h(67) : error C2039: 'vector' : is not a member of 'std'
array.h(67) : error C2501: 'float_s::vector' : missing storage-class or type specifiers
array.h(67) : error C2059: syntax error : '<'
array.h(67) : error C2238: unexpected token(s) preceding ';'
array.h(68) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
array.h(84) : error C2039: 'vector' : is not a member of 'std'
array.h(84) : error C2143: syntax error : missing ';' before '<'
array.h(84) : error C2501: 'float_s::vector' : missing storage-class or type specifiers
array.h(84) : error C2955: 'std::iterator' : use of class template requires template argument list
xutility(66) : see declaration of 'std::iterator'
array.h(84) : error C2238: unexpected token(s) preceding ';


NiGHTFiRE 04-23-2005 02:50

Are you making a module or trying to make a plugin? Because if you are trying to make a plugin you are making it all wrong. The script language you are writing in is C++(duh) and the amxx language is Small

n0obie4life 04-23-2005 03:29

lol....C+...

Leapor 04-23-2005 05:30

Making a module

Can you just help me fix this error..i would greatly appreciate the help...and yes i am well aware it is not small and that it is C++...i just thought you guys could give me a hand

XxAvalanchexX 04-23-2005 12:17

Quote:

Originally Posted by Leapor
i just thought you guys could give me a hand

Nope!

You're going to find a lot of Small programmers in the Scripting Help forum and barely any C++ programmers here. Post your problem in the Modules forums.


All times are GMT -4. The time now is 09:54.

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