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.
|
Hunter crossbow
#1
Napisano 27.04.2009 04:37
Any help, i appreciate it =).
#2
Napisano 27.04.2009 10:36
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 } ?
#3
Napisano 07.05.2009 20:44
#4
Napisano 07.05.2009 20:49
#5
Napisano 07.05.2009 21:09
#6
Napisano 07.05.2009 21:16
#7
Napisano 07.05.2009 21:20
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 }
#8
Napisano 07.05.2009 21:34
did you registed this in plugin_init?
#9
Napisano 07.05.2009 21:38
#10
Napisano 07.05.2009 21:40
#11
Napisano 07.05.2009 21:57
#12
Napisano 07.05.2009 23:08
if( fPunchAngle[0] == -5)
So you have to be palladyn for it and if you are pallandyn you don't have a xbow and so on ;>
#13
Napisano 08.05.2009 02:26
#14
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 }
#15
Napisano 08.05.2009 19:58
#16
Napisano 08.05.2009 20:33
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.
#17
Napisano 08.05.2009 20:39
Just found it, yes its declaired twice, should i delete one?
#18
Napisano 08.05.2009 20:51
#19
Napisano 08.05.2009 20:53
#20
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 ;-)
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych