Raised This Month: $51 Target: $400
 12% 

Convert a plugin 1.6 to CS:GO


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
h3h3
Senior Member
Join Date: Sep 2011
Old 11-07-2015 , 06:31   Convert a plugin 1.6 to CS:GO
Reply With Quote #1

Hey guys,
I would like to know if ,by any chance, the following plugin that is 1.6's AMxx intended, to make it fully working at CS:GO ?
If not, I would like to know if there's anything similar to it? Tried to search but no luck
Willing to pay some if this should be remake.

Quote:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <xs>

new normalTrace[33], aiming_good[33], cstrike, iag_cv_noknives, iag_cv_auto, maxPlayers;

public plugin_init()
{
register_plugin("i aim good","0.21","Avalanche");

iag_cv_noknives = register_cvar("iag_cv_noknives","1");
iag_cv_auto = register_cvar("iag_cv_auto","0");

register_forward(FM_TraceLine,"fw_traceline", 1);

register_concmd("iag_set","cmd_setaim",ADMIN_ BAN,"<target> <0|1> - makes target aim good, or not");
register_concmd("iag_auto","cmd_auto",ADMIN_B AN,"<0|1> - sets automatic aim good mode on or off");

new mod[9];
get_modname(mod,;
if(equal(mod,"cstrike") || equal(mod,"czero")) cstrike = 1;

maxPlayers = get_maxplayers();
}

// client joins
public client_connect(id)
{
normalTrace[id] = 0;
}

// client leaves
public client_disconnect(id)
{
normalTrace[id] = 0;
}

// client picks a team
public client_putinserver(id)
{
if(get_pcvar_num(iag_cv_auto)) aiming_good[id] = 1;
else aiming_good[id] = 0;
}

// command to set someone's aiming good ability
public cmd_setaim(id,level,cid)
{
if(!cmd_access(id,level,cid,3))
return PLUGIN_HANDLED;

new target[32], targetName[32], mode[2];
read_argv(1,target,31);
read_argv(2,mode,1);

/******************************
** GATHER TARGETS *************
*******************************/

new targets[32], tNum, i, key = toupper(target[1]);

// everyone
if(equali(target,"@ALL",4) || target[0] == '*')
{
get_players(targets,tNum,"h");
targetName = "ALL PLAYERS";
}

// all terrorists
else if(target[0] == '@' && key == 'T')
{
get_players(targets,tNum,"eh","TERRORIST");
targetName = "ALL TERRORISTS";
}

// all counter-terrorists
else if(target[0] == '@' && key == 'C')
{
get_players(targets,tNum,"eh","CT");
targetName = "ALL COUNTER-TERRORISTS";
}

// all bots
else if(target[0] == '@' && key == 'B')
{
for(i=1;i<=maxPlayers;i++)
{
if(is_user_connected(i) && !is_user_hltv(i) && is_user_bot(i))
targets[tNum++] = i;
}
targetName = "ALL BOTS";
}

// all humans
else if(target[0] == '@' && key == 'H')
{
for(i=1;i<=maxPlayers;i++)
{
if(is_user_connected(i) && !is_user_hltv(i) && !is_user_bot(i))
targets[tNum++] = i;
}
targetName = "ALL HUMANS";
}

// all admins
else if(target[0] == '@' && key == 'A')
{
for(i=1;i<=maxPlayers;i++)
{
if(is_user_connected(i) && !is_user_hltv(i) && is_user_admin(i))
targets[tNum++] = i;
}
targetName = "ALL ADMINS";
}

// all users
else if(target[0] == '@' && key == 'U')
{
for(i=1;i<=maxPlayers;i++)
{
if(is_user_connected(i) && !is_user_hltv(i) && !is_user_admin(i))
targets[tNum++] = i;
}
targetName = "ALL NON-ADMINS";
}

// specific player
else
{
new tIndex = cmd_target(id,target,2);

// couldn't find him
if(!tIndex) return PLUGIN_HANDLED;

targets[tNum++] = tIndex;

new name[32];
get_user_name(tIndex,name,31);
format(targetName,31,"%s",name);
}

/******************************
** DO THE REST ****************
*******************************/

// make all those players whatever
new val = str_to_num(mode);
for(i=0;i<tNum;i++) aiming_good[targets[i]] = val;

if(val) console_print(id,"* %s now aim(s) good!",targetName);
else console_print(id,"* %s no longer aim(s) good!",targetName);

return PLUGIN_HANDLED;
}

// command to enable auto mode
public cmd_auto(id,level,cid)
{
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;

new mode[2], val, i;
read_argv(1,mode,1);
val = str_to_num(mode);

set_pcvar_num(iag_cv_auto,val);
for(i=1;i<=maxPlayers;i++) aiming_good[i] = val;

if(val) console_print(id,"* Automatic aiming good has been enabled");
else console_print(id,"* Automatic aiming good has been disabled");

return PLUGIN_HANDLED;
}

// someone is shooting, or something...
public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id,ptr)
{
if(!is_user_connected(id))
return FMRES_IGNORED;

// grab normal trace
if(!normalTrace[id])
{
normalTrace[id] = ptr;
return FMRES_IGNORED;
}

// ignore normal trace
else if(ptr == normalTrace[id])
return FMRES_IGNORED;

if(!is_user_alive(id) || !aiming_good[id])
return FMRES_IGNORED;

if(cstrike)
{
new weapon = get_user_weapon(id);

if(weapon == CSW_HEGRENADE || weapon == CSW_FLASHBANG || weapon == CSW_SMOKEGRENADE || weapon == CSW_C4)
return FMRES_IGNORED;

if(weapon == CSW_KNIFE && get_pcvar_num(iag_cv_noknives))
return FMRES_IGNORED;
}

// get crosshair aim
static Float:aim[3];
get_aim(id,v1,aim);

// do another trace to this spot
new trace = create_tr2();
engfunc(EngFunc_TraceLine,v1,aim,noMonsters,i d,trace);

// copy ints
set_tr2(ptr,TR_AllSolid,get_tr2(trace,TR_AllS olid));
set_tr2(ptr,TR_StartSolid,get_tr2(trace,TR_St artSolid));
set_tr2(ptr,TR_InOpen,get_tr2(trace,TR_InOpen ));
set_tr2(ptr,TR_InWater,get_tr2(trace,TR_InWat er));
set_tr2(ptr,TR_pHit,get_tr2(trace,TR_pHit));
set_tr2(ptr,TR_iHitgroup,get_tr2(trace,TR_iHi tgroup));

// copy floats
get_tr2(trace,TR_flFraction,aim[0]);
set_tr2(ptr,TR_flFraction,aim[0]);
get_tr2(trace,TR_flPlaneDist,aim[0]);
set_tr2(ptr,TR_flPlaneDist,aim[0]);

// copy vecs
get_tr2(trace,TR_vecEndPos,aim);
set_tr2(ptr,TR_vecEndPos,aim);
get_tr2(trace,TR_vecPlaneNormal,aim);
set_tr2(ptr,TR_vecPlaneNormal,aim);

// get rid of new trace
free_tr2(trace);

return FMRES_IGNORED;
}

// gets the end point of an imaginary 2048.0 line from the player's aim
get_aim(id,Float:source[3],Float:ret[3])
{
static Float:vAngle[3], Float:pAngle[3], Float:dir[3], Float:temp[3];

// get aiming direction from forward global based on view angle and punch angle
pev(id,pev_v_angle,vAngle);
pev(id,pev_punchangle,pAngle);
xs_vec_add(vAngle,pAngle,temp);
engfunc(EngFunc_MakeVectors,temp);
global_get(glb_v_forward,dir);

/* vecEnd = vecSrc + vecDir * flDistance; */
xs_vec_mul_scalar(dir,8192.0,temp);
xs_vec_add(source,temp,ret);
}
Sorry about my english

Last edited by h3h3; 11-07-2015 at 06:35.
h3h3 is offline
tommie113
AlliedModders Donor
Join Date: Oct 2013
Old 11-07-2015 , 08:13   Re: Convert a plugin 1.6 to CS:GO
Reply With Quote #2

I think it's better to describe its functionality instead of pasting the raw code.
By knowing what it does it makes rewriting it a lot easier.
__________________
No longer taking requests due to lack of time and interrest.
Only helping out with minor things through forum.
tommie113 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 16:45.


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