Plugin respawn la 10 secunde

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
User avatar
Laur3
Membru, skill +1
Membru, skill +1
Posts: 149
Joined: 09 Jan 2013, 11:36
Detinator Steam: Da
Has thanked: 29 times
Been thanked: 1 time

28 May 2013, 16:09

Vreau un plugin care atunci cand mori sa te respawneze dupa 30 secunde si sa iti apara un mesaj HUD jos in mijloc, deasupra timerului in care sa scrie: Mai sunt x secunde pana cand vei fii respawnat.
Si daca se poate, VIP-urile sa aiba respawn la alt timp, 10 secunde sa zicem...
RoyalServer 2
User avatar
Errol
Membru, skill +1
Membru, skill +1
Posts: 141
Joined: 19 May 2013, 15:42
Detinator Steam: Da
CS Status: Sunt sămânţar, prin concluzie porumbel.
Detinator server CS: DR.CS32.RO
SteamID: Privat
Reputatie: Membru Club eXtreamCS (2 luni)
Location: Bistrita
Has thanked: 17 times
Been thanked: 9 times
Contact:

28 May 2013, 18:42

Modifici in sursa :

Code: Select all

g_Time_Interval = register_cvar("amx_max_time", "15");
Cu timpul pe care il vrei, legat de VIP, nu am avut timp poate iti face cineva un update, cu placere.

Cvars' :

Code: Select all


amx_respawn_tickets -'-'- Cate spawnuri poate primi acel jucator in intervalul de timp definit (default 0 adica fara limita)
amx_respawn_delay -'-'- In cat timp sa primeasca jucatorul respawn (eu am setat pe 1 secunda)
amx_max_health -'-'- Cu cata viata sa ii dea respawn (setat 100)
| Afiseaza codul
/* Plugin generated by AMXX-Studio 

################################################################################

#Credits : Vicious Vixen | Thank's for inspiration
#Credits : extreamCS ( niste posturi esentiale)

#Cvar-uri | Vicious Vixen | Thank's for cvars.

amx_respawn_tickets -> Cate spawnuri poate primi acel jucator in intervalul de timp definit (default 0 adica fara limita)
amx_respawn_delay -> In cat timp sa primeasca jucatorul respawn (eu am setat pe 1 secunda)
amx_max_health -> Cu cata viata sa ii dea respawn (setat 100)

###################################################################################
*/

// Include

#include "amxmodx"
#include "fakemeta"
#include "hamsandwich"
#include "cstrike"

// Define

#define PLUGIN "Respawn-Secounds"
#define VERSION "0.0.1"
#define AUTHOR "Errol"

new g_counter 

new g_SyncRestartTimer
new g_SyncGameStart

new Float:RoundStartTime // Thank's to Kronos(pentru functia asta)

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;

public plugin_init()
{
register_plugin("Respawn-Secounds", "0.0.1", "Errol"); 
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("amx_respawn_tickets", "0"); // Pentru respawn fara numar setati 0
g_pCvarRespawnDelay = register_cvar("amx_respawn_delay", "1");
g_pCvarMaxHealth = register_cvar("amx_max_health", "100");
g_Time_Interval = register_cvar("amx_max_time", "15");
set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET );

g_SyncRestartTimer = CreateHudSyncObj()
g_SyncGameStart = CreateHudSyncObj()

}

public LogEventRoundStart()
{
RoundStartTime = get_gametime()

new iPlayers[32]
new iNum

get_players( iPlayers, iNum )

for( new i = 0; i < iNum; i++ )
{
g_iRespawn[iPlayers] = true
}
set_task(1.0,"TimeCounter",123456,_,_,"a",get_pcvar_num(g_Time_Interval))
set_task(get_pcvar_float(g_Time_Interval),"Runda_Terminata",789123)
}

public Runda_Terminata()
{
if(RoundStartTime)
{
set_hudmessage( 255, 0, 0, 0.09, 0.00, 1, 0.5, 1.0, 0.5, 15.0, -1)
ShowSyncHudMsg( 0, g_SyncGameStart, "Gata smecheria,gata cu respawnul")
}
}

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_num(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': 
{
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_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;
}
}
}

public TimeCounter() 
{
g_counter++

new Float:iRestartTime = get_pcvar_float(g_Time_Interval) - g_counter
new Float:fSec
fSec = iRestartTime 

set_hudmessage( 255, 0, 0, 0.09, 0.0, 1, 0.0, 1.0, 0.0, 0.0, -1)
ShowSyncHudMsg( 0, g_SyncRestartTimer, "Hai rapid, mai sunt %d secunde de respawn" , floatround(fSec)) // Mersi pentru %d

if(get_pcvar_num(g_Time_Interval) - g_counter < 11 && get_pcvar_num(g_Time_Interval) - g_counter !=0)
{
static szNum[32]
num_to_word(get_pcvar_num(g_Time_Interval) - g_counter, szNum, 31)
}
if(g_counter == get_pcvar_num(g_Time_Interval))
{
g_counter = 0
}
}
[/b]
Image
#WIZARDS to more, but I'm a hero.
-----------------------------------------------------
Lasă telefonul că ştiu actoria
Şi nu mai suna că-mi descarci bateria .


#Work only :

- [FPS Nvidia] [100%] [Public] [Here]
- [NoLag] [100%] [Public] [Here]
EDwardddd.
Membru, skill +2
Membru, skill +2
Posts: 806
Joined: 18 Jun 2010, 10:30
Detinator Steam: Da
SteamID: edwarddwd
Reputatie: Membru Club eXtreamCS (trei luni)
Fost Moderator ajutator
Nume anterioare: Elk, eDward /R/
Has thanked: 16 times
Been thanked: 49 times

28 May 2013, 19:38

Ce flag vrei pentru cei care au VIP ?
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

28 May 2013, 19:51

Poftim, creatia mea.
Netestat.
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Respawn plugin"
#define VERSION "1.0"
#define AUTHOR "Nubo"

#define LEVEL ADMIN_LEVEL_H // accesul pe care il are VIP

new timp;
new timp_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_cvar("respawn_player","30") //in cate secunde invie playerii fara acces vip
	register_cvar("respawn_vip","10") //in cat timp invie playerii cu acces vip
}

public player_killer(victim, attacker, gib){
	new id = victim;
	if(get_user_flags(id) & LEVEL){
		timp_vip = get_cvar_num("respawn_vip")
		set_task(0.1,"res_vip",id)
	}else{
		timp = get_cvar_num("respawn_player")
		set_task(0.1,"res_player",id)
	}
}

public res_vip(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp_vip >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp_vip)
		timp_vip--;
		set_task(1.0,"res_vip",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}

public res_player(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp)
		timp--;
		set_task(1.0,"res_player",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
Laur3
Membru, skill +1
Membru, skill +1
Posts: 149
Joined: 09 Jan 2013, 11:36
Detinator Steam: Da
Has thanked: 29 times
Been thanked: 1 time

28 May 2013, 20:49

flagul 't'
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

28 May 2013, 21:08

Este exact cum am pus eu: ADMIN_LEVEL_H.

Ai testat?
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
Laur3
Membru, skill +1
Membru, skill +1
Posts: 149
Joined: 09 Jan 2013, 11:36
Detinator Steam: Da
Has thanked: 29 times
Been thanked: 1 time

28 May 2013, 21:10

Da, nu merge, imi pare rau :(.
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

28 May 2013, 21:39

Buna! Incearca
Respawn | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Respawn plugin"
#define VERSION "1.0"
#define AUTHOR "Nubo"

#define LEVEL ADMIN_LEVEL_H // accesul pe care il are VIP

new timp;
new timp_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_cvar("respawn_player","30") //in cate secunde invie playerii fara acces vip
	register_cvar("respawn_vip","10") //in cat timp invie playerii cu acces vip
}

public player_killed(victim, attacker, gib){
	new id = victim;
	if(get_user_flags(id) & LEVEL){
		timp_vip = get_cvar_num("respawn_vip")
		set_task(0.1,"res_vip",id)
	}else{
		timp = get_cvar_num("respawn_player")
		set_task(0.1,"res_player",id)
	}
}

public res_vip(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp_vip >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi inviat!",timp_vip)
		timp_vip--;
		set_task(1.0,"res_vip",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}

public res_player(id){
	set_hudmessage(0, 255, 2, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi reinviat!",timp)
		timp--;
		set_task(1.0,"res_player",id)
	}else{
		show_hudmessage(id, "Vei fi reinviat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}
Am modificat eu pluginul lui NuBo! :-/
Last edited by YONTU on 28 May 2013, 21:45, edited 2 times in total.
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

28 May 2013, 21:40

Nubo wrote:Poftim, creatia mea.
Netestat.
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Respawn plugin"
#define VERSION "1.0"
#define AUTHOR "Nubo"

#define LEVEL ADMIN_LEVEL_H // accesul pe care il are VIP

new timp;
new timp_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_cvar("respawn_player","30") //in cate secunde invie playerii fara acces vip
	register_cvar("respawn_vip","10") //in cat timp invie playerii cu acces vip
}

public player_killer(victim, attacker, gib){
	new id = victim;
	if(get_user_flags(id) & LEVEL){
		timp_vip = get_cvar_num("respawn_vip")
		set_task(0.1,"res_vip",id)
	}else{
		timp = get_cvar_num("respawn_player")
		set_task(0.1,"res_player",id)
	}
}

public res_vip(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp_vip >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp_vip)
		timp_vip--;
		set_task(1.0,"res_vip",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}

public res_player(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp)
		timp--;
		set_task(1.0,"res_player",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}

Code: Select all

public player_killer(victim, attacker, gib)
=>

Code: Select all

public player_killed(victim, attacker, gib)
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
User avatar
Laur3
Membru, skill +1
Membru, skill +1
Posts: 149
Joined: 09 Jan 2013, 11:36
Detinator Steam: Da
Has thanked: 29 times
Been thanked: 1 time

28 May 2013, 21:42

Eu nu vad ca ai modificat nimic in pluginul lui Nubo. La pluginul lui Nubo problema este ca nici nu apare mesajul si nici nu respawneaza playerul sau vip-ul. Deci... nu-si atinge scopul :)).
Last edited by Laur3 on 28 May 2013, 21:44, edited 1 time in total.
User avatar
Nubo
Fost moderator
Fost moderator
Posts: 2734
Joined: 11 Jul 2012, 18:45
Detinator Steam: Da
CS Status: [əˈnɒn.ɪ.məs]
Reputatie: Fost scripter eXtreamCS
Fost eXtream Mod
Has thanked: 8 times
Been thanked: 27 times

28 May 2013, 21:43

Da, am gresit o litera....
Acum am si testat.
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Respawn plugin"
#define VERSION "1.0"
#define AUTHOR "Nubo"

#define LEVEL ADMIN_LEVEL_H // accesul pe care il are VIP

new timp;
new timp_vip;

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	RegisterHam(Ham_Killed, "player", "player_killed")
	register_cvar("respawn_player","30")
	register_cvar("respawn_vip","10")
}

public player_killed(victim, attacker, gib){
	new id = victim;
	if(get_user_flags(id) & LEVEL){
		timp_vip = get_cvar_num("respawn_vip")
		set_task(0.1,"res_vip",id)
	}else{
		timp = get_cvar_num("respawn_player")
		set_task(0.1,"res_player",id)
	}
}

public res_vip(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp_vip >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp_vip)
		timp_vip--;
		set_task(1.0,"res_vip",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}

public res_player(id){
	set_hudmessage(127, 255, 255, 0.28, -1.0, 0, 6.0, 1.0)
	if(timp >= 1){
		show_hudmessage(id, "Mai sunt %d secunde pana cand vei fi respawnat!",timp)
		timp--;
		set_task(1.0,"res_player",id)
	}else{
		show_hudmessage(id, "Vei fi respawnat ACUM!")
		if(is_user_connected(id) && !is_user_alive(id)){
			ExecuteHamB(Ham_CS_RoundRespawn, id)
		}
	}
}
Cand nu merge acest forum sunt online aici:
  • * Skype: nubo_cs
    * Y!M ID: nubo_cs
User avatar
YONTU
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2466
Joined: 10 May 2013, 14:25
Detinator Steam: Nu
CS Status: Everyone is looking at ur shoes
Reputatie: Moderator ajutator
Fost scripter eXtreamCS
Location: Gura Humorului
Has thanked: 256 times
Been thanked: 288 times
Contact:

28 May 2013, 21:46

Mda... Si eu: ADMIN_LEVEL_H = flagul "t" ! :))
„Peste douăzeci de ani vei fi dezamăgit din cauza lucrurilor pe care nu le-ai făcut, nu din cauza celor pe care le-ai făcut.” - Mark Twain
„Asa e si in viata, hotii castiga, prostii care invata pierd.” - Mihai Nemeș


Bio.LeagueCs.Ro - Biohazard v4.4 Xmas Edition
discord: IonutC#5114

Experinta in: Java/Spring boot/Angular/C/C++/C#/Javascript/Python/HTML/CSS/Pawn/SQL
Ai nevoie de ajutorul meu? Ma poti gasi doar la adresa de discord de mai sus.
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Semrush [Bot] and 28 guests