Limit Respawn

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 .
Post Reply
raresthebest
Membru, skill +1
Membru, skill +1
Posts: 136
Joined: 12 Jul 2012, 21:20
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 17 times
Contact:

09 Apr 2014, 17:30

Descriere plugin cerut: as avea nevoie de un script pentru ca comanda /respawn sa poata fi folosita de maxim 5 ori!..
Alte informatii:
RoyalServer
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

10 Apr 2014, 17:36

pai posteaza sursa ;)
raresthebest
Membru, skill +1
Membru, skill +1
Posts: 136
Joined: 12 Jul 2012, 21:20
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 17 times
Contact:

10 Apr 2014, 19:00

Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

10 Apr 2014, 19:07

Code: Select all

new const VERSION[] =	"1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>

#define DISABLE_CS 0

// team ids 
#define UNASSIGNED 0 
#define TS 1 
#define CTS 2 
#define AUTO_TEAM 5 

new Limita[33];

new bool:g_PistolsDisabled = false

public plugin_init(){

	register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

	register_event("DeathMsg","on_Death","a")
	
	register_cvar("sv_checkpistols", "1")
	register_cvar("sv_respawn", "1")
	register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

	register_clcmd("say","on_Chat")
	register_clcmd("say_team","on_Chat")
}

public on_Chat(id)
{
	if ( !get_cvar_num("sv_respawn") )
	{
		client_print(id, print_chat, "* Respawn plugin disabled")
		return PLUGIN_CONTINUE
	}

	new szSaid[32]
	read_args(szSaid, 31) 

	if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
	{
		spawn_func(id)
	}
}

public check_pistols()
{
	/* Determine if we should give players a pistol or not */
	if ( get_cvar_num("sv_checkpistols") )
	{
		set_task(1.0, "check_pistols")
		new mapname[32]
		get_mapname(mapname,31) 
		if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
				g_PistolsDisabled = true
	}
}

public spawn_func(id)
{
	if(Limita[id] == 5)
	{
		client_print(id,print_chat,"Ai folosit deja de 5 ori aceasta comanda,asteapta pana runda urmatoare");
		return
	}
	new parm[1]
	parm[0]=id
	
	/* Spawn the player twice to avoid the HL engine bug */
	set_task(0.5,"player_spawn",72,parm,1)
	set_task(0.7,"player_spawn",72,parm,1)

	/* Then give them a suit and a knife */
	set_task(0.9,"player_giveitems",72,parm,1)
	Limita[id]++;
}

public on_Death()
{
	if ( !get_cvar_num("sv_respawn") )
		return PLUGIN_CONTINUE
	
	new victim_id = read_data(2)
	
	spawn_func( victim_id )

	return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
	new id = parm[0]

	give_item(id, "item_suit")
	give_item(id, "weapon_knife")

	/* Determines if a players should be given a pistol */
	if ( !g_PistolsDisabled )
	{
		new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false 
		get_user_weapons(id,wpnList,number)
		
		/* Determine if the player already has a pistol */
		for (new i = 0;i < number;i++)
		{ 
			if (wpnList[i] == CSW_GLOCK18) 
				foundGlock = true 
			if (wpnList[i] == CSW_USP) 
				foundUSP = true 
		}
		
		/* Give a T his/her pistol */
		if ( get_user_team(id)==TS && !foundGlock )
		{
				give_item(id,"weapon_glock18")
				give_item(id,"ammo_9mm")
				give_item(id,"ammo_9mm")
		}
		/* Give a CT his/her pistol */
		else if ( get_user_team(id)==CTS && !foundUSP )
		{
				give_item(id,"weapon_usp")
				give_item(id,"ammo_45acp")
				give_item(id,"ammo_45acp")
		}
	}

	return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
	spawn(parm[0])
}
altadata pune direct sursa... ;)
User avatar
HamletEagle
Fost moderator
Fost moderator
Posts: 750
Joined: 21 Sep 2013, 15:05
Detinator Steam: Da
CS Status: Inactiv cateva zile.
SteamID: privat
Reputatie: Fost Scripter eXtreamCS.com
Fost Moderator ajutator
Has thanked: 19 times
Been thanked: 85 times

10 Apr 2014, 19:08

| Afiseaza codul
/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties). 
*
* Changelog
* 1.1:
*   Added /respawn command to spawn a player if they're dead
*   Added a public cvar
* 1.0: 
*	Pistols are now given to players when they respawn
*	sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
*	sv_respawn cvar added, set this to 0 to disable the plugin
*/

new const VERSION[] =	"1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define DISABLE_CS 0

// team ids 
#define UNASSIGNED 0 
#define TS 1 
#define CTS 2 
#define AUTO_TEAM 5 

new bool:g_PistolsDisabled = false
new g_count[33]

public plugin_init(){
	
	register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")
	
	register_event("DeathMsg","on_Death","a")
	
	register_cvar("sv_checkpistols", "1")
	register_cvar("sv_respawn", "1")
	register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)
	
	register_clcmd("say","on_Chat")
	register_clcmd("say_team","on_Chat")
	RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)  
}

public fwHamPlayerSpawnPost(id) g_count[id]=0

public on_Chat(id)
{
	if ( !get_cvar_num("sv_respawn") )
	{
		client_print(id, print_chat, "* Respawn plugin disabled")
		return PLUGIN_CONTINUE
	}
	
	new szSaid[32]
	read_args(szSaid, 31) 
	
	if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
	{
		if(g_count[id] >=5) {
			spawn_func(id)
			g_count[id]++
			
		}
		else client_print(id,print_chat,"Poti folosii /respawn de maxim 5 ori")
	}
	
	return 1
}

public check_pistols()
{
	/* Determine if we should give players a pistol or not */
	if ( get_cvar_num("sv_checkpistols") )
	{
		set_task(1.0, "check_pistols")
		new mapname[32]
		get_mapname(mapname,31) 
		if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
			g_PistolsDisabled = true
	}
}

public spawn_func(id)
{
	new parm[1]
	parm[0]=id
	
	/* Spawn the player twice to avoid the HL engine bug */
	set_task(0.5,"player_spawn",72,parm,1)
	set_task(0.7,"player_spawn",72,parm,1)
	
	/* Then give them a suit and a knife */
	set_task(0.9,"player_giveitems",72,parm,1)
}

public on_Death()
{
	if ( !get_cvar_num("sv_respawn") )
		return PLUGIN_CONTINUE
	
	new victim_id = read_data(2)
	
	spawn_func( victim_id )
	
	return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
	new id = parm[0]
	
	give_item(id, "item_suit")
	give_item(id, "weapon_knife")
	
	/* Determines if a players should be given a pistol */
	if ( !g_PistolsDisabled )
	{
		new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false 
		get_user_weapons(id,wpnList,number)
		
		/* Determine if the player already has a pistol */
		for (new i = 0;i < number;i++)
		{ 
			if (wpnList == CSW_GLOCK18) 
				foundGlock = true 
			if (wpnList == CSW_USP) 
				foundUSP = true 
		}
		
		/* Give a T his/her pistol */
		if ( get_user_team(id)==TS && !foundGlock )
		{
			give_item(id,"weapon_glock18")
			give_item(id,"ammo_9mm")
			give_item(id,"ammo_9mm")
		}
		/* Give a CT his/her pistol */
		else if ( get_user_team(id)==CTS && !foundUSP )
		{
			give_item(id,"weapon_usp")
			give_item(id,"ammo_45acp")
			give_item(id,"ammo_45acp")
		}
	}
	
	return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
	spawn(parm[0])
}


Vezi acum. Versiunea lui cosmin nu va merge foarte bine deoarece nu reseteaza variabila Limita[id] la spawn/new round....
Last edited by HamletEagle on 10 Apr 2014, 19:12, edited 1 time in total.
Daca vreti ajutorul meu, nu dati bump la topic, fara intrebari de genu "cat mai dureaza/mai astept mult?".
Cosmin
Fost moderator
Fost moderator
Posts: 9362
Joined: 06 Jul 2013, 22:08
Detinator Steam: Da
Detinator server CS: Nu
Reputatie: Fost eXtream Mod
Fost Scripter eXtreamCS
Nume anterior: scosmynnnn
Has thanked: 492 times
Been thanked: 547 times

10 Apr 2014, 19:10

HamletEagle wrote:
| Afiseaza codul
/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties). 
*
* Changelog
* 1.1:
*   Added /respawn command to spawn a player if they're dead
*   Added a public cvar
* 1.0: 
*	Pistols are now given to players when they respawn
*	sv_checkpistols cvar added, if this is set to 0, then players will always spawn with a pistol, otherwise they will only spawn with a pistol when it is not scoutzknivez and not a ka map
*	sv_respawn cvar added, set this to 0 to disable the plugin
*/

new const VERSION[] =	"1.1"

#include <amxmodx>
#include <fun>
#include <cstrike>
#include <hamsandwich>

#define DISABLE_CS 0

// team ids 
#define UNASSIGNED 0 
#define TS 1 
#define CTS 2 
#define AUTO_TEAM 5 

new bool:g_PistolsDisabled = false
new g_count[33]

public plugin_init(){

	register_plugin("Respawn Forever", VERSION, "Pimp Daddy (OoTOAoO)")

	register_event("DeathMsg","on_Death","a")
	
	register_cvar("sv_checkpistols", "1")
	register_cvar("sv_respawn", "1")
	register_cvar("respawn_forever_version", VERSION, FCVAR_SERVER)

	register_clcmd("say","on_Chat")
	register_clcmd("say_team","on_Chat")
	registerHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)  
}

public fwHamPlayerSpawnPost(id) g_count[id]=0

public on_Chat(id)
{
	if ( !get_cvar_num("sv_respawn") )
	{
		client_print(id, print_chat, "* Respawn plugin disabled")
		return PLUGIN_CONTINUE
	}

	new szSaid[32]
	read_args(szSaid, 31) 

	if (equali(szSaid,"^"/respawn^"") || equali(szSaid,"^"respawn^""))
	{
		if(g_count[id] >=5) {
		spawn_func(id)
		g_count[id]++
		
	}
	else client_print(id,print_chat,"Poti folosii /respawn de maxim 5 ori")
	}
}

public check_pistols()
{
	/* Determine if we should give players a pistol or not */
	if ( get_cvar_num("sv_checkpistols") )
	{
		set_task(1.0, "check_pistols")
		new mapname[32]
		get_mapname(mapname,31) 
		if ( containi(mapname,"ka_")!=-1 || containi(mapname,"scoutzknivez")!=-1 )
				g_PistolsDisabled = true
	}
}

public spawn_func(id)
{
	new parm[1]
	parm[0]=id
	
	/* Spawn the player twice to avoid the HL engine bug */
	set_task(0.5,"player_spawn",72,parm,1)
	set_task(0.7,"player_spawn",72,parm,1)

	/* Then give them a suit and a knife */
	set_task(0.9,"player_giveitems",72,parm,1)
}

public on_Death()
{
	if ( !get_cvar_num("sv_respawn") )
		return PLUGIN_CONTINUE
	
	new victim_id = read_data(2)
	
	spawn_func( victim_id )

	return PLUGIN_CONTINUE
}

public player_giveitems(parm[1])
{
	new id = parm[0]

	give_item(id, "item_suit")
	give_item(id, "weapon_knife")

	/* Determines if a players should be given a pistol */
	if ( !g_PistolsDisabled )
	{
		new wpnList[32] = 0, number = 0, bool:foundGlock = false, bool:foundUSP = false 
		get_user_weapons(id,wpnList,number)
		
		/* Determine if the player already has a pistol */
		for (new i = 0;i < number;i++)
		{ 
			if (wpnList == CSW_GLOCK18) 
				foundGlock = true 
			if (wpnList == CSW_USP) 
				foundUSP = true 
		}
		
		/* Give a T his/her pistol */
		if ( get_user_team(id)==TS && !foundGlock )
		{
				give_item(id,"weapon_glock18")
				give_item(id,"ammo_9mm")
				give_item(id,"ammo_9mm")
		}
		/* Give a CT his/her pistol */
		else if ( get_user_team(id)==CTS && !foundUSP )
		{
				give_item(id,"weapon_usp")
				give_item(id,"ammo_45acp")
				give_item(id,"ammo_45acp")
		}
	}

	return PLUGIN_CONTINUE
}

public player_spawn(parm[1])
{
	spawn(parm[0])
}


Vezi acum. Versiunea lui cosmin nu va merge foarte bine deoarece nu reseteaza variabila Limita[id] la spawn/new round....

El nu a specificat...eu am pus pe toata harta sa fie de 5 ori :D
raresthebest
Membru, skill +1
Membru, skill +1
Posts: 136
Joined: 12 Jul 2012, 21:20
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 10 times
Been thanked: 17 times
Contact:

11 Apr 2014, 11:50

Multumesc mult la amandoi
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests