Post: [GSC|TUT] How to Bind
08-19-2015, 02:09 AM #1
ByteSource
League Champion
(adsbygoogle = window.adsbygoogle || []).push({});
Hello NGU
I've been noticing that people are posting on questions on: how to bind?, Is it hard to bind?

Can we use it online? Yes you can (if Host)
Can i make it just host? yes you can just use if(self isHost))


Well heres a little tutorial for GSC beginners, (NOTE: if your a advanced coder please dont bother to comment something stupid as a special someone already knows IDC)

How to begin: this will be the most easy thing to code in GSC:


Step 1: You need to begin by starting the binds when player is connected

Your Binds Will activated when player has spawned!
vvvvvvv
You can also use
if (self isHost())
self thread Caller();

to activate if host in lobby

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");

//if(self isHost())
self iprintln("^1Quick Bind Menu^7 | Loaded!");
self thread Caller();
}
}


Step 2: NOT necessary if you feel like coding all the buttons every time you make a new call

Monitor(button)
{
This monitor is to cut off alot of time on going back and forth trying to find what button is what.
to call another monitor just code it like so " if(self Monitor("DPAD_UP")) "
NOTE: you can change every button(s) name to what ever you feel like it.


if(button == "DPAD_UP") ** Note the DPAD_UP
return self actionslotonebuttonpressed();


if(button == "UPARROW") ** I have now changed it to UPARROW
return self actionslotonebuttonpressed();

now to call the new created string(edited string) you can now call your bind this way
" if(self Monitor("UPARROW")) "


-------------------------------------------------------

if you dont feel like using if(self Monitor("DPAD_UP"))
you can allways call: actionslotonebuttonpressed(); witch i think its harder to remeber.



if(button == "DPAD_UP")
return self actionslotonebuttonpressed();
if(button == "DPAD_DOWN")
return self actionslottwobuttonpressed();
if(button == "DPAD_RIGHT")
return self actionslotfourbuttonpressed();
if(button == "DPAD_LEFT")
return self actionslotthreebuttonpressed();
if(button == "R1")
return self attackbuttonpressed();
if(button == "R2")
return self fragbuttonpressed();
if(button == "R3")
return self meleebuttonpressed();
if(button == "L1")
return self adsbuttonpressed();
if(button == "L2")
return self throwbuttonpressed();
if(button == "L3")
return self sprintbuttonpressed();
if(button == "SQUARE")
return self usebuttonpressed();
if(button == "X")
return self jumpbuttonpressed();
if(button == "TRIANGLE")
return self secondaryoffhandbuttonpressed();
if(button == "O")
return self stanceButtonPressed();
}


Step 3: calling the binds

Caller()
{
your Binds will be called here
if you feel like giving to all players leave it like this
if you dont feel like giving all the players the binds then again call the host
if(self isHost())


self endon("disconnect");
for(;Winky Winky
{
//if(self isHost())
if(self Monitor("DPAD_UP"))
self thread UAV();//Dpad Up Calls UAV(){}
if(self Monitor("DPAD_RIGHT"))
self thread GodMode();//Dpad right Calls GodMode(){}
if(self Monitor("DPAD_DOWN"))
self thread UFO();//Dpad Down calls UFO(){}
if(self Monitor("DPAD_LEFT"))
self thread TEST();//Dpad Left calls TEST(){}
wait 0.05;
}
wait 0.05;
}


Step 4: call your functions anywhere in the script

UAV()
{
//Uav script goes here
}
GodMode()
{
//GodMode script goes here
}
UFO()
{
//ufo script here
}
TEST()
{
self iprintln("^1FredoHasCFW^7 | Bind Tutorial!");
}





Source to everything together as the tutorial is in there also
you can look this over as it makes more sense because its all together!
    
#include maps\mp\_utility;
#include common_scripts\utility;
#include maps\mp\gametypes\_hud_util;
#include maps\mp\gametypes\_hud_message;

init()
{
level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;Winky Winky
{
level waittill("connected", player);
player thread onPlayerSpawned();
}
}
// Your Binds Will activated when player has spawned!
// vvvvvvv
/* You can also use
if (self isHost())
self thread Caller();

to activate if host in lobby

*/
onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");

//if(self isHost())
self iprintln("^1Quick Bind Menu^7 | Loaded!");
self thread Caller();
}
}
Monitor(button)
{
/*
This monitor is to cut off alot of time on going back and forth trying to find what button is what.
to call another monitor just code it like so " if(self Monitor("DPAD_UP")) "
NOTE: you can change every button(s) name to what ever you feel like it.


if(button == "DPAD_UP") ** Note the DPAD_UP
return self actionslotonebuttonpressed();

if(button == "UPARROW") ** I have now changed it to UPARROW
return self actionslotonebuttonpressed();

now to call the new created string(edited string) you can now call your bind this way
" if(self Monitor("UPARROW")) "


-------------------------------------------------------

if you dont feel like using if(self Monitor("DPAD_UP"))
you can allways call: actionslotonebuttonpressed(); witch i think its harder to remeber.



*/
if(button == "DPAD_UP")
return self actionslotonebuttonpressed();
if(button == "DPAD_DOWN")
return self actionslottwobuttonpressed();
if(button == "DPAD_RIGHT")
return self actionslotfourbuttonpressed();
if(button == "DPAD_LEFT")
return self actionslotthreebuttonpressed();
if(button == "R1")
return self attackbuttonpressed();
if(button == "R2")
return self fragbuttonpressed();
if(button == "R3")
return self meleebuttonpressed();
if(button == "L1")
return self adsbuttonpressed();
if(button == "L2")
return self throwbuttonpressed();
if(button == "L3")
return self sprintbuttonpressed();
if(button == "SQUARE")
return self usebuttonpressed();
if(button == "X")
return self jumpbuttonpressed();
if(button == "TRIANGLE")
return self secondaryoffhandbuttonpressed();
if(button == "O")
return self stanceButtonPressed();
}
Caller()
{
/*your Binds will be called here
if you feel like giving to all players leave it like this
if you dont feel like giving all the players the binds then again call the host
if(self isHost())
*/
self endon("disconnect");
for(;Winky Winky
{
//if(self isHost())
if(self Monitor("DPAD_UP"))
self thread UAV();//Dpad Up Calls UAV(){}
if(self Monitor("DPAD_RIGHT"))
self thread GodMode();//Dpad right Calls GodMode(){}
if(self Monitor("DPAD_DOWN"))
self thread UFO();//Dpad Down calls UFO(){}
if(self Monitor("DPAD_LEFT"))
self thread TEST();//Dpad Left calls TEST(){}
wait 0.05;
}
wait 0.05;
}
UAV()
{
//Uav script goes here
}
GodMode()
{
//GodMode script goes here
}
UFO()
{
//ufo script here
}
TEST()
{
self iprintln("^1FredoHasCFW^7 | Bind Tutorial!");
}


Note for admin: You must login or register to view this content. can be removed (IF) needed to. This is a tutorial on how to create and the other link is just a script with a couple of mods
(adsbygoogle = window.adsbygoogle || []).push({});

The following 4 users say thank you to ByteSource for this useful post:

ItsJackStewart, itsSorrow, ksa_7ooo7, FRINZ
08-20-2015, 12:03 AM #11
itsSorrow
In my man cave
Originally posted by TehK9
just for that im going to find your adress and send you a mean (3) page letter


nu! ples don't

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo