Raised This Month: $ Target: $400
 0% 

Help Respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
M E R T
Junior Member
Join Date: Jan 2019
Old 01-25-2019 , 02:40   Help Respawn
Reply With Quote #1

Hello guys please help me..

I am using this plugin nice but..
this set_hudmessage(255, 155, 53, -1.0, 0.14, 0, 0.0, 0.1, 0.1, 3) show_hudmessage(0, "Respawn is disabled..") why disappears immediately?

how do I get him to stay there until the hand runs out? (yandex translate)




#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <cstrike>
#include <engine>

new Float:RoundStartTime

new g_Time_Interval;
const MAX_PLAYERS = 32;

new g_iRespawn[MAX_PLAYERS+1], g_TeamInfoCounter[MAX_PLAYERS+1], CsTeams:g_iPlayerTeam[MAX_PLAYERS+1];
new g_pCvarRespawnTime, g_pCvarRespawnDelay, g_pCvarMaxHealth;

new g_entCountDown, Float:g_flFreq, Float:g_flTimeLeft;

public plugin_init()
{
register_plugin("DeathRun Respawn", "0.3", "Vicious Vixen");
// Edited by tvix1337

RegisterHam(Ham_Killed, "player", "fwdPlayerKilledPost", 1);
RegisterHam(Ham_Spawn, "player", "fwdPlayerSpawnPost", 1);

register_event("TeamInfo", "eTeamInfo", "a");
register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )

g_pCvarRespawnTime = register_cvar("legendary_respawn_max", "0");
g_pCvarRespawnDelay = register_cvar("legendary_respawn_delay", "1");
g_pCvarMaxHealth = register_cvar("legendary_health_max", "100");
g_Time_Interval = register_cvar("legendary_respawn_time", "30.0");

set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );

}

public LogEventRoundStart()
{
RoundStartTime = get_gametime()

new iPlayers[32]
new iNum

get_players( iPlayers, iNum )

for( new i = 0; i < iNum; i++ )
{
g_iRespawn[iPlayers[i]] = true
}
MakeCountDown(get_pcvar_float(g_Time_Interval ), 0.1);

}

public fwdPlayerKilledPost(iVictim, iKiller, iShoudlGib)
{
if(g_iRespawn[iVictim]++ < get_pcvar_num(g_pCvarRespawnTime) || get_pcvar_num(g_pCvarRespawnTime) == 0)
{
set_task(get_pcvar_float(g_pCvarRespawnDelay) , "taskRespawnPlayer", iVictim);
}
return HAM_IGNORED;
}

public fwdPlayerSpawnPost(iClient)
{
if(is_user_alive(iClient))
{
set_pev(iClient, pev_health, get_pcvar_float(g_pCvarMaxHealth));
}
}

public taskRespawnPlayer(id)
{
if(is_user_connected(id) && RoundStartTime + get_pcvar_float(g_Time_Interval) >= get_gametime() && g_iRespawn[id] && !is_user_alive(id) && cs_get_user_team(id) != CS_TEAM_SPECTATOR) {
ExecuteHamB(Ham_CS_RoundRespawn, id)
g_iRespawn[id] = false
return PLUGIN_HANDLED;
}
return PLUGIN_HANDLED;
}

public eTeamInfo()
{
new iClient = read_data(1);
new szTeam[2];
read_data(2, szTeam, charsmax(szTeam));
switch(szTeam[0])
{
case 'T':
{
remove_task(iClient);
g_iPlayerTeam[iClient] = CS_TEAM_T;
}
case 'C':
{
if(g_TeamInfoCounter[iClient] == 2 || g_iPlayerTeam[iClient] == CS_TEAM_SPECTATOR)
{
set_task(get_pcvar_float(g_pCvarRespawnDelay) , "taskRespawnPlayer", iClient);
}
g_iPlayerTeam[iClient] = CS_TEAM_CT;
}
case 'S':
{
remove_task(iClient);
g_iPlayerTeam[iClient] = CS_TEAM_SPECTATOR;
}
}
}
MakeCountDown(Float:flTimeleft, Float:flFrequency = 1.0) {
if( !g_entCountDown )
{
g_entCountDown = create_entity( "info_target" );

new const szClass[] = "countdown";
register_think(szClass, "CountDown" );

entity_set_string(g_entCountDown, EV_SZ_classname, szClass);
}
g_flTimeLeft = flTimeleft;
g_flFreq = flFrequency;

entity_set_float(g_entCountDown, EV_FL_nextthink, get_gametime() + flFrequency);
call_think(g_entCountDown);
}

public CountDown(iEntity)
{
if(iEntity != g_entCountDown)
return;


if (g_flTimeLeft > 0.0)
{
/*
Ortala= -1.0, Aşağı yukarı= 0.14, Efekt= 0, 0.01, 0.1, Süre= 300.0, 3
*/

set_hudmessage(255, 155, 53, -1.0, 0.14, 0, 0.0, 0.1, 0.1, 3)
show_hudmessage(0, "Respawn is %.1f seconds after end.", g_flTimeLeft )

entity_set_float(g_entCountDown, EV_FL_nextthink, get_gametime() + g_flFreq)
g_flTimeLeft -= g_flFreq
}
else
{
set_hudmessage(255, 155, 53, -1.0, 0.14, 0, 0.0, 0.1, 0.1, 3)
show_hudmessage(0, "Respawn is disabled..")
}
}




/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
M E R T is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 01-25-2019 , 06:25   Re: Help Respawn
Reply With Quote #2

https://www.amxmodx.org/api/amxmodx/set_hudmessage
The 8th parameter is hold time in seconds(float).
20.0 = 20 seconds display time
10.0 = 10 s
7.5 = 7 and a half s
__________________
Relaxing is offline
M E R T
Junior Member
Join Date: Jan 2019
Old 01-26-2019 , 00:59   Re: Help Respawn
Reply With Quote #3

why 20 seconds??? i want 600 seconds how to?
M E R T is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 01-26-2019 , 09:18   Re: Help Respawn
Reply With Quote #4

omg, just change the amount as you wish, from 20.0 to whatever
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode