Jailbreak MOD

Descărcări de pluginuri și discuții despre acestea.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
Filiq_
Membru, skill +2
Membru, skill +2
Posts: 666
Joined: 02 Nov 2014, 18:21
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Scripter eXtreamCS
Fond eXtream: 0
Location: Constanta
Has thanked: 31 times
Been thanked: 16 times

12 Jan 2020, 16:07

Nume plugin: Jailbreak
Descriere: Nu este tot modul in sine, este tot ce am facut in cateva ore, am zis sa va dau o "baza" pe care puteti incepe daca nu doriti sa folositi MyJailbreak.
Autor: Filiq
Versiune: 0.0.1

Instalare:
1. Fisierul "NumePlugin.sp" se adauga in "addons/sourcemod/scripting"
2. Fisierul "NumePlugin.smx" se adauga in "addons/sourcemod/plugins"
3. Fisierul "NumeFisier" se adauga in "addons/..."

Convar-uri: nu are
Comenzi publice:
sm_open
sm_simon
sm_fd
| Afiseaza codul
/*
	0.0.1:
		- Acum doar admini si CT pot vorbi
		- Acum se poate folosi comanda !simon
		- Daca vrei sa demisionezi poti folosi !simon a 2-a oara pentru a demisiona
		- Acum se alege random la inceput de runda un CT pentru a fi simon, acesta poate demisiona dupa aceasta.
		- Daca Simon iese de pe server sau moare se anunta pe server 
			* De bagat sunet * 
		- Am facut hud-ul, acum apare daca este un simon sau nu
		- Acum poti deschide sau inchide celulele cu comanda !open.
			* De bagat sunet *
		- Am rezolvat un bug la comanda !open
		- Am adaugat modele pentru Prizonieri si Gardieni, se aleg random la inceputul rundei
		- Acum cand un Prizonier ataca un gardien acesta va avea culoarea rosie si este anuntat in chat
			* De bagat sunet *
		- Rezolvat un bug la modele, nu vedeai nimic doar "ERROR"
		- Rezolvat un bug care facea ca atunci cand te spawnezi sa ai skinul negru
		- Am adaugat freeday, !fd poti da freeday all si freeday unui detinut
		- Rezolvat un bug care facea sa nu mearga sa dai freeday all
		-

Credite:
	Vaggelis - Open Cells
*/

#include <sourcemod>
#include <sdktools> 
#include <sdkhooks>
#include <basecomm>
#include <cstrike>

#define VERSION "1.0.0"  
 
public Plugin:myinfo = {
	name = "JailBreak Reborne",
	author = "Filiq_",
	description = "",
	version = VERSION
}

int gSimon = -1
int openDoors = 0

bool pFreeday[MAXPLAYERS]

float g_Min = 300.0

bool gFreeday = false

Handle g_DoorList
Handle:freeday_timer = INVALID_HANDLE
//char Name[MaxClients + 1][MAX_NAME_LENGTH]  

