AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Menu keys for sg550 & g3sg1 (https://forums.alliedmods.net/showthread.php?t=2201)

NiLuJe 05-29-2004 07:53

Menu keys for sg550 & g3sg1
 
Hello ;) I'm trying to modify the awp limiter plugin, so it can also limits the auto snipers, everything is working, except that i don't know the keys for these weapons in the menu ...

Here is the key for the AWP...
Code:
register_menucmd(-31,1<<5,"menu_sl_awp")

BigBaller 05-29-2004 10:44

Yes that would be good for me to know also so I can restrict them :D

NiLuJe 05-29-2004 10:59

Yeah i'm not alone :D

NiLuJe 05-31-2004 14:12

Hu, damn 1.6, they are changing depending on the team :/

CT :

AWP : 1<<5
SG550 : 1<<4
G3SG1 : Doesn't exist xD [ 1<<-1 }

T :

AWP : 1<<4
SG550 : Doesn't exist xD [ 1<<-1 }
G2SG1 : 1<<5

... Now i must find a way to make them change depending of the team in my register_menucmd .. Oo Any Idea?

PM 05-31-2004 14:18

logical flow:
1<<-1 = 1>> 1 = 0 :D

NiLuJe 05-31-2004 14:24

Hu ? Need an explanation Oo

PM 05-31-2004 16:08

You said
1<<-1
<< is the bit shift left operator
so when you pass it a negative value, it should logically shift right :D
=> 1<<-1 = 1>>1
but 1>>1 in binary: 00000001>>1
Because the left bits are filled with 0 when shifting right, 1>>1 will be 0 :D

Idea:
Register both of them and decide when the public is run

NiLuJe 05-31-2004 16:21

Ahhhh, okay ;)

EDIT: Got It ;)

Code:

  new team = get_user_team(id)
 
  if((team == 2 && key==5) || (team == 1 && key==4)) {
  //etc
  }

And the registers:
Code:

    register_menucmd(-31,(1<<4),"menu_sl_snip")
    register_menucmd(-31,(1<<5),"menu_sl_snip")
    register_menucmd(register_menuid("BuyRifle" , 1 ), (1<<4), "menu_sl_snip" )
    register_menucmd(register_menuid("BuyRifle" , 1 ), (1<<5), "menu_sl_snip" )

:)


All times are GMT -4. The time now is 07:02.

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