Post by newandclueless on Feb 6, 2018 13:55:43 GMT
Hello everybody.
I have small problem.
I am trying to add to an existing plugin. How long you can use it for (timer) and a cooldown. I really tried but I keep getting errors and I don't know how to fix, i'm pretty sure I'm making a minor mistake here.
I am trying to add timer and cooldown for this plugin, I would ask in SH forum, but nobody will help and nobody is active there. I know a lot of people here have good knowledge with amxx, maybe you can help.
1. Original working version.
I was copying from this plugin.
2. Different code, I was copying from.
and here is my attempt.
3. My attempt. Different attempt at the bottom of page 1.
If you are able to help, thank you very much sir's.
I have small problem.
I am trying to add to an existing plugin. How long you can use it for (timer) and a cooldown. I really tried but I keep getting errors and I don't know how to fix, i'm pretty sure I'm making a minor mistake here.
I am trying to add timer and cooldown for this plugin, I would ask in SH forum, but nobody will help and nobody is active there. I know a lot of people here have good knowledge with amxx, maybe you can help.
1. Original working version.
// IRON MAN! - BASED ON JETPACK By Lazy / Modifications by OLO
/* CVARS - copy and paste to shconfig.cfg
//Iron Man
ironman_level 0
ironman_armor 100 //How much armor does ironman start with?
ironman_timer 0.1 //How often (seconds) to run the loop
ironman_thrust 125 //The upward boost every loop
ironman_maxspeed 400 //Max x and y speeds (while in air)
ironman_xymult 1.05 //Multiplies the current x,y vector when moving
ironman_fuelcost 1 //How much armor does it cost per firing, set 0 to not use armor
*/
#include <superheromod>
// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Iron Man"
new bool:gRegenAllowed[SH_MAXSLOTS+1]
new bool:gJetPackRunning[SH_MAXSLOTS+1]
new const gSoundJetpack[] = "ambience/flameburst1.wav"
new const gSoundJpStop[] = "debris/beamstart11.wav"
new gSpriteFire
// BECAUSE THIS LOOP IS CALLED SO MUCH - INSTEAD OF READING CVARS OVER AND OVER
// I'LL KEEP IN GLOBAL - FOR ANTI-LAG HOPEFULLY
new Float:gThrust, Float:gMaxSpeed, Float:gMultiplier, gFuelCost
new pCvarTimer, pCvarThrust, pCvarMaxSpeed, pCvarXyMult, pCvarFuelCost
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Iron Man", SH_VERSION_STR, "{HOJ} Batman/JTP10181")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
new pcvarLevel = register_cvar("ironman_level", "0")
pCvarTimer = register_cvar("ironman_timer", "0.1")
pCvarThrust = register_cvar("ironman_thrust", "125")
pCvarMaxSpeed = register_cvar("ironman_maxspeed", "400")
pCvarXyMult = register_cvar("ironman_xymult", "1.05")
pCvarFuelCost = register_cvar("ironman_fuelcost", "1")
// FIRE THE EVENTS TO CREATE THIS SUPERHERO!
gHeroID = sh_create_hero(gHeroName, pcvarLevel)
sh_set_hero_info(gHeroID, "Very short jet pack", "Small jetpack - use +power key to take off")
sh_set_hero_bind(gHeroID)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
gSpriteFire = precache_model("sprites/fire.spr")
precache_sound(gSoundJetpack)
precache_sound(gSoundJpStop)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(id, heroID, mode)
{
if ( gHeroID != heroID ) return
// Clear out any stale tasks
remove_task(id)
if ( mode == SH_HERO_ADD ) {
set_task(get_pcvar_float(pCvarTimer), "ironman_loop", id, _, _, "b")
}
sh_debug_message(id, 1, "%s %s", gHeroName, mode ? "ADDED" : "DROPPED")
}
//----------------------------------------------------------------------------------------------
public plugin_cfg()
{
loadCVARS()
}
//----------------------------------------------------------------------------------------------
loadCVARS()
{
gThrust = get_pcvar_float(pCvarThrust)
gMaxSpeed = get_pcvar_float(pCvarMaxSpeed)
gMultiplier = get_pcvar_float(pCvarXyMult)
gFuelCost = get_pcvar_num(pCvarFuelCost)
}
//----------------------------------------------------------------------------------------------
jetpack_fire_effect(location[3])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITE) // 17
write_coord(location[0])
write_coord(location[1])
write_coord(location[2])
write_short(gSpriteFire)
write_byte(5)
write_byte(125)
message_end()
}
//----------------------------------------------------------------------------------------------
public ironman_loop(id)
{
if ( !sh_is_active() || !is_user_alive(id) || !gRegenAllowed[id] ) return
static CsArmorType:armorType
static userArmor
userArmor = cs_get_user_armor(id, armorType)
if ( userArmor == 0 ) armorType = CS_ARMOR_VESTHELM
switch(gJetPackRunning[id]) {
case false: {
// Regen armor even if armor is not used for JP fuel
if ( userArmor < sh_get_max_ap(id) ) {
cs_set_user_armor(id, userArmor + 1, armorType)
}
}
case true: {
// Is armor/fuel being used to run JP?
if ( gFuelCost > 0 ) {
// If no fuel is available stop JP
if ( userArmor < gFuelCost ) {
sh_sound_deny(id)
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
emit_sound(id, CHAN_WEAPON, gSoundJpStop, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "You ran out of fuel bruh")
return
}
// Decrement fuel when JP in use
cs_set_user_armor(id, userArmor - gFuelCost, armorType)
}
static Float:velocity[3], origin[3]
pev(id, pev_velocity, velocity)
// Remove the need to jump to use, give them a small upward lift
if ( pev(id, pev_flags) & FL_ONGROUND ) {
velocity[2] += 100.0
set_pev(id, pev_velocity, velocity)
}
velocity[0] = velocity[0] * gMultiplier
velocity[1] = velocity[1] * gMultiplier
velocity[2] += gThrust
if ( velocity[0] > gMaxSpeed ) velocity[0] = gMaxSpeed
else if ( velocity[0] < (gMaxSpeed * -1.0) ) velocity[0] = gMaxSpeed * -1.0
if ( velocity[1] > gMaxSpeed ) velocity[1] = gMaxSpeed
else if ( velocity[1] < (gMaxSpeed * -1.0) ) velocity[1] = gMaxSpeed * -1.0
if ( velocity[2] > gThrust * 2.0 ) velocity[2] = gThrust * 2.0
set_pev(id, pev_velocity, velocity)
get_user_origin(id, origin)
jetpack_fire_effect(origin)
emit_sound(id, CHAN_WEAPON, gSoundJetpack, VOL_NORM, ATTN_NORM, 0, PITCH_LOW)
}
}
}
//----------------------------------------------------------------------------------------------
public sh_hero_key(id, heroID, key)
{
if ( gHeroID != heroID ) return
switch(key)
{
case SH_KEYDOWN: {
if ( sh_is_freezetime() || !is_user_alive(id) ) return
gJetPackRunning[id] = true
// This needs to change to a forward check
set_user_info(id, "JP", "1")
//Reload CVARS to make sure the variables are current
loadCVARS()
}
case SH_KEYUP: {
if ( !gJetPackRunning[id] ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
emit_sound(id, CHAN_WEAPON, gSoundJpStop, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
}
//----------------------------------------------------------------------------------------------
public sh_client_death(victim)
{
gJetPackRunning[victim] = false
// This needs to change to a forward check
set_user_info(victim, "JP", "0")
gRegenAllowed[victim] = false
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
gRegenAllowed[id] = false
set_task(1.0, "spawn_delay", id)
}
//----------------------------------------------------------------------------------------------
public spawn_delay(id)
{
//Delay is to allow time for sh armor power to set.
if ( !is_user_alive(id) ) return
gRegenAllowed[id] = true
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
// stupid check but lets see
if ( id < 1 || id > sh_maxplayers() ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
gRegenAllowed[id] = false
// Yeah don't want any left over residuals
remove_task(id)
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
// stupid check but lets see
if ( id < 1 || id > sh_maxplayers() ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
gRegenAllowed[id] = false
// Yeah don't want any left over residuals
remove_task(id)
}
//----------------------------------------------------------------------------------------------
I was copying from this plugin.
2. Different code, I was copying from.
//INVISIBLE WOMAN! from the Fantastic Four, Sue Richards psionic ability to manipulate ambient cosmic energy enables her to bend light around her body without distortion.
/* CVARS - copy and paste to shconfig.cfg
//Invisible Woman
inviswoman_level 6
inviswoman_alpha 0 //Value of invisiblity 0-invisible 255-completly visible (default=0)
inviswoman_time 5 //# of seconds of invisiblity
inviswoman_cooldown 30 //# of seconds before invisiblity can be used again from keydown
*/
/*
* v1.1 - vittu - 8/8/05
* - Cleaned up code.
* - Added cvar for alpha value.
* - Changed sound from cows "moo" to a heartbeat, very low volume.
*
*/
#include <amxmod>
#include <superheromod>
// GLOBAL VARIABLES
new gHeroName[]="Invisible Stalker"
new bool:gHasInvisWomanPower[SH_MAXSLOTS+1]
new gInvisWomanTimer[SH_MAXSLOTS+1]
new gInvisWomanMode[SH_MAXSLOTS+1]
new gAlpha
new gInvisWomanSound[]="player/heartbeat1.wav"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Invisible Woman", "1.1", "Glooba")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("inviswoman_level", "5")
register_cvar("inviswoman_alpha", "0")
register_cvar("inviswoman_time", "5")
register_cvar("inviswoman_cooldown", "60")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Invisible Ability", "Press +power key to become invisible for 5 sec", true, "inviswoman_level")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("inviswoman_init", "inviswoman_init")
shRegHeroInit(gHeroName, "inviswoman_init")
// KEY DOWN
register_srvcmd("inviswoman_kd", "inviswoman_kd")
shRegKeyDown(gHeroName, "inviswoman_kd")
// NEW SPAWN
register_event("ResetHUD", "newSpawn", "b")
// DEATH
register_event("DeathMsg", "inviswoman_death", "a")
// LOOP
set_task(1.0, "inviswoman_loop", 0, "", 0, "b")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_sound(gInvisWomanSound)
}
//----------------------------------------------------------------------------------------------
public inviswoman_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
read_argv(2, temp, 5)
new hasPowers = str_to_num(temp)
if ( hasPowers ) {
// Make sure looop doesn't fire for them
gInvisWomanTimer[id] = -1
}
//This gets run if they had the power but don't anymore
else if ( gHasInvisWomanPower[id] && gInvisWomanTimer[id] >= 0 ) {
inviswoman_endmode(id)
}
//Sets this variable to the current status
gHasInvisWomanPower[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
gPlayerUltimateUsed[id] = false
gInvisWomanTimer[id] = -1
if ( gHasInvisWomanPower[id] ) {
inviswoman_endmode(id)
}
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public inviswoman_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) || !gHasInvisWomanPower[id] ) return
// Make sure they're not in the middle of invisible woman mode
// Let them know they already used their ultimate if they have
if ( gPlayerUltimateUsed[id] || gInvisWomanTimer[id] > 0 ) {
playSoundDenySelect(id)
return
}
gInvisWomanTimer[id] = get_cvar_num("inviswoman_time")
if (get_cvar_float("inviswoman_cooldown") > 0.0 ) ultimateTimer(id, get_cvar_float("inviswoman_cooldown"))
gAlpha = get_cvar_num("inviswoman_alpha")
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, gAlpha)
gInvisWomanMode[id] = true
new message[128]
format(message, 127, "You have now turned invisible")
set_hudmessage(50, 50, 255, -1.0, 0.28, 0, 0.0, 1.0, 0.0, 0.0, 54)
show_hudmessage(id, message)
emit_sound(id, CHAN_STATIC, gInvisWomanSound, 0.1, ATTN_NORM, 0, PITCH_NORM)
}
//----------------------------------------------------------------------------------------------
public stopSound(id)
{
emit_sound(id, CHAN_STATIC, gInvisWomanSound, 0.1, ATTN_NORM, SND_STOP, PITCH_NORM)
}
//----------------------------------------------------------------------------------------------
public inviswoman_loop()
{
for ( new id = 1; id <= SH_MAXSLOTS; id++ ) {
if ( gHasInvisWomanPower[id] && is_user_alive(id) ) {
if ( gInvisWomanTimer[id] > 0 ) {
new message[128]
format(message, 127, "%d second%s of invisibility left", gInvisWomanTimer[id], gInvisWomanTimer[id] == 1 ? "" : "s")
set_hudmessage(50, 50, 255, -1.0, 0.28, 0, 0.0, 1.0, 0.0, 0.0, 54)
show_hudmessage(id, message)
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, gAlpha)
gInvisWomanTimer[id]--
}
else if ( gInvisWomanTimer[id] == 0 ) {
gInvisWomanTimer[id]--
inviswoman_endmode(id)
}
}
}
}
//----------------------------------------------------------------------------------------------
public inviswoman_endmode(id)
{
if ( !is_user_connected(id) ) return
gInvisWomanTimer[id] = -1
stopSound(id)
if ( gInvisWomanMode[id]) {
set_user_rendering(id)
gInvisWomanMode[id] = false
}
}
//----------------------------------------------------------------------------------------------
public inviswoman_death()
{
new id = read_data(2)
gPlayerUltimateUsed[id] = false
gInvisWomanTimer[id] = -1
if (gHasInvisWomanPower[id]) {
inviswoman_endmode(id)
}
}
//----------------------------------------------------------------------------------------------
and here is my attempt.
3. My attempt. Different attempt at the bottom of page 1.
// IRON MAN! - BASED ON JETPACK By Lazy / Modifications by OLO
/* CVARS - copy and paste to shconfig.cfg
//Iron Man
ironman_level 0
ironman_armor 100 //How much armor does ironman start with?
ironman_timer 0.1 //How often (seconds) to run the loop
ironman_thrust 125 //The upward boost every loop
ironman_maxspeed 400 //Max x and y speeds (while in air)
ironman_xymult 1.05 //Multiplies the current x,y vector when moving
ironman_fuelcost 1 //How much armor does it cost per firing, set 0 to not use armor
ironman_time 3 //# of seconds of invisiblity
ironman_cooldown 40 //# of seconds before invisiblity can be used again from keydown
*/
#include <superheromod>
// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Iron Man"
new bool:gHasIronManPower[SH_MAXSLOTS+1]
new gIronManTimer[SH_MAXSLOTS+1]
new bool:gRegenAllowed[SH_MAXSLOTS+1]
new bool:gJetPackRunning[SH_MAXSLOTS+1]
new const gSoundJetpack[] = "ambience/flameburst1.wav"
new const gSoundJpStop[] = "debris/beamstart11.wav"
new gSpriteFire
// BECAUSE THIS LOOP IS CALLED SO MUCH - INSTEAD OF READING CVARS OVER AND OVER
// I'LL KEEP IN GLOBAL - FOR ANTI-LAG HOPEFULLY
new Float:gThrust, Float:gMaxSpeed, Float:gMultiplier, gFuelCost
new pCvarTimer, pCvarThrust, pCvarMaxSpeed, pCvarXyMult, pCvarFuelCost
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Iron Man", SH_VERSION_STR, "{HOJ} Batman/JTP10181")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
new pcvarLevel = register_cvar("ironman_level", "0")
pCvarTimer = register_cvar("ironman_timer", "0.1")
pCvarThrust = register_cvar("ironman_thrust", "125")
pCvarMaxSpeed = register_cvar("ironman_maxspeed", "400")
pCvarXyMult = register_cvar("ironman_xymult", "1.05")
pCvarFuelCost = register_cvar("ironman_fuelcost", "1")
register_cvar("ironman_time", "3")
register_cvar("ironman", "40")
// FIRE THE EVENTS TO CREATE THIS SUPERHERO!
gHeroID = sh_create_hero(gHeroName, pcvarLevel)
sh_set_hero_info(gHeroID, "Very short jet pack", "Small jetpack - use +power key to take off")
sh_set_hero_bind(gHeroID)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
gSpriteFire = precache_model("sprites/fire.spr")
precache_sound(gSoundJetpack)
precache_sound(gSoundJpStop)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(id, heroID, mode)
{
// 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
read_argv(2, temp, 5)
new hasPowers = str_to_num(temp)
if ( hasPowers ) {
// Make sure looop doesn't fire for them
gIronManTimer[id] = -1
}
//This gets run if they had the power but don't anymore
else if ( gHasIronManPower[id] && gIronManTimer[id] >= 0 ) {
// ironman_endmode(id)
}
//Sets this variable to the current status
gHasIronManPower[id] = (hasPowers != 0)
if ( gHeroID != heroID ) return
// Clear out any stale tasks
remove_task(id)
if ( mode == SH_HERO_ADD ) {
set_task(get_pcvar_float(pCvarTimer), "ironman_loop", id, _, _, "b")
}
sh_debug_message(id, 1, "%s %s", gHeroName, mode ? "ADDED" : "DROPPED")
}
//----------------------------------------------------------------------------------------------
public plugin_cfg()
{
loadCVARS()
}
//----------------------------------------------------------------------------------------------
loadCVARS()
{
gThrust = get_pcvar_float(pCvarThrust)
gMaxSpeed = get_pcvar_float(pCvarMaxSpeed)
gMultiplier = get_pcvar_float(pCvarXyMult)
gFuelCost = get_pcvar_num(pCvarFuelCost)
}
//----------------------------------------------------------------------------------------------
jetpack_fire_effect(location[3])
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_SPRITE) // 17
write_coord(location[0])
write_coord(location[1])
write_coord(location[2])
write_short(gSpriteFire)
write_byte(5)
write_byte(125)
message_end()
}
//----------------------------------------------------------------------------------------------
public ironman_loop(id)
{
if ( !sh_is_active() || gHasIronManPower[id] || !is_user_alive(id) || !gRegenAllowed[id] ) return
static CsArmorType:armorType
static userArmor
userArmor = cs_get_user_armor(id, armorType)
if ( userArmor == 0 ) armorType = CS_ARMOR_VESTHELM
switch(gJetPackRunning[id]) {
case false: {
// Regen armor even if armor is not used for JP fuel
if ( userArmor < sh_get_max_ap(id) ) {
cs_set_user_armor(id, userArmor + 1, armorType)
}
}
case true: {
// Is armor/fuel being used to run JP?
if ( gFuelCost > 0 ) {
// If no fuel is available stop JP
if ( userArmor < gFuelCost ) {
sh_sound_deny(id)
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
emit_sound(id, CHAN_WEAPON, gSoundJpStop, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
client_print(id, print_center, "You ran out of fuel bruh")
return
}
// Decrement fuel when JP in use
cs_set_user_armor(id, userArmor - gFuelCost, armorType)
}
static Float:velocity[3], origin[3]
pev(id, pev_velocity, velocity)
// Remove the need to jump to use, give them a small upward lift
if ( pev(id, pev_flags) & FL_ONGROUND ) {
velocity[2] += 100.0
set_pev(id, pev_velocity, velocity)
}
velocity[0] = velocity[0] * gMultiplier
velocity[1] = velocity[1] * gMultiplier
velocity[2] += gThrust
if ( velocity[0] > gMaxSpeed ) velocity[0] = gMaxSpeed
else if ( velocity[0] < (gMaxSpeed * -1.0) ) velocity[0] = gMaxSpeed * -1.0
if ( velocity[1] > gMaxSpeed ) velocity[1] = gMaxSpeed
else if ( velocity[1] < (gMaxSpeed * -1.0) ) velocity[1] = gMaxSpeed * -1.0
if ( velocity[2] > gThrust * 2.0 ) velocity[2] = gThrust * 2.0
set_pev(id, pev_velocity, velocity)
get_user_origin(id, origin)
jetpack_fire_effect(origin)
emit_sound(id, CHAN_WEAPON, gSoundJetpack, VOL_NORM, ATTN_NORM, 0, PITCH_LOW)
}
}
}
//----------------------------------------------------------------------------------------------
public sh_hero_key(id, heroID, key)
{
if ( gHeroID != heroID ) return
switch(key)
{
case SH_KEYDOWN: {
if ( sh_is_freezetime() || !gHasIronManPower[id] || !is_user_alive(id) ) return
// Make sure they're not in the middle of invisible woman mode
// Let them know they already used their ultimate if they have
if ( gPlayerUltimateUsed[id] || gIronManTimer[id] > 0 ) {
playSoundDenySelect(id)
return
}
gIronManTimer[id] = get_cvar_num("ironman_time")
if (get_cvar_float("ironman_cooldown") > 0.0 ) ultimateTimer(id, get_cvar_float("ironman_cooldown"))
gJetPackRunning[id] = true
// This needs to change to a forward check
set_user_info(id, "JP", "1")
//Reload CVARS to make sure the variables are current
loadCVARS()
}
case SH_KEYUP: {
if ( !gJetPackRunning[id] ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
emit_sound(id, CHAN_WEAPON, gSoundJpStop, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
}
}
//----------------------------------------------------------------------------------------------
public sh_client_death(victim)
{
// new id = read_data(2)
// gPlayerUltimateUsed[id] = false
// gIronManTimer[id] = -1
// if (gHasIronManPower[id]) {
// ironman_endmode(id)
gJetPackRunning[victim] = false
// This needs to change to a forward check
set_user_info(victim, "JP", "0")
gRegenAllowed[victim] = false
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
gRegenAllowed[id] = false
set_task(1.0, "spawn_delay", id)
}
//----------------------------------------------------------------------------------------------
public spawn_delay(id)
{
//Delay is to allow time for sh armor power to set.
if ( !is_user_alive(id) ) return
gRegenAllowed[id] = true
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
// stupid check but lets see
if ( id < 1 || id > sh_maxplayers() ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
gRegenAllowed[id] = false
// Yeah don't want any left over residuals
remove_task(id)
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
// stupid check but lets see
if ( id < 1 || id > sh_maxplayers() ) return
gJetPackRunning[id] = false
// This needs to change to a forward check
set_user_info(id, "JP", "0")
gRegenAllowed[id] = false
// Yeah don't want any left over residuals
remove_task(id)
}
//----------------------------------------------------------------------------------------------
If you are able to help, thank you very much sir's.