and let me know if that helps. this will add a few additional units of height to the targets return origin.
add me on steam: heliumdream.
it would help if i could see it being used.
i'd install it on my server, but would still need another player to test it on...i dont have bots or anything.
and let me know if that helps. this will add a few additional units of height to the targets return origin.
add me on steam: heliumdream.
it would help if i could see it being used.
i'd install it on my server, but would still need another player to test it on...i dont have bots or anything.
It works now, after adding the +40. But you can still keep using it on the person without restrictions, so if many people have this the person will be stuck forever, there needs to be a way to only allow it once on the person every 30 sec or so. Nice job there
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
There was an error in the logic; I was checking against the id of ability users not the targets. (line 172)
Try this out, it should be good.
Spoiler
Code:
// SANDMAN! - from Marvel Comics, possesses the ability to convert all or part of his body into a sand-like substance by mental command.
/* CVARS - copy and paste to shconfig.cfg
//Sandman
sandman_level 9
sandman_cooldown 20 //Seconds before you can use quicksand again (Default 20)
sandman_duration 5 //How long quicksand lasts
sandman_affected 30 //Seconds before the target can be affected by quicksand again
*/
/*
* v1.3.1 - heliumdream - 7/3/2016
* - added some z-height to the return origin to 'unstick' affected targets.
* - fixed a logic error.
*/
/*
* v1.3 - heliumdream - 6/28/2016
* - added sandman_affected cvar
* - added WasHitBySandman array global variable to flag affected users
- added remove_affect function to reverse the flag
- added a check on new_spawn to reset the flag.
*/
/*
* v1.2 - heliumdream - 6/27/2016
* - added sandman_duration cvar
* - created 'unsink' and 'unsink_effects' functions, basically reversing the existing sink and sink_effects.
*/
/*
* v1.1 - vittu - 4/2/06
* - Re-coded and cleaned up.
* - Renamed to Sandman since it fits better.
* - Added extra checks preventing from being buried too far
* and to make sure user is buryable able.
* - Changed cooldown to only set if you bury someone.
* - Removed ability to bury team mates.
*
* Hero Originally named Quicksand created by Freecode.
*/
#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
#if defined AMX98
#define FL_ONGROUND (1<<9) //Only for the constant
#endif
// GLOBAL VARIABLES
new HeroName[]="Sandman"
new bool:HasSandman[SH_MAXSLOTS+1]
new bool:WasHitBySandman[SH_MAXSLOTS+1]
new MSGSetFOV
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Sandman", "1.1", "Freecode/vittu")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("sandman_level", "9")
register_cvar("sandman_cooldown", "20")
register_cvar("sandman_duration", "5")
register_cvar("sandman_affected", "30")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(HeroName, "Quicksand", "Use +power key on Enemy in crosshair to Trap them in Quicksand", true, "sandman_level")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("sandman_init", "sandman_init")
shRegHeroInit(HeroName, "sandman_init")
// KEY DOWN
register_srvcmd("sandman_kd", "sandman_kd")
shRegKeyDown(HeroName, "sandman_kd")
// NEW SPAWN
register_event("ResetHUD", "newSpawn", "b")
// Sets field of view
MSGSetFOV = get_user_msgid("SetFOV")
}
//----------------------------------------------------------------------------------------------
public sandman_init()
{
// First Argument is an id
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)
// 2nd Argument is 0 or 1 depending on whether the id has the hero
read_argv(2, temp, 5)
new hasPowers = str_to_num(temp)
switch(hasPowers)
{
case true:
HasSandman[id] = true
case false:
HasSandman[id] = false
}
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if ( task_exists(id) )
remove_task(id)
gPlayerUltimateUsed[id] = false
WasHitBySandman[id] = false
}
//----------------------------------------------------------------------------------------------
public sandman_kd()
{
if ( !hasRoundStarted() )
return
// First Argument is an id
new temp[6]
read_argv(1, temp, 5)
new id = str_to_num(temp)
if ( !is_user_alive(id) || !HasSandman[id] )
return
if ( gPlayerUltimateUsed[id] )
{
playSoundDenySelect(id)
return
}
quicksand(id)
}
//----------------------------------------------------------------------------------------------
public quicksand(id)
{
if ( !shModActive() || !is_user_alive(id) || !HasSandman[id] )
return
new targetid, body
get_user_aiming(id, targetid, body)
if ( !is_user_alive(targetid) || get_user_team(id) == get_user_team(targetid) )
targetid = 0
switch(targetid)
{
case 0:
{
client_print(id, print_center, "[SH](%s) No target found", HeroName)
playSoundDenySelect(id)
return
}
default:
{
// Get origin at this point so if they move it will keep them in the same spot
new origin[3]
get_user_origin(targetid, origin)
new Float:testOrigin[3]
IVecFVec(origin, testOrigin)
if ( PointContents(testOrigin) == -2 )
{
client_print(id, print_center, "[SH](%s) Target already in Quicksand", HeroName)
playSoundDenySelect(id)
return
}
if ( WasHitBySandman[targetid] )
{
client_print(id, print_center, "[SH](%s) Target was too recently affected by Quicksand", HeroName)
playSoundDenySelect(id)
return
}
if ( !(Entvars_Get_Int(targetid, EV_INT_flags)&FL_ONGROUND) )
{
client_print(id, print_center, "[SH](%s) Target not on ground", HeroName)
playSoundDenySelect(id)
return
}
new Float:cooldown = get_cvar_float("sandman_cooldown")
if ( cooldown > 0.0 )
ultimateTimer(id, cooldown)
sinking_effects(id, targetid)
WasHitBySandman[id] = true
new Float:affect_length = get_cvar_float("sandman_affected")
new ra_params[1]
ra_params[0] = id
set_task(affect_length, "remove_affect", id, ra_params, 1)
new params[6]
params[0] = origin[0]
params[1] = origin[1]
params[2] = origin[2]
params[3] = targetid
params[4] = id
params[5] = 40
sink(params)
}
}
}
//----------------------------------------------------------------------------------------------
public sink(params[])
{
new targetid = params[3]
new id = params[4]
if ( shModActive() && is_user_connected(id) && HasSandman[id] && is_user_alive(targetid) && params[5] > 0 )
{
// Causes this function to repeat until it equals 0
--params[5]
new origin[3]
origin[0] = params[0]
origin[1] = params[1]
origin[2] = --params[2]
set_user_origin(targetid, origin)
set_task(0.1, "sink", id, params, 6)
}
else
{
new Float:duration = get_cvar_float("sandman_cooldown")
set_task(duration, "unsink", id, params, 6)
}
}
//----------------------------------------------------------------------------------------------
public unsink(parameters[])
{
new targetid = parameters[3]
new id = parameters[4]
new origin[3]
origin[0] = parameters[0]
origin[1] = parameters[1]
origin[2] = parameters[2] + 40
set_user_origin(targetid, origin)
unsink_effects(id, targetid)
}
//----------------------------------------------------------------------------------------------
public sinking_effects(id, targetid)
{
if ( !shModActive() || !is_user_connected(id) || !is_user_alive(targetid) || !HasSandman[id] )
return
new targname[32], idname[32]
get_user_name(targetid, targname, 31)
get_user_name(id, idname, 31)
set_hudmessage(46, 139, 87, -1.0, 0.24, 0, 1.0, 4.0, 0.0, 0.0, 6)
show_hudmessage(id, "%s has been cought in your Quicksand", targname)
show_hudmessage(targetid, "You have been cought in %s's Quicksand", idname)
set_user_rendering(targetid, kRenderFxGlowShell, 255, 222, 173, kRenderNormal, 12)
// Set targets field of view
message_begin(MSG_ONE, MSGSetFOV, {0,0,0}, targetid)
write_byte(135)
message_end()
}
//----------------------------------------------------------------------------------------------
public unsink_effects(id, targetid)
{
new targname[32], idname[32]
get_user_name(targetid, targname, 31)
get_user_name(id, idname, 31)
set_hudmessage(46, 139, 87, -1.0, 0.24, 0, 1.0, 4.0, 0.0, 0.0, 6)
show_hudmessage(id, "%s has been released from your Quicksand", targname)
show_hudmessage(targetid, "You have been released from %s's Quicksand", idname)
set_user_rendering(targetid,kRenderFxGlowShell,0,0,0,kRenderNormal,25)
}
//----------------------------------------------------------------------------------------------
public remove_affect(param[])
{
new id = param[0]
WasHitBySandman[id] = false
}
Alright, the sandman_affected is not working, there is no restriction right now.
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
Sorry for all the hassle; I wasn't super thrilled to be making these code changes, and rushed thru it...
I loaded it up on my server, got a buddies account logged in to test with, and got everything working.
I am going to remove the previous versions from my posts, I don't want broken code out there.
Enjoy.
Code:
// SANDMAN! - from Marvel Comics, possesses the ability to convert all or part of his body into a sand-like substance by mental command.
/* CVARS - copy and paste to shconfig.cfg
//Sandman
sandman_level 9
sandman_cooldown 20 //Seconds before you can use quicksand again (Default 20)
sandman_duration 5 //How long quicksand lasts
sandman_affected 30 //Seconds before the target can be affected by quicksand again
*/
Sorry for all the hassle; I wasn't super thrilled to be making these code changes, and rushed thru it...
I loaded it up on my server, got a buddies account logged in to test with, and got everything working.
I am going to remove the previous versions from my posts, I don't want broken code out there.
Enjoy.
Code:
// SANDMAN! - from Marvel Comics, possesses the ability to convert all or part of his body into a sand-like substance by mental command.
/* CVARS - copy and paste to shconfig.cfg
//Sandman
sandman_level 9
sandman_cooldown 20 //Seconds before you can use quicksand again (Default 20)
sandman_duration 5 //How long quicksand lasts
sandman_affected 30 //Seconds before the target can be affected by quicksand again
*/
Oh yeah, this is awesome now, tested and it's working perfectly. Nice job there, never expected anyone who knows what he's doing to still be on this forum . Now if somebody edit original post to include this version.
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
I've been active for like the last year or two, and its been mostly just me.
Occasionally I think old devs peek in, but there ain't much news or updates, or even active players. Just lurkers and newbs remain...
I reckon I'm as close to a mod or dev as you'll get and I'm completely unofficial.
The community has moved on to newer games.
I keep my server up mainly for nostalgia, I did my best to get it back to how I had it configured circa 06-08. I more or less taught myself how to code games those summers, using this platform. Even when me and another friend are actively playing, we never seem to get any random pubs...I don't think I've ever had more than four simultaneous players since I rebooted in 2014.
I was huge fan of the Jiggly Fun House SourceCraft TF2, and scored a copy of the source code their lead developer Narus ended up sharing...this is just as dead as cs.16 superheroes tho.
I've been active for like the last year or two, and its been mostly just me.
Occasionally I think old devs peek in, but there ain't much news or updates, or even active players. Just lurkers and newbs remain...
I reckon I'm as close to a mod or dev as you'll get and I'm completely unofficial.
The community has moved on to newer games.
I keep my server up mainly for nostalgia, I did my best to get it back to how I had it configured circa 06-08. I more or less taught myself how to code games those summers, using this platform. Even when me and another friend are actively playing, we never seem to get any random pubs...I don't think I've ever had more than four simultaneous players since I rebooted in 2014.
I was huge fan of the Jiggly Fun House SourceCraft TF2, and scored a copy of the source code their lead developer Narus ended up sharing...this is just as dead as cs.16 superheroes tho.
That's nice, some nice history there. Same with the nostalgia for me. We used to play on a Russian server that had superheroes vs zombies and it was just epic. There are still a lot of cs 1.6 zombie server players, so I figured I'd try make one of those servers and put it up, because there are none zm vs sh at the moment so it is unique and in my opinion it will get popular. For me just climbing up and shooting is not fun, when zombies have very low chance to infect a human, with like 5 zombie classes, that is just not fun. Superhero makes all the difference... Now just need to get fast download again, only 30 bucks for a year. Then buy a server boost, to help fill up the server faster. But I don't want to do this before I am happy with the server. It's such a coincidence that you are here because I only need help for few super heroes (sandman, and punisher v 2 and trigger not to contradict with each other). There is someone else who is very active on zombie mod and he also fixed a lot of zm and sh problems for me, they are similar problems. He fixed so many bugs for me it's unbelievable, very thankful for that, the amount of time it would of taken me to learn is probably huge. We'll see what happens. If you are into that kind of server I'd definitely be more than happy to give you vip or admin when I have officially released it.
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!
Last edited by New and Clueless; 07-08-2016 at 13:23.
I've been active for like the last year or two, and its been mostly just me.
Occasionally I think old devs peek in, but there ain't much news or updates, or even active players. Just lurkers and newbs remain...
I reckon I'm as close to a mod or dev as you'll get and I'm completely unofficial.
The community has moved on to newer games.
I keep my server up mainly for nostalgia, I did my best to get it back to how I had it configured circa 06-08. I more or less taught myself how to code games those summers, using this platform. Even when me and another friend are actively playing, we never seem to get any random pubs...I don't think I've ever had more than four simultaneous players since I rebooted in 2014.
I was huge fan of the Jiggly Fun House SourceCraft TF2, and scored a copy of the source code their lead developer Narus ended up sharing...this is just as dead as cs.16 superheroes tho.
Is there any way to counter sandman? for example, if you pick that hero, sandman doesn't work on you, or the time you spend in the ground is reduced by half.
__________________
ANY SCRIPTER ON THIS FORUM HAS FREE VIP/ADMIN IN MY SERVER!