Raised This Month: $ Target: $400
 0% 

Placing Scope on All Weapons


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Rolnaaba
Veteran Member
Join Date: May 2006
Old 04-25-2007 , 10:07   Re: Placing Scope on All Weapons
Reply With Quote #5

Code:
/* Zoom type enum. Used for get/set_user_zoom() natives.
 */
enum
{
    CS_RESET_ZOOM = 0,        // Reset any zoom blocking (when using this type, mode has no effect)
    CS_SET_NO_ZOOM,            // Disable any sort of zoom (ie: to disable zoom in all weapons use this with mode=0)
    CS_SET_FIRST_ZOOM,        // Set first zoom (awp style) 
    CS_SET_SECOND_ZOOM,        // Set second zoom (awp style)
    CS_SET_AUGSG552_ZOOM,        // Set aug/sg552 zoom style
};
/* Sets a weapon zoom type on a player, any zoom type will work for all weapons, so you can even set an awp zoom to pistols :D
 * The 2nd param has to be one of the above zoom types in the enum. Mode can only be 0 or 1.
 * If mode=0 (blocking mode), the user will be forced to use the zoom type set by the native, and wont be able to change it (even by changing weapon)
 * until the native resets the zoom with CS_RESET_ZOOM.
 * If mode=1 the user will be able to restore back to a normal view by changing weapon.
 */
native cs_set_user_zoom(index, type, mode);
 
/* Returns how a user is zooming during the native call. Values correspond to the above enum, but will return 0 if an error occurred.
 */
native cs_get_user_zoom(index);
thanks VEN

Hows this look:
Code:
new curr_zoom = cs_get_user_zoom(id); switch(curr_zoom) {     case 0: return PLUGIN_HANDLED;     case CS_SET_NO_ZOOM: cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 1); //see excerpt from cstrike below for info on this native     case CS_SET_FIRST_ZOOM: cs_set_user_zoom(id, CS_SET_SECOND_ZOOM, 1);     case CS_SET_SECOND_ZOOM: cs_set_user_zoom(id, CS_SET_NO_ZOOM, 1);     default: return PLUGIN_HANDLED; }
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 04-25-2007 at 10:17.
Rolnaaba is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode