Raised This Month: $12 Target: $400
 3% 

Speed for just 1 weapon (1.2)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 08-20-2008 , 11:12   Speed for just 1 weapon (1.2)
Reply With Quote #1

Hi i was looking at the flash hero for 1.2 and i wonder how can i make so it is only for 1 weapon?(speed of course)
Code:
// FLASH! - Run Faster

/* CVARS - copy and paste to shconfig.cfg

//Flash
flash_level 0
flash_speed 350        //the speed flash can run

*/

#include <superheromod>

//----------------------------------------------------------------------------------------------
public plugin_init()
{
    // Plugin Info
    register_plugin("SUPERHERO Flash", SH_VERSION_STR, "{HOJ} Batman")

    // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    new pcvarLevel = register_cvar("flash_level", "0")
    new pcvarSpeed = register_cvar("flash_speed", "350")

    // FIRE THE EVENTS TO CREATE THIS SUPERHERO!
    new heroID = sh_create_hero("Flash", pcvarLevel)
    sh_set_hero_info(heroID, "Super Speed", "You will run much faster with this hero")
    sh_set_hero_speed(heroID, pcvarSpeed)
}
//----------------------------------------------------------------------------------------------
micke1101 is offline
FukfaCe
Member
Join Date: Apr 2006
Old 08-20-2008 , 12:36   Re: Speed for just 1 weapon (1.2)
Reply With Quote #2

This is made by a generator (written in code), this one is for just m4a1. The name and so on you can change to your likings. Enjoy.

EDIT: lol that was your own hero creator. Why not just use that?
Attached Files
File Type: sma Get Plugin or Get Source (sh_flash.sma - 901 views - 1.0 KB)
__________________
Jelles legeplads (DK) sh server (mine)

FukfaCe is offline
Send a message via MSN to FukfaCe
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 08-20-2008 , 13:15   Re: Speed for just 1 weapon (1.2)
Reply With Quote #3

Well cause i didnt want it to 1.18 i want it to 1.2 and i need it for my generator
micke1101 is offline
yang
Veteran Member
Join Date: May 2005
Location: galoreservers.net
Old 08-20-2008 , 13:53   Re: Speed for just 1 weapon (1.2)
Reply With Quote #4

/**
* Sets hero's max speed.
* Weapons is an array of weapons this speed is good for
* Check CSW_ constants for weapon values
* {0} would equal all weapons
* {29, 30} would equal the CSW_ weapon constants corresponding to 29, 30 etc.
*
* @note Max possible running speed is 2000, limited by half-life.
*
* @param heroID The index of the hero.
* @param pcvarSpeed The pcvar value for maximum Speed cvar for the hero.
* @param weapons The array of CSW_ constants for weapon values to set speed for, 0 is for all weapons.
* @param numofwpns The size of the array, must be passed in correctly!
* @noreturn
*/
native sh_set_hero_speed(heroID, pcvarSpeed, const weapons[] = {0}, numofwpns = 1);

look in the superheromod.inc
__________________
yang is offline
Send a message via AIM to yang
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 08-20-2008 , 13:58   Re: Speed for just 1 weapon (1.2)
Reply With Quote #5

Thank you!
micke1101 is offline
vittu
SuperHero Moderator
Join Date: Oct 2004
Location: L.A. County, CA
Old 08-20-2008 , 16:58   Re: Speed for just 1 weapon (1.2)
Reply With Quote #6

micke1101, things should be easier to code with 1.2. I've also made lots of comments in the include, you should check there first if you have questions about how or what you can do.


FukfaCe, if you are going to give info like that or like the other post please don't post in this section of the forums at all.
vittu is offline
Send a message via AIM to vittu Send a message via MSN to vittu Send a message via Yahoo to vittu
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 08-20-2008 , 18:27   Re: Speed for just 1 weapon (1.2)
Reply With Quote #7

Good to know (i maybe should start check those inc)
micke1101 is offline
Atspulgs
Senior Member
Join Date: Mar 2008
Old 08-20-2008 , 23:05   Re: Speed for just 1 weapon (1.2)
Reply With Quote #8

that is true it looks more easier. Grate job. This change is already highly appreciated.
__________________
-=DG Ats
DoomedGang web page -
http://www.doomedgang.com
Atspulgs is offline
Reply



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 05:49.


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