View Single Post
Calystos
Member
Join Date: Jan 2011
Location: Terra
Old 05-28-2012 , 06:04   Re: [ANY] Binoculars
Reply With Quote #10

This won't work on Nuclear Dawn as there is no "weapon_zoom" event to hook into (though it does exist in the "nucleardawn/modevents.res" file, under "cstrikeevents" list, but not in the "nucleardawn/resource/ModEvents.res"). Though there are of course some sorta event along that path since there are sniper scope weapons ingame (ironsights I think). Not sure what its alternate name is on ND. Am looking into it when I get a bit more time though, less someone beats me to it, ;)

EDIT: Long as the weapon_zoom hook is ignored/disabled this does work on ND, Though it does ignore the binoculars/attack ignore setting (it spams chat with you can't attack messages but still shoots).

Quick hack attached for ND users, will ignore weapon_zoom event hook. Its a dirty hack but least it works on ND,
Oh an all I did was change the hook line to the following:
Code:
    new String:modname[30];
    GetGameFolderName(modname, sizeof(modname));
    if (!StrEqual(modname, "nucleardawn", false))
    {
         HookEvent("weapon_zoom", EventWeaponZoom);
    }
EDIT: Found another glitch, when (in ND this obviously) you right-click to use normal weapons zoom scope (if it has one) and shoot, it spams chat with you can't attack while using binoculars text too. Am guessing it'll be sorted if we can find out what ND uses instead of "weapon_zoom" as the event name.

EDIT: Just had the same problem of no "weapon_zoom" in TF2 also btw.
Attached Files
File Type: sp Get Plugin or Get Source (binoculars.sp - 1026 views - 3.0 KB)

Last edited by Calystos; 05-28-2012 at 07:32.
Calystos is offline
Send a message via ICQ to Calystos Send a message via AIM to Calystos Send a message via MSN to Calystos Send a message via Yahoo to Calystos Send a message via Skype™ to Calystos