char Models[][] = {
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5.mdl", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4.mdl",


	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5.mdl", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4.mdl",

	"materials/models/player/kuristaja/jailbreak/guard1/hair01_ao_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard1/hair01_ao_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard1/hair01_ao_d2.vmt",
	"materials/models/player/kuristaja/jailbreak/guard1/hair01_ao_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard1/sewell01_head01_au_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard1/sewell01_head01_au_normal.vtf",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1.phy",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1.vvd",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard1/guard1_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/guard2/npc_ryall_head_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard2/npc_ryall_head_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard2/npc_ryall_head_normal.vtf",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2.phy",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2.vvd",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard2/guard2_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/guard3/policeman_ai_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard3/policeman_ai_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard3/policeman_ai_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard3/policeman_head_ai_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard3/policeman_head_ai_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard3/policeman_head_ai_normal.vtf",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3.phy",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3.vvd",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard3/guard3_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/guard4/eyes.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/eyes.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/eyes_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_1_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_1_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_1_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_2_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_2_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_2_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_3_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_badge.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_eyelashes.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_eyelashes.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_hair_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_hair_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_hair2_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_head_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_head_d.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_head_normal.vtf",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_head2_d.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_metal.vmt",
	"materials/models/player/kuristaja/jailbreak/guard4/femalecop_shoes.vmt",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4.phy",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4.vvd",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard4/guard4_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/guard5/guard_head_a6_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_head_a6_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_head_a6_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_body_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_body_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_body_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_head_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_head_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/guard5/guard_hs_head_normal.vtf", 
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5.phy",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5.vvd",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/guard5/guard5_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/prisoner1/eye_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/eye_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_bottom_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_bottom_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_bottom_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_head_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_head_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_head_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_top_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_top_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoner_lt_top_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoners_torso_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner1/prisoners_torso_d.vtf", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1.phy",
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1.vvd",
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner1/prisoner1_arms.vvd",


	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_body01_au_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_body01_au_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_body01_au_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_head01_au_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_head01_au_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/charles01_head01_au_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/hair01_au_d.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/hair01_au_d.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/hair01_au_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner2/hair02_au_d.vmt", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.phy",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2.vvd",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner2/prisoner2_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/prisoner3/eyes.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/eyes.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/gi_head_14.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/gi_head_14.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/gi_head_nml.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/m_white_13_co.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/m_white_13_co.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner3/m_white_13_n.vtf", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3.phy",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3.vvd",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner3/prisoner3_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/prisoner4/1.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/1.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/1_normal.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/eye.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/eye.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/gi_head_1.vmt", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/gi_head_1.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/gi_head_nml.vtf", 
	"materials/models/player/kuristaja/jailbreak/prisoner4/skin_detail.vtf", 
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4.phy",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4.vvd",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4_arms.dx90.vtx",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4_arms.mdl",
	"models/player/custom_player/kuristaja/jailbreak/prisoner4/prisoner4_arms.vvd",

	"materials/models/player/kuristaja/jailbreak/shared/brown_eye_normal.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/brown_eye01_an_d.vmt",  
	"materials/models/player/kuristaja/jailbreak/shared/brown_eye01_an_d.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/police_body_d.vmt",  
	"materials/models/player/kuristaja/jailbreak/shared/police_body_d.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/police_body_normal.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/prisoner1_body.vmt",  
	"materials/models/player/kuristaja/jailbreak/shared/prisoner1_body.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/prisoner1_body_normal.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/tex_0086_0.vmt",  
	"materials/models/player/kuristaja/jailbreak/shared/tex_0086_0.vtf",  
	"materials/models/player/kuristaja/jailbreak/shared/tex_0086_1.vtf",   
}

public OnPluginStart() {  
	LoadTranslations ("jailbreak.phrases") 

	RegConsoleCmd("sm_simon", SimonFunc)
	RegConsoleCmd("sm_open", SimonOpenDoors)
	RegConsoleCmd("sm_fd", FreedayMenu)
	
	HookEvent("round_start", Event_RoundStart)
	HookEvent("player_spawn", Event_PlayerSpawn)
	HookEvent("player_death", Event_PlayerDeath)
	HookEvent("player_hurt", Event_TakeDamage, EventHookMode_Post)


	CreateTimer(0.2, ShowHUD, _, TIMER_REPEAT)

	g_DoorList = CreateArray()
}   

public OnMapStart() {

	char gString[256]

	for(new i = 0; i < sizeof Models; i++) {
		FormatEx(gString, sizeof gString, "%s", Models)
		if(i > 8) AddFileToDownloadsTable(gString) 
		else PrecacheModel(gString)
	}
	
	CacheDoors()
}
public void OnMapEnd() {
	ClearArray(g_DoorList) 
}

public OnClientPutInServer(int client) {
	//GetClientName(client, Name[client], MAX_NAME_LENGTH)
	SDKHook(client, SDKHook_OnTakeDamage, Hook_OnTakeDamage)
}

public OnClientDisconnect(int client) {
	if(gSimon == client) {
		gSimon = -1
		PrintToChatAll("\x04[JailBreak] \x03%t", "Simon s-a deconectat", client)
	}
}

