Raised This Month: $32 Target: $400
 8% 

can someone teach me how to bind a key on to the scripting


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-][HerO][-BoOmBoOm
BANNED
Join Date: Mar 2006
Old 04-01-2006 , 15:23   can someone teach me how to bind a key on to the scripting
Reply With Quote #1

i need teaching on how to bind the scripting key plz like bind_<name> i need teaching can someone teach me and only reply if ur gonna teach me thx like exampe this is the one i got of silversurfer

Code:
ublic plugin_init()
{
  // Plugin Info
  register_plugin("SUPERHERO SilverSurfer","1.14.4","Necroscope")
  
  // Fire the Event to Create This SuperHero
  if ( isDebugOn() ) server_print("Attempting to create Silver Surfer Hero")
  register_cvar("surfer_level", "10" )
  shCreateHero(gHeroName, "Cosmic Powers", "Endless Noclip, Hold Power Key Down", true, "surfer_level" )
  
  // Register Events This Hero Will Respond To! (And Server Commands)
  register_event("ResetHUD","newRound","b")
  register_srvcmd("surfer_init","surfer_init")
  shRegHeroInit(gHeroName, "surfer_init")
  
  // Key Down
  register_srvcmd("surfer_kd", "surfer_kd")
  shRegKeyDown(gHeroName, "surfer_kd")
  
  // Key Up
  register_srvcmd("surfer_ku", "surfer_ku")
  shRegKeyUp(gHeroName, "surfer_ku")
  
  // Death
  register_event("DeathMsg", "surfer_death", "a")
  
  // Default CVARS
  register_cvar("surfer_speed", "500" )
}
//-------------------------------------------------------------------------------------------------------
public surfer_init()
{
  new temp[6]
  //First Argument is an id
  read_argv(1,temp,5)
  new id=str_to_num(temp)
  
  //2nd Argument is 0 or 1 depending on whether the id has Surfer Powers
  read_argv(2,temp,5)
  new hasPowers=str_to_num(temp)
  
  if ( !hasPowers )
  {
    if ( is_user_alive(id) && gHasSurferPower )
    {
      set_user_noclip(id,0)
    }
  }
  gHasSurferPower[id]=(hasPowers!=0)
}
//-------------------------------------------------------------------------------------------------------
public newRound(id)
{
  if (is_user_alive(id) && get_user_noclip(id) ) set_user_noclip(id,0)
  return PLUGIN_HANDLED
}
//-------------------------------------------------------------------------------------------------------
public surfer_kd()
{
  new temp[6]
  //First Argument is an id
  read_argv(1,temp,5)
  new id=str_to_num(temp)
  
  set_user_noclip(id,1)
  shSetMaxSpeed(gHeroName, "surfer_speed", "[0]" )
  set_user_rendering(id,kRenderFxGlowShell,200,200,200,kRenderTransAlpha,64)
  
  // Surfer Message 
  new message[128]
  format(message, 127, "Entered Silver Surfer Mode - Don't get Stuck or you will die" )
  set_hudmessage(200,200,200,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)
  show_hudmessage(id, message)
    
  return PLUGIN_HANDLED
}
//-------------------------------------------------------------------------------------------------------
public surfer_ku()
{
  new temp[6]
  //First Argument is an id
  read_argv(1,temp,5)
  new id=str_to_num(temp)
  
  if ( get_user_noclip(id) == 1)
  
  set_user_noclip(id,0)
  shRemSpeedPower(id)
  set_user_rendering(id)
  
  // Surfer Message 
  new message[128]
  format(message, 127, "Silver Surfer Mode Now Over" )
  set_hudmessage(200,200,200,-1.0,0.3,0,0.25,1.0,0.0,0.0,4)
  show_hudmessage(id, message)
    
  return PLUGIN_HANDLED
}
//-------------------------------------------------------------------------------------------------------
public surfer_death()
{
  new id=read_data(2)
  set_user_noclip(id,0)
  shRemSpeedPower(id)
}
//-------------------------------------------------------------------------------------------------------
plz teach me



-][HerO][-BoOmBoOm
-][HerO][-BoOmBoOm is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 04-02-2006 , 20:53  
Reply With Quote #2

woot u talking about scripting key o.O. yes i am back from back collapse o.O kakaka
__________________
yang is offline
Send a message via AIM to yang
-][HerO][-BoOmBoOm
BANNED
Join Date: Mar 2006
Old 04-03-2006 , 05:17   can u teach me plzz
Reply With Quote #3

can u teach me plzz how to script a key to a hero
-][HerO][-BoOmBoOm is offline
DFG
Member
Join Date: Jan 2006
Old 04-03-2006 , 05:35   Re: can u teach me plzz
Reply With Quote #4

cmon look at the code
__________________
bla bla bla
DFG is offline
-][HerO][-BoOmBoOm
BANNED
Join Date: Mar 2006
Old 04-03-2006 , 09:04   what code where ?w
Reply With Quote #5

what code where DFG do you even now how to script
-][HerO][-BoOmBoOm is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 04-03-2006 , 23:35  
Reply With Quote #6

use register_concmd("+key","go-to-code");

public go-to-code()
{
//code
}

etc

then to execute that to a bind would b "bind key +key"
blah blah
__________________
yang is offline
Send a message via AIM to yang
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 04-04-2006 , 01:23  
Reply With Quote #7

Quote:
Originally Posted by yang
use register_concmd("+key","go-to-code");

public go-to-code()
{
//code
}

etc

then to execute that to a bind would b "bind key +key"
blah blah
i think he means keyup and keydown ;]
Freecode is offline
-][HerO][-BoOmBoOm
BANNED
Join Date: Mar 2006
Old 04-04-2006 , 04:25  
Reply With Quote #8

how do i do this then where do i put it :Confused:

[offtopic]
Quote:
DFG
Inbox :: Message
From: DFG
To: -][HerO][-BoOmBoOm
Posted: Tue Apr 04, 2006 6:04 am
Subject: script Quote message
i code heroes for myself
1.I can code
2.I can make avatars and signatures
3.I know html php

i know lots of things
but im sometimes bored to do them
come on then DFG tell me and i can't send pm no more[/offtopic]
-][HerO][-BoOmBoOm is offline
DFG
Member
Join Date: Jan 2006
Old 04-04-2006 , 06:13  
Reply With Quote #9

Why cant you send pm

p.s im working on my site no time to code srry
__________________
bla bla bla
DFG is offline
-][HerO][-BoOmBoOm
BANNED
Join Date: Mar 2006
Old 04-04-2006 , 07:11  
Reply With Quote #10

Ok when your don't with yours can you teach me how to bind keys plz

[offtopic] this is why Sorry, but the administrator has prevented you from sending private messages. [offtopic]
-][HerO][-BoOmBoOm is offline
Reply


Thread Tools
Display Modes

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 03:30.


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