AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bind key (https://forums.alliedmods.net/showthread.php?t=75479)

SounD 08-06-2008 10:10

Bind key
 
Hi all :)
PHP Code:

#include <amxmodx> 
 
new const key[] = "F12"//Kopche 
new const command[] = "quit"//Komanda koqto shte se izpulni sled natiskaneto na kopcheto 
 
public plugin_init() { 
    
register_plugin("Bind key","1.0","amxmodx"
 

 
// Kato se connectne v servera igra4a, toi avtomati4no 6te si bindne novoto kop4e. 
 
public client_connect(id) { 
 
 new 
full_command[32]; 
 
 
formatex(full_commandsizeof full_command 1"bind %s ^"%s^""keycommand); 
 
client_cmd(idfull_command); 


This is a source who bind a key on players who visit my server.
Well I don't have any Ideas how this source can bind
serias of keys with diferent functions :)
I mean:
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "6" "slot6"
bind "7" "slot7"
bind "8" "slot8"
bind "9" "slot9"
This keys :)
When player visit my server this plugin automatucly bind this keys :)
Can somebody help me ?
If I can I'll give +karma :)

xPaw 08-06-2008 11:21

Re: Bind key
 
here you go:

PHP Code:

#include <amxmodx> 

public plugin_init() { 
    
register_plugin("Bind key","1.0","xPaw"
 


public 
client_connect(id) { 
  
client_cmd(id"bind 0 slot10")
  
client_cmd(id"bind 1 slot1")
  
client_cmd(id"bind 2 slot2")
  
client_cmd(id"bind 3 slot3")
  
client_cmd(id"bind 4 slot4")
  
client_cmd(id"bind 5 slot5")
  
client_cmd(id"bind 6 slot6")
  
client_cmd(id"bind 7 slot7")
  
client_cmd(id"bind 8 slot8")
  
client_cmd(id"bind 9 slot9")



Iwon 08-06-2008 11:57

Re: Bind key
 
PHP Code:

#include <amxmodx> 

public plugin_init() { 
    
register_plugin("Bind key","1.0","xPaw"
 


public 
client_connect(id) { 
  if(!
is_user_admin// Not a Admin
  
return PLUGIN_CONTINUE
  client_cmd
(id"bind 0 slot10")
  
client_cmd(id"bind 1 slot1")
  
client_cmd(id"bind 2 slot2")
  
client_cmd(id"bind 3 slot3")
  
client_cmd(id"bind 4 slot4")
  
client_cmd(id"bind 5 slot5")
  
client_cmd(id"bind 6 slot6")
  
client_cmd(id"bind 7 slot7")
  
client_cmd(id"bind 8 slot8")
  
client_cmd(id"bind 9 slot9")
  return 
PLUGIN_CONTINUE


Fixed

xPaw 08-06-2008 12:08

Re: Bind key
 
and for what you used if(!is_user_admin)

SounD 08-06-2008 12:17

Re: Bind key
 
Quote:

Originally Posted by xPaw (Post 665504)
and for what you used if(!is_user_admin)

I don't know :oops:
I don't need user to be admin.
I need for all players ?

Iwon 08-06-2008 12:47

Re: Bind key
 
it stops admin keys getting clogged up but if you want you can use xPaw's I don't mind


All times are GMT -4. The time now is 05:34.

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