AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Placing Scope on All Weapons (https://forums.alliedmods.net/showthread.php?t=54391)

Rolnaaba 04-24-2007 12:05

Placing Scope on All Weapons
 
What is a good way of doing this?

pRED* 04-24-2007 18:11

Re: Placing Scope on All Weapons
 
which mod?

for cs..

Rolnaaba 04-25-2007 08:14

Re: Placing Scope on All Weapons
 
CS, and I cant go to amxmodx.org, school blocks

VEN 04-25-2007 09:07

Re: Placing Scope on All Weapons
 
http://svn.tcwonline.org/viewvc.cgi/...xmodx&view=log

Rolnaaba 04-25-2007 10:07

Re: Placing Scope on All Weapons
 
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; }


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

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