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.
|
Pomoc Item !
#1
Napisano 13.05.2011 18:09
proszę o pomoc dam +
Dodano 14 maj 2011 - 08:28:
Refresh!
#2
Napisano 14.05.2011 22:43
#3
Napisano 15.05.2011 09:26
Ktoś już napisał taki plugin ale źle działał
#4
Napisano 15.05.2011 18:49
#5
Napisano 23.05.2011 22:13
#6
Napisano 23.05.2011 22:28
Nowa zmienna:
new gBullets
Do public plugin_init dodaj:
register_forward(FM_TraceLine,"fw_traceline");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "Ham_Weapon_Attack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "Ham_Weapon_Attack");
Na koniec pluginu:
public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id)
{
if(!is_user_alive(id) || !player_item_id[id] == NUMER_ITEMU || gBullets[id] < 0 )
return FMRES_IGNORED;
if( get_user_weapon(id) != CSW_KNIFE )
return FMRES_IGNORED;
// get crosshair aim
static iMyAim[3], Float:flMyAim[3];
get_user_origin(id, iMyAim, 3);
IVecFVec(iMyAim, flMyAim);
// set crosshair aim
set_tr(TR_vecEndPos, flMyAim);
// get ent looking at
static ent, body;
get_user_aiming(id, ent, body);
// if looking at something
if( pev_valid(ent) )
{
set_tr(TR_flFraction, 0.1); // 1.0 == no hit, < 1.0 == hit
set_tr(TR_pHit, ent); // entity hit
set_tr(TR_iHitgroup, body); // bodypart hit
}
return FMRES_IGNORED;
}
public Ham_Weapon_Attack(weaponent)
{
if ( !is_user_alive(id) ) return;
new id = get_pdata_cbase(weaponent, 41, 4);
if ( gBullets[id] >= 0 )
{
new count = --gBullets[id];
if ( 0 < count < 5 )
sh_chat_message( id, gHeroID, "Pozostalo ci %d Naboi", count);
}
}
Użytkownik GerO edytował ten post 23.05.2011 22:32
#7
Napisano 23.05.2011 23:06
Nie wiem czy to zadziała...
Nowa zmienna:new gBullets
Do public plugin_init dodaj:register_forward(FM_TraceLine,"fw_traceline");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "Ham_Weapon_Attack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "Ham_Weapon_Attack");
Na koniec pluginu:public fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id)
{
if(!is_user_alive(id) || !player_item_id[id] == NUMER_ITEMU || gBullets[id] < 0 )
return FMRES_IGNORED;
if( get_user_weapon(id) != CSW_KNIFE )
return FMRES_IGNORED;
// get crosshair aim
static iMyAim[3], Float:flMyAim[3];
get_user_origin(id, iMyAim, 3);
IVecFVec(iMyAim, flMyAim);
// set crosshair aim
set_tr(TR_vecEndPos, flMyAim);
// get ent looking at
static ent, body;
get_user_aiming(id, ent, body);
// if looking at something
if( pev_valid(ent) )
{
set_tr(TR_flFraction, 0.1); // 1.0 == no hit, < 1.0 == hit
set_tr(TR_pHit, ent); // entity hit
set_tr(TR_iHitgroup, body); // bodypart hit
}
return FMRES_IGNORED;
}
public Ham_Weapon_Attack(weaponent)
{
if ( !is_user_alive(id) ) return;
new id = get_pdata_cbase(weaponent, 41, 4);
if ( gBullets[id] >= 0 )
{
new count = --gBullets[id];
if ( 0 < count < 5 )
sh_chat_message( id, gHeroID, "Pozostalo ci %d Naboi", count);
}
}
Koleś, Ty lepiej nic już nie pisz, bo widać, że g**no się znasz. SuperHero do Diablo? Pogratulować.
@Down:
***** się znam? Jakoś ja to u siebie mam z mojego kodu, więc raczej nie *****. ; ]]
sh_chat_message to pokazywanie wiadomości w SH, bez SH na serwie nic nie pokaże.
Użytkownik GoldeN edytował ten post 24.05.2011 14:22
#8
Napisano 24.05.2011 13:45
#9
Napisano 24.05.2011 14:30
new gBullets[33],
gBullets[id] = 0a w case item np. ?
case xx:
{
player_item_name[id] = "Long knife"
player_item_id[id] = rannum
gBullets[id] = 1
show_hudmessage (id, "Znalazles przedmiot : %s :: opis itemu ...",player_item_name[id])
}
i na co to : ?
?? O jakie naboje chodzi ?
if ( 0 < count < 5 )
sh_chat_message( id, gHeroID, "Pozostalo ci %d Naboi", count);
}
Użytkownik Aard edytował ten post 24.05.2011 14:31
#10
Napisano 24.05.2011 14:58
new gBullets[MAX+1];
Pod sam koniec sma dodaj:
public Ham_Weapon_Attack(weaponent, id)
{
if ( !is_user_alive(id) ) return;
new id = get_pdata_cbase(weaponent, 41, 4);
if ( gBullets[id] >= 0 )
{
new count = --gBullets[id];
if ( 0 < count < 5 )
client_print(id, print_center, "Pozostalo ci %d Naboi", count);
}
}
W case itemu:
case Numer_itemu:
{
player_item_name[id] = "Long knife"
player_item_id[id] = rannum
gBullets[id] = 3
show_hudmessage (id, "Znalazles przedmiot : %s :: opis itemu ...",player_item_name[id])
}
W public fw_traceline dodaj:
if(player_item_id[id] != NUMER_Itemu || gBullets[id] < 0 )
return FMRES_IGNORED;
if( get_user_weapon(id) != CSW_KNIFE )
return FMRES_IGNORED;
static iMyAim[3], Float:flMyAim[3];
get_user_origin(id, iMyAim, 3);
IVecFVec(iMyAim, flMyAim);
set_tr(TR_vecEndPos, flMyAim);
static ent, body;
get_user_aiming(id, ent, body);
if( pev_valid(ent) )
{
set_tr(TR_flFraction, 0.1);
set_tr(TR_pHit, ent);
set_tr(TR_iHitgroup, body);
}
return FMRES_IGNORED
}
W public plugin_init dodaj:
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_knife", "Ham_Weapon_Attack");
RegisterHam(Ham_Weapon_SecondaryAttack, "weapon_knife", "Ham_Weapon_Attack");
#11
Napisano 24.05.2011 16:49
#12
Napisano 24.05.2011 17:13
#13
Napisano 24.05.2011 19:48
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych