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
 

Zdjęcie

Hunter crossbow


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
22 odpowiedzi w tym temacie

#1 supertaranta

    Pomocny

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 27.04.2009 04:37

How can i make the right click of the crossbow to be zoom in, like the fov i understand but where would i place this and what would be the code for this?, and how can i add a message that displays when reloading "You are reloading", untill its finished reloading


Any help, i appreciate it =).
  • +
  • -
  • 0

#2 mgr inż. Pavulon

    C35H60Br2N2O4

  • Przyjaciel

Reputacja: 1 742
Godlike

  • Postów:6 881
  • Steam:steam
  • Imię:Konrad
  • Lokalizacja:Koniecpol
Offline

Napisano 27.04.2009 10:36

Maybe this could help:
First you must declare a new global variable, for example new bool:player_zoom[32]
Next somewhere in Forward_FM_PlayerPreThink(id) {?} add something like this:

if (pev(id, pev_oldbuttons)&IN_ATTACK2 && !(pev(id, pev_button) & IN_ATTACK2))
{
    if (player_zoom[id])
    {
        set_pev(id, pev_fov, 90.0)
        player_zoom[id] = false
    }
    else
    {
        set_pev(id, pev_fov, 10.0) //float value
        player_zoom[id] = true
    }
}


And you want to set a HUD message { http://amxx.pl/viewtopic.php?t=6738 } ?
  • +
  • -
  • 0

#3 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 07.05.2009 20:44

Alright well i did this and the action is still reloading =/.
  • +
  • -
  • 0

#4 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.05.2009 20:49

What do you mean by that?
  • +
  • -
  • 0

#5 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 07.05.2009 21:09

Well on right click the crossbow is reloading instead of using a scope.
  • +
  • -
  • 0

#6 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.05.2009 21:16

And where did you put the code (give whole function with it).
  • +
  • -
  • 0

#7 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 07.05.2009 21:20

this is what i have.

public Forward_FM_PlayerPreThink(id)
{
    static Float:fPunchAngle[3]
    pev(id, pev_punchangle, fPunchAngle)
    if( fPunchAngle[0] == -5)
    {
    	if(fm_get_user_longjump(id) && JumpsLeft[id]>0)JumpsLeft[id]--
	
	write_hud(id)
	
	if(JumpsLeft[id]<1) fm_set_user_longjump(id,false,true)

	if (pev(id, pev_oldbuttons)&IN_ATTACK2 && !(pev(id, pev_button) & 	IN_ATTACK2)) 
	{ 
    if (player_zoom[id]) 
    { 
        set_pev(id, pev_fov, 90.0) 
        player_zoom[id] = false 
    } 
    else 
    { 
        set_pev(id, pev_fov, 10.0) //float value 
        player_zoom[id] = true 
    } 
}
        return FMRES_HANDLED

    }
    return FMRES_IGNORED

}

  • +
  • -
  • 0

#8 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.05.2009 21:34

Forward_FM_PlayerPreThink(id)

did you registed this in plugin_init?
  • +
  • -
  • 0

#9 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 07.05.2009 21:38

No i did not. wow, what would it be registered as? like register"blank" forward_pm_playerfrethink
  • +
  • -
  • 0

#10 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.05.2009 21:40

register_forward(FM_PlayerPreThink,"Forward_FM_PlayerPreThink")
  • +
  • -
  • 0

#11 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 07.05.2009 21:57

Alright yea, still doesnt work =/.
  • +
  • -
  • 0

#12 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 07.05.2009 23:08

supertaranta, you added Pavulon code in worn way, it will work only if
if( fPunchAngle[0] == -5)

So you have to be palladyn for it :D and if you are pallandyn you don't have a xbow and so on ;>
  • +
  • -
  • 0

#13 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 08.05.2009 02:26

So how do i define it for a hunter then? do i place it somewhere else or do i have to do an if function for a hunter? If the if function what would that be?
  • +
  • -
  • 0

#14 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 08.05.2009 08:51

public Forward_FM_PlayerPreThink(id)

{ 

	static Float:fPunchAngle[3] 

	pev(id, pev_punchangle, fPunchAngle) 

	if( fPunchAngle[0] == -5) 

	{ 

		if(fm_get_user_longjump(id) && JumpsLeft[id]>0) JumpsLeft[id]-- 

		

		write_hud(id) 

		return FMRES_HANDLED 

		

	}

	if(bow[id])

	{		

		if (pev(id, pev_oldbuttons)&IN_ATTACK2 && !(pev(id, pev_button) & IN_ATTACK2)) 

		{ 

			if (player_zoom[id]) 

			{ 

				set_pev(id, pev_fov, 90.0) 

				player_zoom[id] = false 

			} 

			else 

			{ 

				set_pev(id, pev_fov, 10.0) //float value 

				player_zoom[id] = true 

			} 

			return FMRES_HANDLED 

		} 

	}

	return FMRES_IGNORED 

}

  • +
  • -
  • 0

#15 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 08.05.2009 19:58

just tested it a few times and still doesnt work =/. Could it be a model problem?
  • +
  • -
  • 0

#16 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 08.05.2009 20:33

Hmm... in the worst case is it possible (whe paladyn code could be a hint here) that register_forward(FM_PlayerPreThink,"Forward_FM_PlayerPreThink") is arledy declareted (twise)?

IF so, it could be called twice and the 1 time is in zoom and the secound it is back to normal (zoom never work). Try use the paladin Long Jump if it's counted twise for jump, then that's the problem.
  • +
  • -
  • 0

#17 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 08.05.2009 20:39

Yes the long jump does not work =/ just tested it.

Just found it, yes its declaired twice, should i delete one?
  • +
  • -
  • 0

#18 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 08.05.2009 20:51

Yes delate one, and say how it work now...
  • +
  • -
  • 0

#19 supertaranta

    Pomocny

  • Autor tematu
  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
Offline

Napisano 08.05.2009 20:53

k, the paladin jumps work, but the hunter still reloads the crossbow on right click.
  • +
  • -
  • 0

#20 Miczu

    Godlike

  • Przyjaciel

Reputacja: 657
Wszechmogący

  • Postów:2 862
Offline

Napisano 08.05.2009 21:07

{ 
    static Float:fPunchAngle[3] 
    pev(id, pev_punchangle, fPunchAngle) 
    if( fPunchAngle[0] == -5) 
    { 
        if(fm_get_user_longjump(id) && JumpsLeft[id]>0) JumpsLeft[id]-- 
        
        write_hud(id) 
        return FMRES_HANDLED 
        
    } 
    if(bow[id]) 
    {        
        if (pev(id, pev_oldbuttons)&IN_ATTACK2 && !(pev(id, pev_button) & IN_ATTACK2)) 
        { 
            if (player_zoom[id]) 
            { 
                message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
                write_byte(90)
                message_end()
                player_zoom[id] = false 
            } 
            else 
            { 
                message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
                write_byte(10)
                message_end()
                player_zoom[id] = true 
            } 
            return FMRES_HANDLED 
        } 
    } 
    return FMRES_IGNORED 
}

The code provided by Pavulon wasn't as good as I thought ;-)
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych