AlliedModders

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

Manikstor 05-31-2006 15:58

Help Code
 
Code:
// Includes #include <amxmodx> #include <fakemeta> #include <engine> // Define for stocks. #define inline stock // In an origin array, what is x y and z? 1 2 and 3 #define x 0 #define y 1 #define z 2 // Float for no recoil new Float:fire_time[33] = 0.0 // Shall we update your aim every frame? new bool:aimbot[33] = false // Stocks for conversions. inline Float:Distance2D( Float:X, Float:Y ) return floatsqroot( (X*X) + (Y*Y) ); inline Float:Distance3D( Float:X, Float:Y, Float:Z  ) return floatsqroot( (X*X) + (Y*Y) + (Z*Z) ); inline Float:Degree2Radian( Float:Degree ) return Degree / 360.0 * ( 2 * 3.141592653589793 ); inline Float:Radian2Degree( Float:Radian ) return Radian * 360.0 / ( 2 * 3.141592653589793 ); // The real bread and bother, developed by < Lord of Destruction > inline set_client_aiming( CoreID, TargetID, Float:AimOffset[2] = { 0.0, 0.0 }, Float:TargetOffset[3] = { 0.0, 0.0, 0.0 } ) {     new Float:CoreAngles[3] = { 0.0, 0.0, 0.0 };     new Float:CoreOrigin[3];     pev(CoreID, pev_origin, CoreOrigin );     new Float:TargetOrigin[3];     pev(TargetID, pev_origin, TargetOrigin );     // >> [ TargetOrigin Modifieres ]     new Float:TargetAngles[3];     pev(TargetID, pev_angles, TargetAngles );     new anglemode:Mode = degrees;     TargetOrigin[x] += TargetOffset[x] * floatsin( TargetAngles[y], Mode );     TargetOrigin[y] += TargetOffset[y] * floatcos( TargetAngles[y], Mode );     TargetOrigin[z] += TargetOffset[z];     // >> [ calculate Delta ]     new Float:DeltaOrigin[3];     for ( new i = 0; i < 3; i++ )         DeltaOrigin[i] = CoreOrigin[i] - TargetOrigin[i];     // >> [ calculate Vertical-AIM ]     CoreAngles[x] = Radian2Degree( floatatan( DeltaOrigin[z] / Distance2D( DeltaOrigin[x], DeltaOrigin[y] ), 0 ) );     CoreAngles[x] += AimOffset[y];     // >> [ calculate Horizontal-AIM }     CoreAngles[y] = Radian2Degree( floatatan( DeltaOrigin[y] / DeltaOrigin[x], 0 ) ) + AimOffset[x];     CoreAngles[y] += AimOffset[x];     ( DeltaOrigin[x] >= 0.0 ) ? ( CoreAngles[y] += 180.0 )/* Q1 & Q2 */ : ( CoreAngles[y] += 0.0 )/* Q3 & Q4 */;     set_pev( CoreID, pev_angles, CoreAngles,3 );     set_pev(CoreID, pev_fixangle, 1 );     return 1; } // Reset their time till next fire. public client_putinserver(id){     fire_time[id] = 0.0 } // Make sure their firing only when we let them. public pre_think(id){     new buttons = pev(id,pev_button)     if( floatcmp( fire_time[id], 0.0) != 0){         set_pev(id,pev_button,(buttons & ~IN_ATTACK));         return FMRES_HANDLED;     }     if(!(buttons & IN_ATTACK)) return FMRES_HANDLED;     fire_time[id] += 0.1;     return FMRES_HANDLED; } // Every 0.1 seconds, say that 0.1 seconds went by. public update_swing(){     for(new i = 0; i < get_maxplayers(); i++){         if( (floatcmp ( fire_time[i], 0.0 )) == 1) fire_time[i] =  floatsub ( fire_time[i], 0.1  )         if(fire_time[i] < 0.0) fire_time[i] = 0.0;     }     set_task(get_cvar_float("fire_update_rate"),"update_swing")     return PLUGIN_CONTINUE; } // Update their aim every frame. public server_frame() for(new i=0; i< get_maxplayers(); i++) if(aimbot[i] == true) aim_helper(i); // This is for finding out what vectors aim where. public aim_test(id){     new arg[32]     read_argv(1,arg,31)     new Float:x_c = floatstr(arg)     read_argv(2,arg,31)     new Float:y_c = floatstr(arg)     new tid = look_around(id,id)     new Float:aim[2]     aim[0] = x_c     aim[1] = y_c     //send_aim(id,tid)     set_client_aiming(id,tid, aim )     return PLUGIN_HANDLED; } // Stock for aiming. inline aim_helper(id){     new tid = look_around(id,id)     set_client_aiming(id,tid)     return 1; } // Stock for finding an appropriate person to aim at. inline look_around(id,tid){     while(tid > 0)     {         if( is_user_alive(tid) && (id != tid) ) break;         tid = find_ent_by_class(tid, "player")     }     return tid; } // Aiming commands. public aim_minus(id) aimbot[id] = false; public aim_plus(id) aimbot[id] = true; public toggle_aim(id) {     if(aimbot[id] == true) aimbot[id] = false;     else aimbot[id] = true     return PLUGIN_HANDLED; } // I hope you know what this is.... x.x public plugin_init(){     register_plugin("AimBot","1.17","Mel");     register_clcmd("toggle_aim","toggle_aim")     register_clcmd("aim_at","aim_test")     register_clcmd("+aimbot","aim_plus")     register_clcmd("-aimbot","aim_minus")     register_cvar("fire_update_rate","0.1")     update_swing()     register_forward(FM_PlayerPreThink,"pre_think") }

I have this plugin its a hacking plugin,i pretend to use it in a lan against my friends =)

is there anyway i can somehow code my steamid in here so even people with admin dont get it and only me, because i have a feeling they will abuse it.[/small]

Chex 06-02-2006 19:07

Code:
if(!(get_user_authid(id,<Steam id>)) {         client_print(id, print_console, "You do not have access to this command!^n")         return PLUGIN_HANDLED     }

I think that will work. Make sure to put it in the register_clcmd or register_concmd. : )

Note: I don't know if I should not help with a hacker plugin : \ Im sorry if I should not.

Chex 06-02-2006 19:08

Oops sorry about the double post. Pressed backspace :cry:

v3x 06-02-2006 19:15

Code:
new authid[33]; get_user_authid(id , authid , 32); if(!equal(authid , "STEAM_0:0:12345")) {   aimbot[id] = false;   return PLUGIN_CONTINUE; }
or something-ish ;)

Chex 06-02-2006 23:01

What does ! mean?

Smokey485 06-02-2006 23:13

Quote:

Originally Posted by Chex
What does ! mean?

false.

v3x 06-02-2006 23:22

or zero (0).

Chex 06-03-2006 00:34

Ok thanks thats what I thought.

VEN 06-03-2006 12:48

Basically ! negates the boolean meaning of the value.
So !false will not be false, but true. :)

Manikstor 06-04-2006 08:27

yeah thanks alot also i noticed when i have this plugin on, the bomb wont plant like i click on planting and it stops me from doing it >.<


All times are GMT -4. The time now is 16:29.

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