Quote:
Originally Posted by DarkGod
switch_model(id)
{
if (!sh_is_active() || !is_user_alive(id) || !gHasBones[id] ) return
if (get_user_weapon(id) == CSW_GALIL)
if (get_user_weapon(id) == CSW_DEAGLE)
{
set_pev(id, pev_viewmodel2, gBonesGalil)
set_pev(id, pev_weaponmodel2, gBonesGalil2)
set_pev(id, pev_viewmodel2, gBonesDeagle)
set_pev(id, pev_weaponmodel2, gBonesDeagle2)
}
}
You can't have two weapons up at the same time. Use else if.
|
Quote:
Originally Posted by DarkGod
That's actually wrong. Right now it does this:
Code:
if(get_user_weapon(index) == CSW_GALIL) { if(get_user_weapon(index) == CSW_DEAGLE) { //Code } }
Anyways, the snippet you provided afterwards is correct.
|
I can't see an opening brace after the check for the galil weapon, so if user has galil, nothing happens. Or is there an automatically opening brace when you do an if condition? Not really sure about that, since using a return on the next line works. Weird, never though of that.
Quote:
Originally Posted by Fr33m@n
i'm talking about here : Jelly Art Exploited and so on.
I obviously know that switch is used a lot. But here...
|
MY NAME IS JELLE, NOT JELLY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!
Also, I do use switch, but only when there is more than two if conditions.
__________________