pluggin for a game

I already posted this issue in the beginner forum. When the compiler output was required, I posted it. But since then there was no replies. So, maybe this is the right place for this issue

Here is the code that is going to be a pluggin for a game

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
bool __stdcall CS_Knife_s::bAutoKnife ( usercmd_s *cmd )
{
    cl_entity_s *ent;
    float flDistance = 32;
    int iEntity;
    pmtrace_t gVis;
    vec3_t vForward, vecEnd;

    gEngfuncs.pfnAngleVectors ( gClient.flAimAngles, vForward, NULL, NULL );

    for ( int iCount = 1; iCount <= 2; iCount++ )
    {
        vecEnd[0] = gClient.flEyePos[0] + vForward[0] * flDistance;
        vecEnd[1] = gClient.flEyePos[1] + vForward[1] * flDistance;
        vecEnd[2] = gClient.flEyePos[2] + vForward[2] * flDistance;

        gEngfuncs.pEventAPI->EV_SetTraceHull ( 2 );
        gEngfuncs.pEventAPI->EV_PlayerTrace ( gClient.flEyePos, vecEnd, PM_STUDIO_BOX, -1, &gVis );

        iEntity = gEngfuncs.pEventAPI->EV_IndexFromTrace ( &gVis );

        ent = gEngfuncs.GetEntityByIndex ( iEntity );
                
        if ( ent->player )
        {
            if ( Aimbot.bIsEnemy ( iEntity ) )
            {
                if ( iCount == 1 )
                {
                    cmd->buttons |= IN_ATTACK2;

                    return true;
                }
                else if ( iCount == 2 )
                {
                    cmd->buttons |= IN_ATTACK;

                    return true;
                }
            }
            else
            {
                if ( iCount == 2 )
                    return false;
            }
        }
        else
        {
            if ( iCount == 2 )
                return false;
        }

        flDistance += 16.0f;
    }

    return false;
}


and here is compiler output

--------------------Configuration: mingw2.95 - LIB Debug, Builder Type: MinGW (Old)--------------------

Compiling *\Untitled1.cpp...
[Error] *\Untitled1.cpp:1: syntax error before `::'
[Error] *\Untitled1.cpp:6: syntax error before `;'
[Error] *\Untitled1.cpp:7: syntax error before `,'
[Error] *\Untitled1.cpp:9: syntax error before `.'
[Error] *\Untitled1.cpp:11: syntax error before `<='
[Error] *\Untitled1.cpp:11: syntax error before `++'
[Error] *\Untitled1.cpp:14: ANSI C++ forbids declaration `vecEnd' with no type
[Error] *\Untitled1.cpp:14: `gClient' was not declared in this scope
[Error] *\Untitled1.cpp:14: `vForward' was not declared in this scope
[Error] *\Untitled1.cpp:15: ANSI C++ forbids declaration `vecEnd' with no type
[Error] *\Untitled1.cpp:15: conflicting types for `int vecEnd[2]'
[Error] *\Untitled1.cpp:14: previous declaration as `int vecEnd[1]'
[Error] *\Untitled1.cpp:15: `gClient' was not declared in this scope
[Error] *\Untitled1.cpp:15: `vForward' was not declared in this scope
[Error] *\Untitled1.cpp:17: syntax error before `.'
[Error] *\Untitled1.cpp:18: syntax error before `.'
[Error] *\Untitled1.cpp:20: ANSI C++ forbids declaration `iEntity' with no type
[Error] *\Untitled1.cpp:20: redefinition of `int iEntity'
[Error] *\Untitled1.cpp:5: `int iEntity' previously declared here
[Error] *\Untitled1.cpp:20: `gEngfuncs' was not declared in this scope
[Error] *\Untitled1.cpp:20: `gVis' was not declared in this scope
[Error] *\Untitled1.cpp:22: ANSI C++ forbids declaration `ent' with no type
[Error] *\Untitled1.cpp:22: `gEngfuncs' was not declared in this scope
[Error] *\Untitled1.cpp:24: parse error before `if'
[Error] *\Untitled1.cpp:53: syntax error before `+='

Complete Compile *\Untitled1.cpp: 25 error(s), 0 warning(s)







Topic archived. No new replies allowed.