Page 1 of 1

Atvirksciai.

Posted: 2011 Feb 15 12:53
by zirualas
Kodel sis kodas veikia atvirskciai? Nusaunu Bota i kojas ar kur kitur, raso HS! nusaunu i galva raso Nebuvo HS

Code: Select all

/* Plugin generated by AMXX-Studio */ #include <amxmodx>#include <amxmisc> public plugin_init() {    register_plugin("Plugin", "1.0", "Zirual")        register_event("DeathMsg", "Death_Hook", "a")} public Death_Hook(){        new headshot    if(headshot == read_data(3))    {        client_print(0, print_chat, "Hs!")    }    else    {        client_print(0, print_chat, "Nebuvo Hs")    }}    

Re: Atvirksciai.

Posted: 2011 Feb 15 14:00
by newb
Reikia taip

Code: Select all

public Death_Hook() {    if(read_data(3) && !read_data(5)) {        client_print(0, print_chat, "Hs!")    }    else {        client_print(0, print_chat, "Nebuvo Hs")    }}
Nors ir nezinau ka daro tas read_data(5) ^^

Tavo klaida, kad tu sukuri vara headshot ir iskart tikrini ji ar jis lygus read_data(3). Del to kad tas varas iskarto bus lygus 0, tai ir iseina kad veikia atvirksciai.

Re: Atvirksciai.

Posted: 2011 Feb 15 14:10
by zirualas
Hmm, reikia issiaskinti ka daro tas read_data(5) ^^. Aciu :]

Re: Atvirksciai.

Posted: 2011 Feb 15 19:12
by aaarnas
Šiaip DeathMsg evente #5 data neegzistuoja, ar bent jau apie tokią aš nesu girdėjęs.
DeathMsg

Fired to all players (MSG_ALL or MSG_BROADCAST) to notify them of a death. This generates the HUD message the client sees in the upper right corner of their screen.
Also prints the console text message "KillerName killed VictimName with TruncatedWeaponName" or "*** KillerName killed VictimName with a headshot from TruncatedWeaponName ***"

Note: TruncatedWeaponName doesn't contain a "weapon_" prefix. See CS Weapons Information for more information.

Note: For grenade kill TruncatedWeaponName isn't "hegrenade" but "grenade", in fact it's an actual classname of a throwed grenade.

Note: For KillerID it's not necessarily should be a PlayerID, it could be 0 if player dies from fall/acid/radiation/fire/etc damage/lack of oxygen or from touch to a "trigger_hurt" entity, in this case TruncatedWeaponName will be "worldspawn" and "trigger_hurt" respectively.

Note: For vehicle kills TruncatedWeaponName could be "vehicle", "tank" et cetera.Name: DeathMsg
Structure:
byte KillerID
byte VictimID
byte IsHeadshot
string TruncatedWeaponName

Re: Atvirksciai.

Posted: 2011 Feb 15 19:19
by newb
Gal ir nera to #5, cia kazkada senai buvau padares, taip ir netikrinau ar yra ar nera, nes viskas tada veike xD

Re: Atvirksciai.

Posted: 2011 Feb 15 19:21
by aaarnas
Tikriausiai darydavai !read_data(5). tada veiks, nes visada 0 gražins.