Page 1 of 1

Elektrosoko efektas.

Posted: 2012 Apr 03 06:50
by xDede
Sveiki taigi turiu toki efekta,

Code: Select all

public event_Damage(id) {  if(get_cvar_num(CVAR_STATUS) <= 0   || !is_user_connected(id)   || !is_user_alive(id)  || is_user_bot(id)) return;  new iWeapID, attacker = get_user_attacker(id , iWeapID);  if(!is_user_connected(attacker)) return;  if(iWeapID == CSW_KNIFE) {    new Float:fVec[3];    fVec[0] = random_float(PA_LOW , PA_HIGH);    fVec[1] = random_float(PA_LOW , PA_HIGH);    fVec[2] = random_float(PA_LOW , PA_HIGH);    entity_set_vector(id , EV_VEC_punchangle , fVec);    message_begin(MSG_ONE , gMsgScreenShake , {0,0,0} ,id)    write_short( 1<<14);    write_short( 1<<14 );    write_short( 1<<14 );    message_end();      fVec[0] = random_float(PAC_LOW , PAC_HIGH);    fVec[1] = random_float(PAC_LOW , PAC_HIGH);    fVec[2] = random_float(PAC_LOW , PAC_HIGH);    entity_set_vector(id , EV_VEC_punchangle , fVec);    message_begin(MSG_ONE_UNRELIABLE , gMsgScreenFade , {0,0,0} , id);    write_short( 1<<10 );    write_short( 1<<10 );    write_short( 1<<12 );    write_byte( 0 );    write_byte( 0 );    write_byte( 180 );    write_byte( 128 );    message_end();  }}
Ir man reike kad tas efektas veiktu tik nuo to zaidejo kuris
Paraso tarkim say /sokas.

Tarkim visi su knife pjausto kaip ir seniau bet zaidejas parases
say /sokas i concole ir ipjoves kamnors, tas zaidejas kuriam ipjoves
Pajaus sita efecta.

Galit padet?

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 09:56
by Pukuotukas951
Čia tas efektas, kai tau kerta iš elektro šoko, vaizas pasidaro mėlynas ir dreba vaizdas?

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 10:18
by InvIs

Code: Select all

 new shock[33]public plugin_init(){register_clcmd("say /sokas", "sokas")}sokas(id){ shock[id] = !shock[id]}public event_Damage(id) {  if(get_cvar_num(CVAR_STATUS) <= 0   || !is_user_connected(id)   || !is_user_alive(id)  || is_user_bot(id)  || shock[id] != true) return;  new iWeapID, attacker = get_user_attacker(id , iWeapID);  if(!is_user_connected(attacker)) return;  if(iWeapID == CSW_KNIFE) {    new Float:fVec[3];    fVec[0] = random_float(PA_LOW , PA_HIGH);    fVec[1] = random_float(PA_LOW , PA_HIGH);    fVec[2] = random_float(PA_LOW , PA_HIGH);    entity_set_vector(id , EV_VEC_punchangle , fVec);    message_begin(MSG_ONE , gMsgScreenShake , {0,0,0} ,id)    write_short( 1<<14);    write_short( 1<<14 );    write_short( 1<<14 );    message_end();      fVec[0] = random_float(PAC_LOW , PAC_HIGH);    fVec[1] = random_float(PAC_LOW , PAC_HIGH);    fVec[2] = random_float(PAC_LOW , PAC_HIGH);    entity_set_vector(id , EV_VEC_punchangle , fVec);    message_begin(MSG_ONE_UNRELIABLE , gMsgScreenFade , {0,0,0} , id);    write_short( 1<<10 );    write_short( 1<<10 );    write_short( 1<<12 );    write_byte( 0 );    write_byte( 0 );    write_byte( 180 );    write_byte( 128 );    message_end();  }}
Turbūt taip

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 10:46
by Pukuotukas951
o kaip šitą efektą įdėti į šį koda:

Code: Select all

public FwdTakeDamage(victim, inflictor, attacker, Float:damage, damage_bits){    if (is_valid_player(attacker) && get_user_weapon(attacker) == CSW_KNIFE)        {        switch(get_user_team(attacker))        {            case 1:            {                           }            case 2:            {                if(CTCuchillo[attacker])                {                        SetHamParamFloat(4, get_pcvar_float(CTDefaultDano))                                                if(get_pdata_int(victim, 75) == HIT_HEAD)                    {                        SetHamParamFloat(4, get_pcvar_float(hCTDefaultDano))                    }                }            }        }    }    return HAM_HANDLED} 

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 18:10
by xDede
Yra klaidu compiluojant!

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 18:20
by psychical
xDede wrote:Yra klaidu compiluojant!
Rašyk kokių

-- 2012 Bal 03 18:29 --

P.S. Nerašyk, kodas kreivas...

-- 2012 Bal 03 18:38 --

Kažkas tokio, nežinau dėl include

Code: Select all

#include <amxmodx>#include <engine>#include <hamsandwich> #define PA_LOW          20.0#define PA_HIGH         80.0#define PAC_LOW         25.0#define PAC_HIGH        45.0 new shock[33]; public plugin_init(){    register_plugin("Pluginas #1", "1.0.0", "REZ.LT");        register_clcmd("say /sokas", "sokas");        RegisterHam(Ham_TakeDamage, "player", "hook_TakeDamage");} public sokas(id){    shock[id] = !shock[id];} public hook_TakeDamage(victim, useless, attacker, float:damage, damagebits) {    if(!is_user_connected(attacker) || !is_user_alive(victim) || !shock[attacker])        return HAM_IGNORED;        new weapon = get_user_weapon(attacker, _, _);        if(weapon == CSW_KNIFE)    {        new Float:fVec[3];        fVec[0] = random_float(PA_LOW , PA_HIGH);        fVec[1] = random_float(PA_LOW , PA_HIGH);        fVec[2] = random_float(PA_LOW , PA_HIGH);        entity_set_vector(victim , EV_VEC_punchangle , fVec);        message_begin(MSG_ONE, get_user_msgid("ScreenShake"), {0, 0, 0},victim)        write_short( 1<<14 );        write_short( 1<<14 );        write_short( 1<<14 );        message_end();         fVec[0] = random_float(PAC_LOW , PAC_HIGH);        fVec[1] = random_float(PAC_LOW , PAC_HIGH);        fVec[2] = random_float(PAC_LOW , PAC_HIGH);        entity_set_vector(victim , EV_VEC_punchangle , fVec);        message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("ScreenFade"), {0,0,0} , victim);        write_short( 1<<10 );        write_short( 1<<10 );        write_short( 1<<12 );        write_byte( 0 );        write_byte( 0 );        write_byte( 180 );        write_byte( 128 );        message_end();    }       return HAM_IGNORED;}

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 21:06
by xDede
Turiu dar vien klausima, kaip padaryti kad tas efektas isijungtu kito roundo pradzioi, kol vel parasai say /sokas

Re: Elektrosoko efektas.

Posted: 2012 Apr 03 21:16
by psychical
xDede wrote:Turiu dar vien klausima, kaip padaryti kad tas efektas isijungtu kito roundo pradzioi, kol vel parasai say /sokas
Dabar padaryta, kad tik parašius /sokas jis įsijungs/išsijungs, o kad išsijungtų kai atsirandi naudok

Code: Select all

RegisterHam(Ham_Spawn, "player", "OnSpawn", 1);

Code: Select all

 public OnSpawn(id){    if(shock[id]) shock[id] = 0;}