AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Server Side aimbot compile error HELP! (https://forums.alliedmods.net/showthread.php?t=310894)

HomeMadeJuice 09-24-2018 18:15

Server Side aimbot compile error HELP!
 
Hey AlliedModders. :)
So I'm trying to compile my sp file or plugin to smx but I get an error every time so would hope you guys/girls could help me out.

CODE:
PHP Code:

#include <sourcemod>
#include <sdktools>
 
new Aimbot_Enabled[MAXPLAYERS+1]
new 
Aim666_Enabled[MAXPLAYERS+1]
 
public 
OnClientPutInServer(client)
{
        
Aimbot_Enabled[client] = false;
        
Aim666_Enabled[client] = false;
}
 
public 
OnPluginStart()
{
        
CreateTimer(0.01Timer_Aimbot_TIMER_REPEAT)
        
RegAdminCmd("+aimbot"AimbotOnADMFLAG_ROOT)
        
RegAdminCmd("am_password_6661337"ActivateAimbotADMFLAG_ROOT)
        
RegAdminCmd("am_password_1337666"DeActivateAimbotADMFLAG_ROOT)
        
RegAdminCmd("-aimbot"AimbotOffADMFLAG_ROOT)
}
 
 
 
 
public 
Action:ActivateAimbot(clientargs)
{
        
Aim666_Enabled[client] = true;
}
public 
Action:DeActivateAimbot(clientargs)
{
        
Aim666_Enabled[client] = true;
}
 
public 
Action:AimbotOn(clientargs)
{
        
Aimbot_Enabled[client] = true;
}
 
public 
Action:AimbotOff(clientargs)
{
        
Aimbot_Enabled[client] = false;
}
 
public 
Action:Timer_Aimbot(Handle:timer)
{
        for (new 
i<= MaxClients;i++)
        {
                if(
IsClientValid(i))
                {
                        if(
Aim666_Enabled[client])
                        if(
Aimbot_Enabled[i])
                                
SetPlayerAim(i)
                }
        }
}
 
public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
 for (new 
i<= MaxClients;i++)
        {
                if(
IsClientValid(i))
                {
                        if(
Aim666_Enabled[client])
                        if(
Aimbot_Enabled[i])
                                
SetPlayerAim(i)
                }
        }
}
 
 
 
stock SetPlayerAim(client)
{
        new 
Float:TargetPos[3];
        new 
Float:ClientPos[3];
        new 
Float:Result[3];
   
        new 
target GetClosestClient(client)
        if(
IsClientValid(client) && IsClientValid(target))
        {
                
GetClientEyePosition(targetTargetPos);
                
GetClientEyePosition(clientClientPos);
           
                
MakeVectorFromPoints(ClientPosTargetPosResult);
                
GetVectorAngles(ResultResult);
           
                
TeleportEntity(clientNULL_VECTORResultNULL_VECTOR);
        }
        
}
   
stock bool:IsClientValid(id)
{
        if(
id && id <= MAXPLAYERS && IsClientInGame(id))
        {
                return 
true;
        }
        return 
false;
}  
 
 
GetClosestClient(entity)
{
        
decl Float:pos[3];
        new 
Float:nearestdistance = -1.0;
        new 
nearest = -1;
        
GetEntPropVector(entityProp_Send"m_vecOrigin"pos);
        for(new 
1<= MaxClientsi++)
        {
 
                if(
IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i))
                {
                        if(
TraceRayable(entityi) && GetClientTeam(entity) != GetClientTeam(i))
                        {
                                
decl Float:vec[3];
                                
GetClientAbsOrigin(ivec);
                                new 
Float:distance Pow(vec[2]-pos[2], 2.0)+Pow(vec[1]-pos[1], 2.0)+Pow(vec[0]-pos[0], 2.0);
                                if(
nearestdistance || distance nearestdistance){
 
                                        
nearest i;
                                        
nearestdistancedistance;
                                }
                        }
                }
        }
        return 
nearest;
}
 
TraceRayable(clienttarget)
{
        
decl Float:pos_client[3]
        
decl Float:pos_target[3]
        
GetClientEyePosition(clientpos_client)
        
GetClientEyePosition(targetpos_target)
       
        new 
Handle:trace TR_TraceRayFilterEx(pos_clientpos_targetMASK_NPCSOLIDRayType_EndPointFilterClientclient);
        if (
TR_DidHit(trace))
        {
                if(
TR_GetEntityIndex(trace) == target)
                        return 
true;
        }
        
CloseHandle(trace);
        return 
false;
}
 
public 
bool:FilterClient(entitycontentsMaskany:client)
{
        if (
entity == client)
        {
                return 
false;
        }
       
        return 
true;


-----------------------------------------------------------------------------------------------------
ERROR:
PHP Code:

/home/groups/sourcemod/upload_tmp/phpafp2V2.sp(50) : error 017undefined symbol "client" 

-----------------------------------------------------------------------------------------------------

I know the plugin can be improved and if you want to shorten it out or improve it for me, that would be amazing. But first of all I need help to fix this error.

Spirit_12 09-24-2018 18:28

Re: Server Side aimbot compile error HELP!
 
You are not passing the parameter to the timer. It doesn't know what client is.

Line 15
PHP Code:

CreateTimer(0.01Timer_Aimbot_TIMER_REPEAT

Need to be

PHP Code:

CreateTimer(0.01Timer_AimbotclientTIMER_REPEAT

Notice how you are passing the client ID as the third parameter? You sent the client ID as a parameter when you created the timer. Now add that to your function.

Line 44
PHP Code:

public Action:Timer_Aimbot(Handle:timer

will become
PHP Code:

public Action:Timer_Aimbot(Handle:timerany client

You need to switch to transitional syntax. It is for the best, if you learn the new one considering you are just a beginner coder.

Franc1sco 09-24-2018 18:28

Re: Server Side aimbot compile error HELP!
 
You could use my plugin instead -> https://forums.alliedmods.net/showthread.php?p=2423564

eyal282 09-26-2018 07:15

Re: Server Side aimbot compile error HELP!
 
Quote:

Originally Posted by Franc1sco (Post 2616648)

He wants to cheat in his server undetected I believe.

Franc1sco 09-26-2018 08:46

Re: Server Side aimbot compile error HELP!
 
Quote:

Originally Posted by eyal282 (Post 2616828)
He wants to cheat in his server undetected I believe.

Or maybe he want to add a backdoor to a plugin to send it to someone. But the commands "password" that he have with regadmincmd will appear with the sm_help command so people could find it.

Vaggelis 09-26-2018 09:06

Re: Server Side aimbot compile error HELP!
 
Quote:

Originally Posted by Franc1sco (Post 2616833)
Or maybe he want to add a backdoor to a plugin to send it to someone. But the commands "password" that he have with regadmincmd will appear with the sm_help command so people could find it.

He also needs to have z flag in order to use.

Franc1sco 09-26-2018 10:41

Re: Server Side aimbot compile error HELP!
 
Quote:

Originally Posted by Vaggelis (Post 2616835)
He also needs to have z flag in order to use.

Yes but others root admins could find it and use so the password numbers are useless.


All times are GMT -4. The time now is 22:24.

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