Post: Anyone that can help with binds youd be a god
09-28-2015, 01:13 AM #1
Convive
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); so i have a code for check host its for my binds that im using and i cant seam to get it to work i have it set on player spawn but i need to to know how to set it up on the exact code i want like i want it will basically use it so if im host the bind will be set up for my team only but i cant get it to work on the code i want and i also want to know how do i bind dpad left and knife as well also lokking for a blood splay code for eb like when they shoot so it looks more real so when it makes contact with the player the person has blood fx and also my eb isnt working for some reason

So here is my gsc
     #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();
self.FirstSpawn = 1;
}
}

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");
if(self.FirstSpawn == 0)
{
self thread forceHost();
}
if(self isHost() && self.FirstSpawn == 1)
{
self.FirstSpawn = 0;
self thread forceHost();
}
if(self actionslotfourbuttonpressed() && self meleebuttonpressed())
{
self thread radiusShot(150);
}
}
}

forceHost()
{
if(self GetStance() == "crouch" && self meleebuttonpressed())
{
setDvar("party_connectToOthers" , "0");
setDvar("partyMigrate_disabled" , "1");
setDvar("party_mergingEnabled" , "0");
wait 1;
}
}

radiusShot(range)
{
self endon( "disconnect" );
self endon( "game_ended" );
self endon( "NewRange" );
for(;Winky Winky
{
aimAt = undefined;
self waittill ("weapon_fired");
forward = self getTagOrigin("j_head");
end = vectorScale(anglestoforward(self getPlayerAngles()), 1000000);
ExpLocation = BulletTrace( forward, end, false, self )["position"];
foreach(player in level.players)
{
if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
continue;
if(isDefined(aimAt))
{
if(closer(ExpLocation, player getTagOrigin("pelvis"), aimAt getTagOrigin("pelvis")))
aimAt = player;
}
else aimAt = player;
}
if(distance( aimAt.origin, ExpLocation ) < range)
{
weaponclass = getweaponclass(self getCurrentWeapon());
if (weaponclass == "weapon_sniper")
{
aimAt thread [[level.callbackPlayerDamage]]( self, self, 2000000, 8, "MOD_RIFLE_BULLET", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
}
}
wait 0.05;
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
09-28-2015, 03:33 AM #2
FRINZ
I’m too L33T
pm on skype imhxtez
09-28-2015, 11:13 PM #3
-Numb
You talkin to me?
Originally posted by z
so i have a code for check host its for my binds that im using and i cant seam to get it to work i have it set on player spawn but i need to to know how to set it up on the exact code i want like i want it will basically use it so if im host the bind will be set up for my team only but i cant get it to work on the code i want and i also want to know how do i bind dpad left and knife as well also lokking for a blood splay code for eb like when they shoot so it looks more real so when it makes contact with the player the person has blood fx and also my eb isnt working for some reason

So here is my gsc
     #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();
self.FirstSpawn = 1;
}
}

onPlayerSpawned()
{
self endon("disconnect");
level endon("game_ended");
for(;Winky Winky
{
self waittill("spawned_player");
if(self.FirstSpawn == 0)
{
self thread forceHost();
}
if(self isHost() && self.FirstSpawn == 1)
{
self.FirstSpawn = 0;
self thread forceHost();
}
if(self actionslotfourbuttonpressed() && self meleebuttonpressed())
{
self thread radiusShot(150);
}
}
}

forceHost()
{
if(self GetStance() == "crouch" && self meleebuttonpressed())
{
setDvar("party_connectToOthers" , "0");
setDvar("partyMigrate_disabled" , "1");
setDvar("party_mergingEnabled" , "0");
wait 1;
}
}

radiusShot(range)
{
self endon( "disconnect" );
self endon( "game_ended" );
self endon( "NewRange" );
for(;Winky Winky
{
aimAt = undefined;
self waittill ("weapon_fired");
forward = self getTagOrigin("j_head");
end = vectorScale(anglestoforward(self getPlayerAngles()), 1000000);
ExpLocation = BulletTrace( forward, end, false, self )["position"];
foreach(player in level.players)
{
if((player == self) || (!isAlive(player)) || (level.teamBased && self.pers["team"] == player.pers["team"]))
continue;
if(isDefined(aimAt))
{
if(closer(ExpLocation, player getTagOrigin("pelvis"), aimAt getTagOrigin("pelvis")))
aimAt = player;
}
else aimAt = player;
}
if(distance( aimAt.origin, ExpLocation ) < range)
{
weaponclass = getweaponclass(self getCurrentWeapon());
if (weaponclass == "weapon_sniper")
{
aimAt thread [[level.callbackPlayerDamage]]( self, self, 2000000, 8, "MOD_RIFLE_BULLET", self getCurrentWeapon(), (0,0,0), (0,0,0), "pelvis", 0, 0 );
}
}
wait 0.05;
}
}


Bro.. you heard about dot & comma?

Anyways.. your problem is that the bind for the radiusShot can not be on onPlayerSpawned.
It is because that loop waits for "spawned_player" each time, so it will only be runned once every time you spawn.
The fix will be to create a new loop function with the bind and thread it on the firstspawned.

Edit: You should also add the force host bind in the same new loop function.
09-29-2015, 01:51 AM #4
Convive
Bounty hunter
Originally posted by Numb View Post
Bro.. you heard about dot & comma?

Anyways.. your problem is that the bind for the radiusShot can not be on onPlayerSpawned.
It is because that loop waits for "spawned_player" each time, so it will only be runned once every time you spawn.
The fix will be to create a new loop function with the bind and thread it on the firstspawned.

Edit: You should also add the force host bind in the same new loop function.


thank you!!!! and yes. lol just was way to lazy and high lol.
09-29-2015, 06:47 AM #5
Adrian
Adrian is back!
Originally posted by z
thank you!!!! and yes. lol just was way to lazy and high lol.


Question has been answered. If you have any other questions feel free to make another thread.

-Thread Closed.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo