Pomoc przy COD
PisaR98
02.04.2012
Witam. Jestem nowym użytkownikiem i chciał bym zalożyć server, ale nie wiem czy dobrze zrobilem ten plugin na klase (przykład). Ta klasa miała mieć 1/4 z m3 i dostawać autopompe ale nie wiem czy jest dobrze jeśli nie to proszę o pomoc.
#include <amxmodx>
#include <hamsandwich>
#include <codmod>
#define DMG_BULLET (1<<1)
new const nazwa[] = "Rusher";
new const opis[] = "1/4 z m3 dostaje autopompe";
new const bronie = 1<<CSW_M3 | 1<<CSW_XM1014;
new const zdrowie = 10;
new const kondycja = 60;
new const inteligencja = 0;
new const wytrzymalosc = 10;
public plugin_init(RegisterHam(Ham_TakeDamage, "player", "TakeDamage"))
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_M3 && damage > 20.0 && random_num(1,4) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
#include <amxmodx>
#include <hamsandwich>
#include <codmod>
#define DMG_BULLET (1<<1)
new const nazwa[] = "Rusher";
new const opis[] = "1/4 z m3 dostaje autopompe";
new const bronie = 1<<CSW_M3 | 1<<CSW_XM1014;
new const zdrowie = 10;
new const kondycja = 60;
new const inteligencja = 0;
new const wytrzymalosc = 10;
public plugin_init(RegisterHam(Ham_TakeDamage, "player", "TakeDamage"))
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
{
if(!is_user_connected(idattacker))
return HAM_IGNORED;
if(!ma_klase[idattacker])
return HAM_IGNORED;
if(damagebits & DMG_BULLET)
{
new weapon = get_user_weapon(idattacker);
if(weapon == CSW_M3 && damage > 20.0 && random_num(1,4) == 1)
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
}
return HAM_IGNORED;
}
Kołodziej
02.04.2012
powinno działać (nie widzę błędów) wgraj na serwer po prostu ale przed tym skomplikuj

PisaR98
02.04.2012
ok
dzięki
Wyskakuje
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
codclas_Rusher.sma(15) : error 025: function heading differs from prototype
codclas_Rusher.sma(15) : warning 215: expression has no effect
codclas_Rusher.sma(15) : error 001: expected token: ";", but found ")"
codclas_Rusher.sma(23) : error 017: undefined symbol "ma_klase"
codclas_Rusher.sma(23) : warning 215: expression has no effect
codclas_Rusher.sma(23) : error 001: expected token: ";", but found "]"
codclas_Rusher.sma(23) : error 029: invalid expression, assumed zero
codclas_Rusher.sma(23) : fatal error 107: too many error messages on one line
Compilation aborted.
6 Errors.
dzięki
Wyskakuje
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team
codclas_Rusher.sma(15) : error 025: function heading differs from prototype
codclas_Rusher.sma(15) : warning 215: expression has no effect
codclas_Rusher.sma(15) : error 001: expected token: ";", but found ")"
codclas_Rusher.sma(23) : error 017: undefined symbol "ma_klase"
codclas_Rusher.sma(23) : warning 215: expression has no effect
codclas_Rusher.sma(23) : error 001: expected token: ";", but found "]"
codclas_Rusher.sma(23) : error 029: invalid expression, assumed zero
codclas_Rusher.sma(23) : fatal error 107: too many error messages on one line
Compilation aborted.
6 Errors.
Kogut
02.04.2012
codclas_Rusher.sma(23) : error 017: undefined symbol "ma_klase"
Musisz dodać nową zmienną bool ma_klase
ChadaWGW2
02.04.2012
na new bool ma_klase albo bool ma_klase albo jeszcze new ma_klaseif(!ma_klase[idattacker])
return HAM_IGNORED;
Użytkownik ChadaWGW2 edytował ten post 02.04.2012 19:29