Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Wklejka 4lntdsdvjcqz dodana przez Lucjan, 23.05.2015 22:04
Typ:



1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
#include <sdktools>
#include <sdkhooks>
#include <sourcemod>
#include <cmod>
 
new const String:nazwaKlasy[] = "Ninja";
new const String:opisKlasy[] = "Znika na 2 sek po otrzymaniu obrażeń";
new const intKlasy = 0;
new const conKlasy = 5;
new const strKlasy = 15;
new const dexKlasy = 25;
new Handle:bronieKlasy;
 
new	bool:active[MAXPLAYERS+1],
	bool:active2[MAXPLAYERS+1];
 
public Plugin:myinfo = {
	name = "CmodClass: Ninja",
	author = "PLX",
	description = "Znika na 2 sek po otrzymaniu obrażeń",
	version = "1.0",
	url = "http://steamcommunity.com/id/plx211"
}
 
public OnPluginStart(){
	bronieKlasy = CreateArray(32);
 
	PushArrayString(bronieKlasy, "weapon_m4a1_silencer");
	PushArrayString(bronieKlasy, "weapon_usp_silencer");
	PushArrayString(bronieKlasy, "weapon_smokegrenade");
 
	Cmod_RegisterClass(nazwaKlasy, opisKlasy, intKlasy, conKlasy, strKlasy, dexKlasy, bronieKlasy);
}
 
public OnClientPutInServer(id){
	SDKHook(id, SDKHook_OnTakeDamage, OnTakeDamage);
	//SDKHook(id, SDKHook_SetTransmit, Hook_SetTransmit);
}
 
public Cmod_OnClassEnabled(client){
	active[client] = true;
	active2[client] = true;
	PushArrayString(Cmod_GetClientWeapons(client), "weapon_hkp2000")
	PushArrayString(Cmod_GetClientWeapons(client), "weapon_m4a1");
}
}
 
public Cmod_OnClassDisabled(client){
	ClearArray(Cmod_GetClientWeapons(client));
	active[client] = false;
	active2[client] = false;
}
 
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{		
	if(!IsValidClient(victim))
		return Plugin_Continue;
 
	if(active[victim] && active2[victim]){
		active2[victim] = false;
		SetEntityRenderMode(victim , RENDER_NONE);
		CreateTimer(2.0, vis, victim);
	}
	return Plugin_Continue;
}
 
public Action:vis(Handle:timer, any:client){
	SetEntityRenderMode(client, RENDER_NORMAL);
	active2[client] = true;
}
/*
public Action:Hook_SetTransmit(entity, client){ 
	if(IsValidClient(entity)){
		if(!active2[entity])
			return Plugin_Handled;
	}
	return Plugin_Continue;
}
 
bool:IsValidClient( client ) 
{
    if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) ) 
        return false; 
 
    return true; 
}  
*/
/*
public OnGameFrame(){
	for(new client = 1; client <= MaxClients; client++){
		if(IsClientConnected(client) && IsClientInGame(client)){
			if(active2[client]){
				SetEntityRenderMode(client, RENDER_NORMAL);
			}else{
				SetEntityRenderMode(client , RENDER_NONE);
			}
		}
	}
} 
*/
 
bool:IsValidClient( client ) 
{
    if ( !( 1 <= client <= MaxClients ) || !IsClientInGame(client) ) 
        return false; 
 
    return true; 
}
 

Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011