Respawn

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
Granea
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 15 Apr 2009, 21:14
Detinator Steam: Da
SteamID: granea21
Location: Alexandria
Has thanked: 8 times

20 Oct 2010, 22:25

Salut am si eu o problema cum fac daca cineva intra la tero si daca da /respawn sa nu ii mai dea pistol..adica vreau sa fac daca da /respawn sa nu ii mai dea pistol la tero si cum fac sa il respawneze automat cand moare tero adica cum e la ct daca moare sa reinvie.
| Afiseaza codul
/* AMXX Mod script.
*
* (c) Copyright 2004, developed by Geesu
* This file is provided as is (no warranties). 
*
* Changelog
* 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
*/

#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 bool:g_PistolsDisabled = false

public plugin_init(){

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

	register_event("DeathMsg","on_Death","a")
	
	register_cvar("sv_checkpistols", "1")
	register_cvar("sv_respawn", "1")
	register_cvar("sv_respawn_time", "5")
}

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 on_Death()
{
	if ( !get_cvar_num("sv_respawn") )
		return PLUGIN_CONTINUE
	
	new victim_id = read_data(2)

	new parm[1]
	parm[0]=victim_id
	
	/* Spawn the player twice to avoid the HL engine bug */

	set_task(get_cvar_float("sv_respawn_time") + 0.5,"player_spawn",72,parm,1)
	set_task(get_cvar_float("sv_respawn_time") + 0.7,"player_spawn",72,parm,1)

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

	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])
RoyalServer 2
User avatar
KoOLa007
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 2243
Joined: 10 Feb 2009, 20:05
Detinator Steam: Nu
CS Status: Viaţa-i doar un vis pe bani!
Reputatie: Utilizator neserios (tepar)
Location: România/Constanţa
Has thanked: 135 times
Been thanked: 138 times

22 Oct 2010, 21:18

Schimba addon-ul. Adauga altul cu modul Respawn.
Road to 3k.
User avatar
Granea
Membru, skill +1
Membru, skill +1
Posts: 191
Joined: 15 Apr 2009, 21:14
Detinator Steam: Da
SteamID: granea21
Location: Alexandria
Has thanked: 8 times

22 Oct 2010, 23:42

Daca mi-ai posta un alt addons mai bun ar fi mai bine.Multumesc.Pe toate care le-am incercat nu merge.
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 50 guests