PDA

View Full Version : Special Powers


123
12-29-2004, 14:16
Is it possible to make a hero that gives special powers, to players with special names ???
Example:
My nick is 123 and then flash gives me extra damage, and my friends name is Kurt then it gives him a free mp5.

Is that possible ?

jtp10181
12-29-2004, 19:00
sure....

123
12-29-2004, 19:43
Well how do you do it then ?

jtp10181
12-29-2004, 21:43
check peoples names and do whatever you want

123
12-30-2004, 19:34
Can you give me an example ?
If not that good a scripter

jtp10181
12-30-2004, 19:50
get_user_name

123
12-30-2004, 19:53
can I then do this:

if (get_user_name = 123) {special powers}
else{normal powers}

- Can I do that ?

jtp10181
12-30-2004, 19:55
no.... look at other plugins, look at the includes. learn how to code.

123
12-31-2004, 08:09
Okay i'll do that...
But I can't find a place where it finds the players level...
Can I use get_user_level ?

jtp10181
12-31-2004, 08:12
bomberman....

you have to register a function with the core and thewn it will tell your plugin what level a player is when it changes.

123
12-31-2004, 10:17
I can't figure out what to use.
But I think this is it:

// GLOBAL VARIABLES
new gPlayerLevels[SH_MAXSLOTS+1]

//----------------------------------------------------------------------------------------------

public bomberman_levels()
{
new id[5]
new lev[5]

read_argv(1,id,4)
read_argv(2,lev,4)

gPlayerLevels[str_to_num(id)]=str_to_num(lev)
}

Then in my wolverine.sma I set this in:


// LEVELS
register_srvcmd("wolverine_levels", "wolverine_levels")
shRegLevels(gHeroName,"wolverine_levels")

//----------------------------------------------------------------------------------------------
public wolverine_levels()
{
new id[5]
new lev[5]

read_argv(1,id,4)
read_argv(2,lev,4)

gPlayerLevels[str_to_num(id)]=str_to_num(lev)
//----------------------------------------------------------------------------------------------
register_cvar("wolv_healpoints", "gPlayerLevels[id]" )

Is this the right thing to do ?

Im trying to make my wolverines healpoints the same as the default players level.

-Also I want to make my poison ivy's damage the same as the players level.

123
01-03-2005, 16:12
Can anyone help me make these codes ?

1. Special Powers if the name is '123'

2. The code that gets players levels

Berusadeankan
01-05-2005, 00:39
wouldent it look like this?
Get_user_name = variabel
----------------------------------
if (variabel = 123 )
bla bla bla bla bla..

Dont blame me if im wrong :P

jtp10181
01-05-2005, 07:58
wouldent it look like this?
Get_user_name = variabel
----------------------------------
if (variabel = 123 )
bla bla bla bla bla..

Dont blame me if im wrong :P

you are wrong.... since its a string not an int.

Berusadeankan
01-05-2005, 09:21
oh.. :P