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 13xt1hxmktr2w dodana przez Lucjan, 05.07.2015 23:45
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.
#include <sdktools>
#include <sdkhooks>
#include <sourcemod>
#include <cmod>
 
new const String:nazwaKlasy[] = "Amadeusz";
new const String:opisKlasy[] = "Ma dodatkowe dmg od inta z mp7";
new const intKlasy = 40;
new const conKlasy = 5;
new const strKlasy = 0;
new const dexKlasy = 10;
new Handle:bronieKlasy;
 
new bool:active[MAXPLAYERS+1];
 
public Plugin:myinfo = {
	name = "CmodClass: Amadeusz",
	author = "Lucifer",
	description = "Ma dodatkowe dmg od inta z mp7",
	version = "1.0",
	url = "http://steamcommunity.com/profiles/76561197960680254"
}
 
public OnPluginStart(){
	bronieKlasy = CreateArray(32);
 
	PushArrayString(bronieKlasy, "weapon_mp7");
	PushArrayString(bronieKlasy, "weapon_glock");
 
	Cmod_RegisterClass(nazwaKlasy, opisKlasy, intKlasy, conKlasy, strKlasy, dexKlasy, bronieKlasy);
}
 
public OnClientPutInServer(id)
{
	SDKHook(id, SDKHook_OnTakeDamage, OnTakeDamage);
}
 
public OnClassEnabled(id)
{
	active[id] = true;
}
 
public OnClassDisabled(id)
{
	active[id] = false;
}
 
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
	if(!IsValidClient(attacker))
		return Plugin_Continue;
 
	if(GetClientTeam(attacker) == GetClientTeam(victim))
		return Plugin_Continue;	
 
 
	if(active[attacker]){
		decl String:sWeapon[32];
		GetClientWeapon(attacker, sWeapon, sizeof(sWeapon));
		if(StrEqual(sWeapon, "weapon_mp7")){
			damage += (float(Cmod_GetINT(attacker))/2);
			return Plugin_Changed;
		}
	}
	return Plugin_Continue;
}
 
stock bool:IsValidClient(client, bool:nobots = true)
{ 
    if (client <= 0 || client > MaxClients || !IsClientConnected(client) || (nobots && IsFakeClient(client)))
    {
        return false; 
    }
    return IsClientInGame(client); 
}  

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