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 1i9om2mmxc9g7 dodana przez KochamFootball, 05.04.2015 16:32
Typ:



Klasa Terminator
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.
#include <sourcemod>
#include <sdkhooks>
#include <cstrike>
#include <cmod>
 
public Plugin:myinfo =
{
	name = "Cmod class: Terminator",
	author = "KochamFootball",
	description = "std class",
	version = "0.1",
	url = "http://amxx.pl"
};
 
new bool:active[MAXPLAYERS+1];
 
public OnPluginStart()
{
	new Handle:weapons = CreateArray(32);
	PushArrayString(weapons, "weapon_m4a1");
	PushArrayString(weapons, "weapon_ak47");	
	PushArrayString(weapons, "weapon_knife");
	PushArrayString(weapons, "weapon_elite");
	PushArrayString(weapons, "weapon_hegrenade");
	PushArrayString(weapons, "weapon_smokegrenade");	
	PushArrayString(weapons, "weapon_flashbang");
	PushArrayString(weapons, "weapon_flashbang");
	Cmod_RegisterClass("[PREMIUM] Terminator", "Dostaje 10 HP + 1/2 INT za każde zabójstwo!", 40, 50, 60, 5, weapons);
	HookEvent("player_death", eventPlayerDeath);
}
 
public OnClassEnabled(id)
{
	if(!GetAdminFlag(GetUserAdmin(id), Admin_Custom3)){
		PrintToChat(id, "x01x0Bx01 x07%s x06Nie możesz używać tej klasy!", MOD_TAG);
		return CMOD_DISABLE;
	} 
	active[id] = true;
	return CMOD_CONTINUE;
 
}
 
public OnClassDisabled(id)
{
	active[id] = false;
}
 
public eventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	if(active[attacker]){
		if(IsClientInGame(attacker) && IsPlayerAlive(attacker)){
			decl medic, health, maxHealth;
			health = GetEntData(attacker, FindDataMapOffs(attacker, "m_iHealth"), 4);
			maxHealth = GetEntData(attacker, FindDataMapOffs(attacker, "m_iMaxHealth"), 4);
			medic = 10 + (Cmod_GetINT(attacker)/2);
			if(health < maxHealth){
				if((health + medic) > maxHealth)
					medic = maxHealth;
				else
					medic += health;
				SetEntData(attacker, FindDataMapOffs(attacker, "m_iHealth"), medic, 5, true);
			}
		}
	}
}
 

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