View Full Version : Inverse Vec Switcher
Apprentice
03-19-2004, 05:59 PM
Well, I have been trying to create an inverse vec switching system for my client hook. By this I mean a feature that will change what vec your aimbot uses depending on the enemy in question's current weapon.
I did get a script-based version working, but it is slow and laggy, and will get into a big mess if too many enemies appear at once. I hear it's possible to create a better switcher, which is quicker, doesn't create lag, and much more precise.
Is anybody willing to give me hints on how to create this, or post code? I'd appreciate any help at all!
:p
Azorbix
03-19-2004, 06:12 PM
1) find your target (enemy)
2) from your vecswitch code (whatever it may be) replace pMe (or whatever) to target..
3) done.
Apprentice
03-19-2004, 06:45 PM
Thanks a lot Azorbix, this helped me a lot! :D
HoooL
03-20-2004, 04:08 AM
but ehat would that be good for? i mean what has your vec to do with the enemies weapon? (kill me if i didnt get what u mean ;) )
RQZEE
03-20-2004, 04:39 AM
Weapon changes models head position a little.
De-Sire
03-20-2004, 05:46 AM
It's not the head position that really should be considered, yet the hitbox change that occurs with each weapon ;)
Apprentice
03-20-2004, 08:34 AM
Originally posted by De-Sire
It's not the head position that really should be considered, yet the hitbox change that occurs with each weapon ;)
Yes, an aiming vector should always be designed for your enemy's weapon, not your own. People seem to have forgotten this over time. The only part of your vector that is based on your own weapon is the recoil compensation value, the spread value, and perhaps your speed values. I hope this helps you understand why I would want my vec switcher to be inverse.
:p
v!p3r
03-20-2004, 08:58 AM
so it changes the vec when the enemy has a different gun??
thats awsome... i want that ;x
De-Sire
03-20-2004, 09:24 AM
Originally posted by Apprentice
Yes, an aiming vector should always be designed for your enemy's weapon, not your own. People seem to have forgotten this over time. The only part of your vector that is based on your own weapon is the recoil compensation value, the spread value, and perhaps your speed values. I hope this helps you understand why I would want my vec switcher to be inverse.
:p
I said that in support for inverse vec switching :p
I have some code an old friend made somewhere that altered your aiming according to your enemies gun.. I will see if I can dig it up
v!p3r
03-20-2004, 11:33 AM
uni if u find it u think i can try it out ?? that would be cool
Lance705
03-20-2004, 05:48 PM
if (target != -1 && cvar.gunswitch && me.alive) {
char signal[128];
sprintf(signal, "enemy_%s",gGetWeaponName(vPlayers[target].getEnt()->curstate.weaponmodel));
extern CommandInterpreter cmd;;
cmd.exec(signal);
}
iLuMiNaTi
03-20-2004, 06:50 PM
Well, I have the code you are looking for, it's called targetgun switch. Same concept as the one Lance705 just posted. Mine is kind of like the normal vecswitch except it finds the enemies weapon using "vPlayers[target].getEnt()->curstate.weaponmodel" instead of "me.ent->curstate.weaponmodel". I don't like useing signal. Only problem is I never could figure out where to put it.....I have tried many places....from FindTarget, to TargetRegion, DamageVec, Draw, HUd_Redraw, and a few other places I can't think of off the top of my head. Seemed a little laggy in those places. I'm sure there is a way to add it to Hud_PostrunCmd like the normal vec switch but I just got lazy and took targetgun out completely. Anyway it's an easy code to do so I wont post it unless you want it.
v!p3r
03-20-2004, 09:08 PM
iluminati, if u ever find a place to put it so it works, id really like to try it
Lance705
03-20-2004, 10:32 PM
Originally posted by iLuMiNaTi
Well, I have the code you are looking for, it's called targetgun switch. Same concept as the one Lance705 just posted. Mine is kind of like the normal vecswitch except it finds the enemies weapon using "vPlayers[target].getEnt()->curstate.weaponmodel" instead of "me.ent->curstate.weaponmodel". I don't like useing signal. Only problem is I never could figure out where to put it.....I have tried many places....from FindTarget, to TargetRegion, DamageVec, Draw, HUd_Redraw, and a few other places I can't think of off the top of my head. Seemed a little laggy in those places. I'm sure there is a way to add it to Hud_PostrunCmd like the normal vec switch but I just got lazy and took targetgun out completely. Anyway it's an easy code to do so I wont post it unless you want it.
Dan, mine is using GetEnt. Try reading the post.
Also, it will NOT work in postruncmd...
You need something that updates every time the target changes
(FindTarget)
De-Sire
03-21-2004, 07:14 AM
Mine is in HUD_PostRunCmd . . . :stunned:
CrazyLord
03-21-2004, 08:49 AM
it's in different places it's integrated in the whole source, check out ecko source, it's in it... also in intell final source, etc, etc
v!p3r
03-21-2004, 10:13 AM
so ecko source has inverse vec switch ??
CrazyLord
03-21-2004, 10:25 AM
tons of public sources have
Lance705
03-21-2004, 01:17 PM
Originally posted by De-Sire
Mine is in HUD_PostRunCmd . . . :stunned:
Hm, Just kidding, I just looked something up, and it was different than I thought
De-Sire
03-21-2004, 01:20 PM
lol :cool:
v!p3r
03-21-2004, 05:50 PM
so, can u have a regular vecswitch and an inverse vecswitch at the same time in the hack ??
iLuMiNaTi
03-21-2004, 07:50 PM
Well, Dan, I love you man! LMAO! Anyway, the yes the code for targetgun switch is in many public sources such as ecko and some other gay sources like intel final witch is POS source in itself.....but anyway, even though they have the code in them, they all put the code in FindTarget. I don't like that at all. Seems to lag when you use FindTarget or even using when target!=-1. That is why I think Hud_PostRunCmd would be a better choice. Maybe I'll have to make it again and see what I can come up with. I'm a n00bie at coding, been teaching myself as I go for the past 4 months or so.......so I'm not saying I know everything, I am just giving some kind of imput from what I have learned from fooling around. :-D Anyway, I do think targetgun is a good way to use vecs because of the hitbox crap......so good luck and I'll give it another crack.
- iLuMiNaTi
De-Sire
03-21-2004, 09:00 PM
Heh I didn't understand what you said but the red text is appealing ;)
v!p3r
03-22-2004, 01:30 PM
so, can u have a regular vecswitch and an inverse vecswitch in the same hack ??
CrazyLord
03-22-2004, 01:38 PM
offcourse, just deactivate one of the cvars
v!p3r
03-22-2004, 01:41 PM
u think i can get the code ??
v!p3r
03-22-2004, 09:12 PM
can anyone post the code for inverse vec switch (one that works) and show me where to put it ??
I am a nub and a hack but this is how I added it to LiquidFx 1.6
I added this to HUD_PostRunCmd right after gAimbot.findtarget
if(cvar.ivec && me.alive) {
if (strstr("usp",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_usp");
}
else if( strstr("glock18",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_glock18");
}
else if( strstr("ak47",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_ak47");
}
else if( strstr("deagle",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_deagle");
}
else if( strstr("p228",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_p228");
}
else if( strstr("elite",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_elite");
}
else if( strstr("fiveseven",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_fiveseven");
}
else if( strstr("sg552",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_sg552");
}
else if( strstr("m4a1",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_m4a1");
}
else if( strstr("scout",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_scout");
}
else if( strstr("knife",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_knife");
}
else if( strstr("mp5",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_mp5");
}
else if( strstr("xm1014",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_xm1014");
}
else if( strstr("m3",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_m3");
}
else if( strstr("mac10",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_mac10");
}
else if( strstr("aug",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_aug");
}
else if( strstr("smokegrenade",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_smokegrenade");
}
else if( strstr("hegrenade",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_hegrenade");
}
else if( strstr("c4",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_c4");
}
else if( strstr("ump45",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_ump45");
}
else if( strstr("sg550",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_sg550");
}
else if( strstr("awp",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_awp");
}
else if( strstr("m249",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_m249");
}
else if( strstr("tmp",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_tmp");
}
else if( strstr("g3sg1",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_g3sg1");
}
else if( strstr("flashbang",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_flashbang");
}
else if( strstr("p90",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_p90");
}
else if( strstr("galil",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
{
cmd.exec("ivec_galil");
}
else
{
cmd.exec("ivec_null");
}
}
dont forget to register the cvar
"_A']['ari_"
03-24-2004, 06:17 AM
hello void!!!
Look i wanna talk to you!!!
About some stuff... if you want please add me at your msn!!!
Or before mail me... M!chel!n@bragatel.pt or give me your mail
CrazyLord
03-24-2004, 06:41 AM
rofl, and i tought i was a noob in ogl etc, LOL, but this, LOL, viper, i told you already the code is in ecko source, you can download it at www.iluminati.bl.am!! and atari, what void posted was a regular vecswitch in hud_redraw so dont bother you about it
LoL, it may not be the best way to code it but it is not a regular vec switcher. it switches vec according to what weapon the enemy has. so it is inverse vec switching
if (strstr("usp",gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel)) )
notice gAimbot.target
so what im a nub, i was only trying to help
and what does it have to do with ogl anyway?
"_A']['ari_"
03-24-2004, 01:01 PM
phreak no one talk with you so... shup up!!!
Look i wanna talk about some things about sof2!!!
if you want please mail me at the mail i post before!!!
thks
v!p3r
03-24-2004, 01:27 PM
so wait that code is for inverse vec switch... and it works on a 1.5 hack ??
depends on the hack
here is another way
if(cvar.ivec && me.alive) {
char *w_name = gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel);
cmd.exec (w_name);
}
the alias names for the vecs are just the weapon names
glock18,p228,elite,famas,galil,ak47,m4a1,awp,m249 ect....
o, and atari, i doubt i could help you with anything but if you want i will email you. Im stumbling through code now
v!p3r
03-24-2004, 03:06 PM
where do i put it? would it go under regular vecswitch ??
i dont know what your using as a base, i have mine in HUD_PostRunCmd in client.cpp
the cvar "ivec" is registered in cvar.cpp and cvar.h
im using liquidFx 1.6 to learn with right now
xplicit
04-02-2004, 12:10 AM
Void
I am also using Liquid FX 1.6. Is the code you pasted on page 2 do the same thing as the code pasted on page 4? Do you need to make vecs after adding one of those code selections? Like do you need to add vecs into the hack, or create a cfg script? Maybe you can post an example. Thank you
The way Im currently doing inverse vec switching is like this
if(cvar.ivec && me.alive && gAimbot.target) {
char buf[52];
sprintf(buf, "ivec_%s", gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel) );
cmd.exec (buf);
}
you have to make a vec for each weapon the enemy could have. the aliases would look like this
ivec_m4a1 "vec"
ivec_ak47 "vec"
ect......
i added the cvar "ivec" which must be added to cvar.cpp and cvar.h
the code i posted with all the if statements is slow and laggy with a lot of enemies on a map like iceworld. this is a much better solution. All it does is when the aimbot finds a tartget, it looks to see which gun they have and execs that alias for the vec you created for that gun
xplicit
04-02-2004, 07:20 PM
if(cvar.ivec && me.alive && gAimbot.target) {
char buf[52];
sprintf(buf, "ivec_%s", gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel) );
cmd.exec (buf);
}
Am I right that I think that code would go under
void OriginAimbot::FindTarget()
in aimbot.cpp?
Sorry for the newb questions... These ivec vecs would go in a cfg?
ivec_m4a1 "vec"
ivec_ak47 "vec"
an example ivec would be something like this?
ivec_m4a1 "avclear;avadd 0 20 7 2;avadd 1 24 5 2;recoil 1.5;txt m4a1 Inverse Vec"
no alias ivec ...?
one last question, sorry
what about he/fb/sg and c4?
ive seen this in a cfg on a hook
alias enemy_flashbang " " //leave empty (we dont want no errors thats why its here)
alias enemy_hegrenade " " //leave empty (we dont want no errors thats why its here)
alias enemy_smokegrenade " " //leave empty (we dont want no errors thats why its here)
alias enemy_c4 " " //leave empty (we dont want no errors thats why its here)
thanks for the help so far Void
i have the code in client.cpp in the top of HUD_PostRunCmd
right after int Id;
as for the aliases
its alias ivec_m4a1 "whatever"
and i have vecs for the nades and c4 also. the only thing i havent dealt with yet is the shield. here is a list of the vecs i have
ivec_glock18
ivec_usp
ivec_p228
ivec_deagle
ivec_fiveseven
ivec_elite
ivec_m3
ivec_xm1014
ivec_tmp
ivec_mac10
ivec_mp5
ivec_ump45
ivec_p90
ivec_famas
ivec_galil
ivec_ak47
ivec_scout
ivec_m4a1
ivec_aug
ivec_sg552
ivec_awp
ivec_sg550
ivec_g3sg1
ivec_m249
ivec_knife
ivec_hegrenade
ivec_flashbang
ivec_smokegrenade
ivec_c4
ivec_null
ivec_ ";"
ivec_null is incase the offsets change or there is some other problem that makes all weapons appear as null
ivec_ ";" it to keep it from spamming the console when it doesnt not have a target. As far as I know this should not be a problem now since i added the gAimbot.target check into the If statement.
So just make each of these an alias with your vecs in them
And Im a nub too so I dont mind the questions as long as i can somewhat help
TuP4c
04-03-2004, 06:13 AM
this would work also
in hudpostruncmd
if(wx_cmd.enemy_weapon && me.alive)
{
char enemy_weapon[128];
sprintf(enemy_weapon, "enemyw_%s", gGetWeaponName(vPlayers[gBoT.target].getEnt()->curstate.weaponmodel));
cmd.exec(enemy_weapon);
}
if(wx_cmd.enemy_model && me.alive)
{
char enemy_model[128];
sprintf(enemy_model, "enemym_%s", vPlayers[gBoT.target].entinfo.model);
cmd.exec(enemy_model);
}
and for distance do something like this
if(wx_cmd.enemy_dist && me.alive)
{
int aim=gAimbot.target;
int aim_distance = vPlayers[aim].distance/10;
char enemy_dist[128];
sprintf(enemy_dist, "enemyd_%i", aim_distance);
cmd.exec(enemy_dist);
}
to use distance
alias enemyd_0
alias enemyd_1
etc etc etc till 400 or so
but you could also divide the distance checking(.distance/10;) even more or less
and for the checks(400), you could do something like this
if(aim_distance > 200)
{
// reset check distance
}
this dist code is not all, i got somewhere in one of my old hax src but its on cd so i made this quick up( it should work as its almost the same like mine)
also to use the others
alias enemym_sas ""
alias enemym_gign
etc gsg9,arctic,terror,leet,etc...
xplicit
04-03-2004, 10:08 AM
Void,
Thanks for all the help. I'll try all this soon.
Sorry, I only have 2 more questions I wanted to get cleared up.
All the ivec's could be put into say a made cfg (ivec.cfg) in the hack folder, and exec in the main.cfg?
Does
ivec_null
ivec_ ";"
stay like so or is changed to
alias ivec_null
alias ivec_ ";"
and should null ivec be
alias ivec_null " "
Thanks
i only added alias ivec_ ";" to stop it from spamming the hack console when i wasnt aimed at someone. It shouldnt do this anymore even if you dont use that alias but if you see it spamming the console just add it. You can put a default vec in either one. Or if you just put in a semicolon the last vec it used will stay loaded.
xplicit
04-03-2004, 12:58 PM
Again, thank you very much for all the personal help replies Void, I plan on adding this soon.
Akira123
04-22-2004, 04:23 PM
For a distance vec switch do this:
search this code
inline void drawPlayerEsp(int ax, bool inpvs)
below this code
if (cvar.distance)
if (GetPlayerVis(ax))
DrawHudStringCenter(vecScreen[0],vecScreen[1]+16,color->r,color->g,color->b,"-%i-",(short int)distance);
else
DrawHudStringCenter(vecScreen[0],vecScreen[1]+16,color->r,color->g,color->b,"%i", (short int)distance);
}
Put this
/distance switch by NgZ
if (cvar.distance_switch)
{
if(isEnemy(ax) && IsMeAlive())
{
if((short int)distance == 100)
{
cmd.exec("dist_100");
}
else if((short int)distance == 90)
{
cmd.exec("dist_90");
}
else if((short int)distance == 80)
{
cmd.exec("dist_80");
}
else if((short int)distance == 70)
{
cmd.exec("dist_70");
}
else if((short int)distance == 60)
{
cmd.exec("dist_60");
}
else if((short int)distance == 40)
{
cmd.exec("dist_40");
}
else if((short int)distance == 20)
{
cmd.exec("dist_20");
}
else if((short int)distance == 10)
{
cmd.exec("dist_10");
}
else if((short int)distance == 0)
{
cmd.exec("txt -=)Distance Switch Off(=-");
}
else if(!(short int)distance)
{
cmd.exec("dist_0");
}
}
}
Thx to Anubis for tutorials and C.a.S Forum
for vec u can do that
exemple 1:
//Distance vecs
alias dist_100 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 100%(=-"
alias dist_90 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 90%(=-"
alias dist_80 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 80%(=-"
alias dist_70 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 70%(=-"
alias dist_60 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 60%(=-"
alias dist_40 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 40%(=-"
alias dist_20 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 20%(=-"
alias dist_10 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 10%(=-"
alias dist_0 "avclear;avadd 0 x x x;avadd 1 x x x;txt -=)Distance Vecs 0%(=-"
Exemple 2:
//Distance burst
alias dist_100 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 100%(=-"
alias dist_90 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 90%(=-"
alias dist_80 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 80%(=-"
alias dist_70 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 70%(=-"
alias dist_60 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 60%(=-"
alias dist_40 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 40%(=-"
alias dist_20 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 20%(=-"
alias dist_10 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 10%(=-"
alias dist_0 "sdelay x.x,rdelay x.x,dtime x.x;ftime x.x;txt -=)Distance Burst 0%(=-"
Exemple 3:
//Distance Recoil
alias dist_100 "recoil x.x;txt -=)Distance Recoil 100%(=-"
alias dist_90 "recoil x.x;txt -=)Distance Recoil 90%(=-"
alias dist_80 "recoil x.x;txt -=)Distance Recoil 80%(=-"
alias dist_70 "recoil x.x;txt -=)Distance Recoil 70%(=-"
alias dist_60 "recoil x.x;txt -=)Distance Recoil 60%(=-"
alias dist_40 "recoil x.x;txt -=)Distance Recoil 40%(=-"
alias dist_20 "recoil x.x;txt -=)Distance Recoil 20%(=-"
alias dist_10 "recoil x.x;txt -=)Distance Recoil 10%(=-"
alias dist_0 "recoil x.x;txt -=)Distance Recoil 0%(=-"
i have joolz base and the code what u give dont work with me so u can post an example of code for inv vecswitch
RQZEE
04-23-2004, 05:44 AM
just leave all gaimbot. and such out and usercmd is just cmd
panzer
04-23-2004, 06:16 AM
this distance switch is bs, it would make u switch ur vec for every player whos esp is drawn. it should be target based.
I dont think all the IF...ELSE statements are good for vec switching based on targets either. I originally did my inverse weapon switch that way and small FY maps lagged like a bitch. That why i came up with the other way. It just reads what the target has for a weapon and execs a cmd
My new inverse vec switcher for anyone who cares
if(cvar.ivec && me.alive && gAimbot.target)
{
int seqinfo = Cstrike_SequenceInfo[vPlayers[gAimbot.target].getEnt()->curstate.sequence];
char buf[52];
if (seqinfo & SEQUENCE_SHIELD_SIDE)
{
char* tmpSeq = "shield";
sprintf(buf, "ivec_%s", tmpSeq );
cmd.exec (buf);
}
else
{
sprintf(buf, "ivec_%s", gGetWeaponName(vPlayers[gAimbot.target].getEnt()->curstate.weaponmodel) );
cmd.exec (buf);
}
}
its only to add a vec for shields to the side.
o, and this in the sequence info code im using
// Many thanks to LTFX for help with this
enum
{
SEQUENCE_IDLE = 0,
SEQUENCE_SHOOT = 1,
SEQUENCE_RELOAD = 2,
SEQUENCE_DIE = 4,
SEQUENCE_THROW = 8,
SEQUENCE_ARM_C4 = 16,
SEQUENCE_SHIELD = 32,
SEQUENCE_SHIELD_SIDE = 64
};
int Cstrike_SequenceInfo[] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0..9
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 10..19
1, 2, 0, 1, 1, 2, 0, 1, 1, 2, // 20..29
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, // 30..39
1, 2, 0, 1, 2, 0, 1, 2, 0, 1, // 40..49
2, 0, 1, 2, 0, 0, 0, 8, 0, 8, // 50..59
0, 5, 0, 5, 0, 0, 1, 1, 2, 0, // 60..69
1, 1, 2, 0, 1, 0, 1, 0, 1, 2, // 70..79
0, 1, 2, 32, 40, 32, 40, 32, 32, 32, // 80..89
33, 32, 33, 34, 64, 4, 34, 32, 32, 4, // 90..99
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 100..109
4 // 110
};
O, i just wanna say thank you to everyone here that helps nubs like me :D
If i ever forget to credit someone its not intentional. I get help from so many places I cant keep track. lol Maybe someday ill be able to give something back. For now i dont mind helping the people that are noobier than me hehe
[X]-P|o1T
05-14-2004, 06:14 PM
Sorry if I can't get my head around this, but this happens everytime I try to add someone's vecswitch type method.
if(cvar.ivec && IsMeAlive() && target)
{
int seqinfo = Cstrike_SequenceInfo[vPlayers[target].ent->curstate.sequence];
char signal [52];
if (seqinfo & SEQUENCE_SHIELD_SIDE)
{
char* tmpSeq = "shield";
sprintf(signal, "ivec_%s", tmpSeq );
cmd.exec (signal);
}
else
{
sprintf(signal, "ivec_%s", gGetWeaponName(vPlayers[target].ent->curstate.weaponmodel) );
cmd.exec (signal);
I always get the "left of '.exec' must have class/struct/union type" error. The only way I was able to get the normal vecswitch to work was using it this way.
else if (cvar.vecswitch==1 && IsMeAlive())
{
char signal0[128];
sprintf(signal0, "vecswitch_%s", gGetWeaponName(me.ent->curstate.weaponmodel));
extern CommandInterpreter cmd;;
cmd.exec(signal0);
}
Would someone please shed some light on this matter and if possible eleborate just a 'lil why the say text stays on when the normal vecswitch is enabled. :o :confused: I'd greatly appreciate it. Thanks.
PizzaPan
05-14-2004, 06:32 PM
iam guessing u have that in client.cpp, so just add at the top after the includes and crap
extern CommandInterpreter cmd;
[X]-P|o1T
05-14-2004, 06:55 PM
Yeah, I ended up getting it to compile after adding that. So that's what I figured, but I didn't know I could just add that to the top of my client.cpp. Will do that...
PizzaPan
05-14-2004, 07:00 PM
Yep its just saying cmd can be used same as Command, thats why u were getting left of .exec must have blah blah cause it didnt know what cmd was.
orion
10-15-2004, 08:53 AM
Hey guys, im using Void's inverse style and i put it in the begging of the clinet.cpp after all of the includes and i get 3 errors
error C2143: syntax error : missing ';' before 'if'
and
error C2447: missing function header (old-style formal list?)
i simply tried putting a ; the line before but that didn't help i think i put the code in the wrong spot can someone please point me out
:ermm: :confused:
Thx for and help
oRiOn
CrazyLord
10-15-2004, 09:27 AM
if you would show youre code, that would be helpfull
Only the sequence stuff goes in globals. The actual inverse code goes in whatever function you want it called in. Like HUD_PostRunCmd is where i used to have it.
Void when you gave me your inverse code like sometime ago the only thing I didnt like is how it echoed gsaim = 1 in console. Mine is bigger then yours but i simply like the fact that it goes by one alias for each gun group so i dont have to copy n paste all those vectors for each gun group and then change it again for all of em. Even thou it can be scripted I guess took the harder route.
lol, it doesnt echo gsaim 1 in the console. it has nothing to do with gsaim.
you had to have had it in your config somewhere. What you took was the slow
route with all the if statements. Actually Im sure there is a better way to do it the
way you like.
Powered by vBulletin® Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.