public Action Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast) {
	gSimon = -1
	openDoors = 0
	gFreeday = false

	if(freeday_timer != INVALID_HANDLE)
		KillTimer(freeday_timer) 
	
	freeday_timer = INVALID_HANDLE

	new client = GetRandomPlayer(CS_TEAM_CT)
	if(client > 0) FakeClientCommand(client, "sm_simon")
}

public Action Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) {
	new client = GetClientOfUserId(GetEventInt(event, "userid")) 

	if(GetClientTeam(client) != CS_TEAM_CT && GetUserAdmin(client) == INVALID_ADMIN_ID) BaseComm_SetClientMute(client, true)
	else BaseComm_SetClientMute(client, false)

	if(!IsPlayerAlive(client))
		return Plugin_Handled

	switch(GetClientTeam(client)) {
		case CS_TEAM_CT: {
			int num = GetRandomInt(0, 4)
			SetEntityModel(client, Models[num])
		}
		case CS_TEAM_T: {
			int num = GetRandomInt(5, 8)
			SetEntityModel(client, Models[num])
		}
	}

	SetEntityRenderMode(client, RENDER_NORMAL)

	return Plugin_Handled
}

public Action Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast) {
	new client = GetClientOfUserId(GetEventInt(event, "userid"))

	if(gSimon != client)
		return Plugin_Handled  

	gSimon = -1
	PrintToChatAll("\x04[JailBreak] \x03%t", "Simon a fost asasinat!", client)

	return Plugin_Handled
}

public Action Event_TakeDamage(Handle:event, const String:name[], bool:dontBroadcast) {
	new victim = GetClientOfUserId(GetEventInt(event, "userid"))
	new attacker = GetClientOfUserId(GetEventInt(event, "attacker"))

	if(GetClientTeam(attacker) == CS_TEAM_T) {
		if(gSimon == victim)
			PrintToChatAll("\x04[JailBreak] \x03%t", "Simon a fost atacat!", victim, attacker) 
	
		SetEntityRenderColor(attacker, 255, 0, 0) 
	}
}

public Action Hook_OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype) {
	//if(pFreeday[victim] == true || pFreeday[attacker] == true) { 
	//	return Plugin_Stop
	//}

	return Plugin_Continue
}
 
public OnClientPostAdminCheck(int client) {
	if(GetUserAdmin(client) == INVALID_ADMIN_ID) BaseComm_SetClientMute(client, true)
	else BaseComm_SetClientMute(client, false)
}

public Action SimonFunc(int client, int args) {
	if(!client) {
		//return Plugin_Handled 
	}

	if(gSimon == client) {
		gSimon = -1
		PrintToChatAll("\x04[JailBreak] \x03%t", "Simon a demisionat", client)
	}

	if(!IsPlayerAlive(client) || GetClientTeam(client) != CS_TEAM_CT || gSimon != -1 || gFreeday == true) PrintToChat(client, " \x04[JailBreak] \x03%t", "Trebuie sa fii in viata si la CT pentru a putea fii simon!")
	else gSimon = client

	//return Plugin_Handled
} 

public Action SimonOpenDoors(int client, int args) {

	if(gSimon != client) {
		PrintToChat(client, " \x04[JailBreak] \x03%t", "Trebuie sa fii simon pentru a face acest lucru!")
		return Plugin_Handled
	}

	switch(openDoors) {
		case 0: {
			for(int i = 0; i < GetArraySize(g_DoorList); i++) {
				int door = GetArrayCell(g_DoorList, i)
				
				AcceptEntityInput(door, "Open")
			}
			openDoors = 1
			PrintToChatAll(" \x04[JailBreak] \x03%t", "Simon a deschis celulele!", client)
		}
		case 1: {
			for(int i = 0; i < GetArraySize(g_DoorList); i++) {
				int door = GetArrayCell(g_DoorList, i)
				
				AcceptEntityInput(door, "Close")
			}
			openDoors = 0
			PrintToChatAll(" \x04[JailBreak] \x03%t", "Simon a inchis celulele!", client)
		}
	}

	return Plugin_Handled
}

