Hunter crossbow
supertaranta
27.04.2009
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 =).
Any help, i appreciate it =).
mgr inż. Pavulon
27.04.2009
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:
And you want to set a HUD message { http://amxx.pl/viewtopic.php?t=6738 } ?
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 } ?
supertaranta
07.05.2009
Well on right click the crossbow is reloading instead of using a scope.
supertaranta
07.05.2009
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 }
supertaranta
07.05.2009
No i did not. wow, what would it be registered as? like register"blank" forward_pm_playerfrethink
Miczu
07.05.2009
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 and if you are pallandyn you don't have a xbow and so on ;>
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 ;>
supertaranta
08.05.2009
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?
Miczu
08.05.2009
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 }
supertaranta
08.05.2009
just tested it a few times and still doesnt work =/. Could it be a model problem?
Miczu
08.05.2009
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.
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.
supertaranta
08.05.2009
Yes the long jump does not work =/ just tested it.
Just found it, yes its declaired twice, should i delete one?
Just found it, yes its declaired twice, should i delete one?
supertaranta
08.05.2009
k, the paladin jumps work, but the hunter still reloads the crossbow on right click.
Miczu
08.05.2009
{ 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 ;-)