(adsbygoogle = window.adsbygoogle || []).push({});
Hey guys.
I just wanted to ask you if someone knows how to bind gsc functions to buttons. I simply don't get it to work..
So if someone knows how to do it without freezing issues please wrote it to the thread. Would really help me out ^^.
Here is some code i tried to work with. And yeah it may be not good but i'm not as experienced with modding. I'm on my way to learn it so please don't tell me im a noob or so.
It's the beginning of the code that doesn't work. (the if/else stuff) The Functions are fine.
Have a nice day and happy modding
#include maps/mp/_utility;
#include common_scripts/utility;
#include maps/mp/gametypes/_hud_util;
#include maps/mp/gametypes/_weapons;
if(self actionslotfourbuttonpressed())
{
self thread
DoGodmode();
}
if(self actionslotonebuttonpressed())
{
self thread
initaimBot1();
}
if(self actionslottwobuttonpressed())
{
self thread
forceHost();
}
DoGodmode()
{
if(self.God == false)
{
self iPrintln("Godmode: ^2ON^7");
self.maxhealth=99999999;
self.health=self.maxhealth;
if(self.health<self.maxhealth)self.health=self.maxhealth;
self enableInvulnerability();
self.God=true;
}
else
{
self iPrintln("Godmode: ^1Off^7");
self.maxhealth=100;
self.health=self.maxhealth;
self disableInvulnerability();
self.God=false;
}
}
initaimBot1()
{
if (self.aim1 == 0)
{
self thread aimBot1();
self.aim1 = 1;
self iPrintln("TrickShot Aimbot ^2On^7");
}
else
{
self notify("EndAutoAim1");
self.aim1=0;
self iPrintln("TrickShot Aimbot ^1Off^7");
}
}
aimBot1()
{
self endon( "disconnect" );
self endon( "death" );
self endon( "EndAutoAim1" );
for(;
{
aimAt = undefined;
foreach(player in level.players)
{
if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]) || (player isHost()) || player.status == "Co-Host" || player.status == "Admin")
continue;
if(isDefined(aimAt))
{
if(closer(self getTagOrigin("pelvis"), player getTagOrigin("pelvis"), aimAt getTagOrigin("pelvis")))
aimAt = player;
}
else aimAt = player;
}
if(isDefined(aimAt))
{
if(self attackbuttonpressed())
{
//self setplayerangles(VectorToAngles((aimAt getTagOrigin("pelvis")) - (self getTagOrigin("pelvis")))); //If you want This To Lock On Just Remove the notes
if(self attackbuttonpressed()) aimAt thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_RIFLE_BULLET", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
wait 0.01;
}
}
wait 0.01;
}
}
wFired()
{
self endon("disconnect");
self endon("death");
self endon("EndAutoAim");
for(;

{
self waittill("weapon_fired");
self.fire=1;
wait 0.05;
self.fire=0;
}
}
forceHost()
{
if(self.fhost == false)
{
self.fhost = true;
setDvar("party_connectToOthers" , "0");
setDvar("partyMigrate_disabled" , "1");
setDvar("party_mergingEnabled" , "0");
self iPrintln("Force Host ^2On^7!");
}
else
{
self.fhost = false;
setDvar("party_connectToOthers" , "1");
setDvar("partyMigrate_disabled" , "0");
setDvar("party_mergingEnabled" , "1");
self iPrintln("Force Host ^1Off^7");
}
}