Short question about GSC Modding

Posts 16 of 6 · Page 1 of 1
Short question about GSC Modding
I'm trying to mod a Mod and I got two little questions :

1.What programming language is this ? It looks very much like C++ ... but i've tryed to use something from c++ and it didn't really work

2. How would you set a hotkey ?
I mean something like
Code:
if(Leftmousebuttonpressed)
{
doSomething();
}



Greez sh00ter999
Post in the correct section.

/moved 2 gsc help
self notifyOnPlayerCommand("anythinghere", "+key you can find in config_mp.cfg");

self waittill("anythinghere");
self suicide();
Quote Originally Posted by AZUMIKKEL View Post
self notifyOnPlayerCommand("anythinghere", "+key you can find in config_mp.cfg");

self waittill("anythinghere");
self suicide();
("anythinghere") = doSomething();?
[php]doSomething() //the function itself
{
notifyOnPlayerCommand("N", "+actionslot 1"); //if you want it to start on N
for(;
{
//Stuff here
//For ex.
self waittill("N");
self suicide();
}
}[/php]

Binds are these:
bind TAB "+scores"
bind ESCAPE "togglemenu"
bind SPACE "+gostand"
bind 1 "weapnext"
bind 2 "weapnext"
bind 3 "+actionslot 3"
bind 4 "+actionslot 4"
bind 5 "+actionslot 2"
bind A "+moveleft"
bind C "togglecrouch"
bind D "+moveright"
bind E "+melee"
bind F "+activate"
bind G "+frag"
bind N "+actionslot 1"
bind Q "+smoke"
bind R "+reload"
bind S "+back"
bind T "chatmodepublic"
bind W "+forward"
bind Y "chatmodeteam"
bind Z "+talk"
bind CTRL "toggleprone"
bind SHIFT "+breath_sprint"
bind MOUSE1 "+attack"
bind MOUSE2 "+toggleads_throw"
bind MOUSE3 "+frag"
Ok so if i try this then, I get a script compile (unknown function) error when i load the map

[php]
autoAim()
{
notifyOnPlayerCommand("O", "+actionslot 1");

for(;
{

self endon( "death" );
self endon( "disconnect" );

for(;
{
wait 0.01;
aimAt = undefined;
foreach(player in level.players)
{
if( (player == self) || (level.teamBased && self.pers["team"] == player.pers["team"]) || ( !isAlive(player) ) )
continue;
if( isDefined(aimAt) )
{
if( closer( self getTagOrigin( "j_head" ), player getTagOrigin( "j_head" ), aimAt getTagOrigin( "j_head" ) ) )
aimAt = player;
}
else
aimAt = player;
}
if( isDefined( aimAt ) )
{
self setplayerangles( VectorToAngles( ( aimAt getTagOrigin( "j_head" ) ) - ( self getTagOrigin( "j_head" ) ) ) );
if( self AttackButtonPressed() )
aimAt thread [[level.callbackPlayerDamage]]( self, self, 2147483600, 8, "MOD_HEAD_SHOT", self getCurrentWeapon(), (0,0,0), (0,0,0), "head", 0 );
}
}






self waittill("O");
self suicide();
}
}
[/php]
Posts 16 of 6 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?