public Action FreedayMenu(int client, int args) {
	if(GetClientTeam(client) != CS_TEAM_CT || !(GetUserFlagBits(client) & ADMFLAG_KICK)) {
		//return Plugin_Handled
	}

	new Handle:menu = CreateMenu(FreedayMenu_handler, MenuAction_Select | MenuAction_End)
	SetMenuTitle(menu, "Freeday Menu:")
	
	AddMenuItem(menu, "fdall", "Freeday ALL")
	AddMenuItem(menu, "player", "Select player")

	DisplayMenu(menu, client, MENU_TIME_FOREVER)

	//return Plugin_Handled
}

public FreedayMenu_handler(Handle:menu, MenuAction:action, client, param2) {
	switch(action) {
		case MenuAction_Select: {
			char item[10]
			GetMenuItem(menu, param2, item, sizeof(item))

			if(StrEqual(item, "fdall")) Freeday(0)  
			else if(StrEqual(item, "player")) PlayerFreeday(client) 
		}
		case MenuAction_End: CloseHandle(menu) 
	}
}

public PlayerFreeday(client) {
	char szName[MAX_NAME_LENGTH],
		szUserID[10]
	
	new Handle:menu = CreateMenu(PlayerFreeday_Handler, MenuAction_Select | MenuAction_End)
	SetMenuTitle(menu, "Select Player:")
	
	for(new i = 1; i <= MaxClients; i++)
	{
		if(IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i))
		{
			GetClientName(i, szName, sizeof(szName))
			IntToString(GetClientUserId(i), szUserID, sizeof(szUserID))
			AddMenuItem(menu, szUserID, szName)
		}
	}

	DisplayMenu(menu, client, MENU_TIME_FOREVER)
}

public PlayerFreeday_Handler(Handle:menu, MenuAction:action, client, param2) {
	switch(action) {
		case MenuAction_Select: {
			char item[15]
			GetMenuItem(menu, param2, item, sizeof(item))
			 
			new user_id = GetClientOfUserId(StringToInt(item))
			
			if(IsClientConnected(user_id) && IsPlayerAlive(user_id)) {
				Freeday(user_id)

				PrintHintText(user_id, "You got Freeday")
				PrintToChatAll("[Jailbreak] %N gave Freeday to %N", client, user_id)
			}
			else 
				PlayerFreeday(client) 
		}
		case MenuAction_End: CloseHandle(menu) 
	}
}

public Freeday(int client) { 
	
	if(client == 0) {
		gFreeday = true
		//special_day = true
		
		gSimon = -1
		//RemoveSimon()
		//EmitSoundToAllAny("jailbreak/bell.mp3")
		
		for(new i = 1; i <= MaxClients; i++) {
			if(IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) {
				SetEntityRenderColor(i, 0, 255, 0, 255)
			}
		}
		
		freeday_timer = CreateTimer(120.0, FreedayEnd) 
	}
	else {
		if(IsClientInGame(client) && GetClientTeam(client) == 2 && IsPlayerAlive(client)) {
			pFreeday[client] = true
			SetEntityRenderColor(client, 0, 255, 0, 255)
		}
	}  
}

public Action:FreedayEnd(Handle:timer) {
	gFreeday = false
	
	for(new i = 1; i <= MaxClients; i++) {
		if(IsClientInGame(i) && GetClientTeam(i) == 2 && IsPlayerAlive(i)) {
			SetEntityRenderMode(i, RENDER_NORMAL)
		}
	}
	
	if(freeday_timer != INVALID_HANDLE)
		KillTimer(freeday_timer) 
	
	freeday_timer = INVALID_HANDLE

	//EmitSoundToAllAny("jailbreak/bell.mp3")
	PrintToChatAll("[Jailbreak] The Freeday has ended")
}

public Action ShowHUD(Handle:timer) {
	
	char gString[150]
	if(gSimon != -1) FormatEx(gString, 150, "Simon este: %N, ascultati-l !", gSimon)
	else FormatEx(gString, 150, "Nu este nici un simon.")

	if(gFreeday == true)
		FormatEx(gString, 150, "Freeday, astazi puteti face ce vreti.\nNu aveti voie la arme!")

	for (new i = 1; i < MaxClients; i++)
		if(IsClientInGame(i))
			PrintHintText(i, "%s\nYour credits: 0", gString)
}

GetRandomPlayer(team) {
	new clients[MaxClients + 1], 
		clientCount

	for(new i = 1; i <= MaxClients; i++)
		if(IsClientInGame(i) && GetClientTeam(i) == team) 
			clients[clientCount++] = i
		
	return (clientCount == 0) ? -1 : clients[GetRandomInt(0, clientCount-1)]
}

void CacheDoors() {
	int ent = -1
	int door = -1
	
	while((ent = FindEntityByClassname(ent, "info_player_terrorist")) != -1) {
		float prisoner_pos[3]
		GetEntPropVector(ent, Prop_Data, "m_vecOrigin", prisoner_pos)
		
		while((door = FindEntityByClassname(door, "func_door")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				g_Min = GetVectorDistance(door_pos, prisoner_pos)
			}
		}
		
		while((door = FindEntityByClassname(door, "func_door_rotating")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				g_Min = GetVectorDistance(door_pos, prisoner_pos)
			}
		}
		
		while((door = FindEntityByClassname(door, "func_movelinear")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				g_Min = GetVectorDistance(door_pos, prisoner_pos)
			}
		}
		
		while((door = FindEntityByClassname(door, "prop_door_rotating")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				g_Min = GetVectorDistance(door_pos, prisoner_pos)
			}
		}
	}
	
	g_Min += 100
	
	while((ent = FindEntityByClassname(ent, "info_player_terrorist")) != -1) {
		float prisoner_pos[3]
		GetEntPropVector(ent, Prop_Data, "m_vecOrigin", prisoner_pos)
		
		while((door = FindEntityByClassname(door, "func_door")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				PushArrayCell(g_DoorList, door)
			}
		}
		
		while((door = FindEntityByClassname(door, "func_door_rotating")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				PushArrayCell(g_DoorList, door)
			}
		}
		
		while((door = FindEntityByClassname(door, "func_movelinear")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				PushArrayCell(g_DoorList, door)
			}
		}
		
		while((door = FindEntityByClassname(door, "prop_door_rotating")) != -1) {
			float door_pos[3]
			GetEntPropVector(door, Prop_Data, "m_vecOrigin", door_pos)
			
			if(GetVectorDistance(door_pos, prisoner_pos) <= g_Min) {
				PushArrayCell(g_DoorList, door)
			}
		}
	}
}

| Afiseaza codul
"Phrases"
{
	"Simon s-a deconectat"
	{
		"#format"	"{1:N}"
		"en" "Simon {1} has disconnect from server!"
		"ro" "Simon {1} s-a deconectat de pe server!"
	}
	"Simon a fost asasinat!" 
	{
		"#format"	"{1:N}"
		"en" "Simon {1} a fost asasinat!"
		"ro" "Simon {1} a fost asasinat!"
	}
	"Simon a demisionat!" 
	{
		"#format"	"{1:N}"
		"en" "Simon {1} a demisionat!"
		"ro" "Simon {1} a demisionat!"
	}
	"Simon a deschis celulele!" 
	{
		"#format"	"{1:N}"
		"en" "Simon {1} a deschis celulele!"
		"ro" "Simon {1} a deschis celulele!"
	}
	"Simon a inchis celulele!"
	{
		"#format"	"{1:N}"
		"en" "Simon {1} a inchis celulele!"
		"ro" "Simon {1} a inchis celulele!"
	} 
	"Simon a fost atacat!"
	{
		"#format"	"{1:N},{2:N}"
		"en" "Simon {1} a fost atacat de {2}"
		"ro" "Simon {1} a fost atacat de {2}"
	}
	"Trebuie sa fii simon pentru a face acest lucru!" 
	{ 
		"en" "Trebuie sa fii simon pentru a face acest lucru!"
		"ro" "Trebuie sa fii simon pentru a face acest lucru!"
	}
}
CLUJ.LALEAGANE.RO / 89.40.104.209:27015

pluginuri-general/jailbreak-mod-t366552.html
Post Reply

Return to “Pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests