PDA

View Full Version : DoD Ninja


Hell Phoenix
07-10-2006, 12:06 PM
Description: This plugin allows admins to turn players into ninjas. Players thenhave low grav, no footsteps, unlimited stamina, and a LOT more health until they die.


Commands:
amx_ninja < player >
/ninja in public chat (if self ninja is enabled)
dod_ninjamenu

Cvars:
dod_ninja_health (Amount of health the ninja gets, default is 600)
dod_ninja_visibility (How invisible is the ninja, default is 100, range is 0 (completely invisible) to 256 (normal))
dod_ninja_self (Allow users to ninja themselves by typing /ninja into chat, 0 is off(default), 1 is on)
dod_ninja_random (Turn on the random Ninja mode, 1 person is selected to be a ninja, 0 is off(default), 1 is on)
dod_ninja_everyone (Turn on ninja madness mode, everyone is a ninja all the time, 0 is off(default), 1 is on)



Changelog:
v1.0 - Created
v1.1 Added Invisibility
v1.2 Added Instant Kill
v1.3 Added Sword model so everyone sees a sword and not just you
Added ability to self-ninja by saying /ninja
Added random ninja mode
Optimized some code
v1.4 Added everyones a ninja mode
Blocked possible exploits
Added menu so its more "User Friendly"



The two model files go into your dod/models folder

=|[76AD]|= TatsuSaisei
08-08-2006, 08:00 PM
ok, I LOVE this plugin, but I had to change a few things on my end to better suit me... that invisible stuff was annoying really... too many complaints... but noone minds when they can see the player.. so I stripped that code out....

but the one thing I noticed that I didn't like was that as the ninja you can see the custom model, but others simply saw the spade/knife... that rots... so I did this....

after this line in the function,
entity_set_string(id, EV_SZ_viewmodel, "models/katana.mdl")

i added this....
entity_set_string(id, EV_SZ_weaponmodel, "models/p_katana.mdl")

so together...


entity_set_string(id, EV_SZ_viewmodel, "models/katana.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_katana.mdl")


and then you have to precache it...

public plugin_precache() {
precache_model("models/katana.mdl")
precache_model("models/p_katana.mdl")
return PLUGIN_CONTINUE
}

and I have the p_ model ... and in the game, any player who is a ninja, others see his SWORD !!!! AWESOME !!!

Now, only need a custom death message, that shows a sword sprite as the weapon that killed... that would complete this plugin...

Thanx so much for this code.. I am in love.....

so um, how to "officially" attach the model I have for you all to have ??

here it is though .. put it in models folder...
http://76ad.com/downloads/p_katana.mdl

also, I have come to realize, that in combination with the new sword model, the american kinfe animation sux, whereas the axis spade animation gives a more realistic sword attack... so I think I am going to change the code so that all ninjas get a spade, regardless of their team, so that the animation played... is more realistic to see...

the only thing I have yet to figure out, is how to slighty increase the distance in order to execute damage on someone... it still wants to be up close as if it was the knife... but a katana is almost 2 feet longer... so the "Reach" should be a bit longer as well...

by the way, on my server, it is now called Samurai. Ninjas are dishonorable lot, and do not deserve the respect a Samurai does. A Samurai lives his life by HONOR, whereas ninjas are really just renegade Samurai...

and slash in the air, that would be the final touch to this awesome plugin !!

Thanx again for this one !!!

Hell Phoenix
08-09-2006, 12:31 AM
ok, I LOVE this plugin, but I had to change a few things on my end to better suit me... that invisible stuff was annoying really... too many complaints... but noone minds when they can see the player.. so I stripped that code out....


Thats why you can change the level of invisibility (or have none) by changing the number after the define ;)

Glad you like it. I will have to look at that model.

TigerMan4
09-09-2006, 01:14 PM
what would be visbable ? 0 ?

and will this work on admins who have imunity ?

and what is the default letter flag for using ?

I have found that "young" admins get carried away with new plugins.

so if it was set to L , M or somthing to use it , I could not have every admin who has kick or ban using it.

=|[76AD]|= TatsuSaisei
09-09-2006, 03:10 PM
what would be visbable ? 0 ?

and will this work on admins who have imunity ?

and what is the default letter flag for using ?

I have found that "young" admins get carried away with new plugins.

so if it was set to L , M or somthing to use it , I could not have every admin who has kick or ban using it.

open the sma file and READ it... most do not realize that good coders, put in instructions for usage in the sma file... and even when there are no instructions, just looking at the plugin_init function and "evaluating" the cvars will give insight as to how the plugin is "used"

And for admin levels, when you use the sma to create your own compilation, you have explicit control over what admin level is used, and for which options...

So if you only want admin with immunity to be able to use it... replace the "default" level needed with the level YOU want...

TigerMan4
09-09-2006, 03:23 PM
gah !

read through it , have no clue what I`m looking at.

I`m a 39year old noob when it comes to coding and such.

Hell Phoenix
09-10-2006, 05:46 PM
Visable would be 100 (im going from memory here but Im almost positive).

Yes it works for admins with immunity.

It is set so that any admin with slay can use it. If you want it something different change the ADMIN_SLAY to whatever level you want.

=|[76AD]|= TatsuSaisei
09-10-2006, 07:45 PM
Visable would be 100 (im going from memory here but Im almost positive)

you are definetely not an elephant...


public set_normal(id) {
if (g_status){
g_status[id] = false
set_user_health(id,100)
set_user_maxspeed(id,320.0)
set_user_footsteps(id,0)
set_user_gravity(id,1.0)
dod_set_stamina(id,STAMINA_SET,0,100)
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, [I]kRenderTransAlpha, 255)
set_entity_visibility(id, 1)
}
return PLUGIN_HANDLED
}


Visible would be 255 thus the range for the ninja_invisibility value would be 0 - 255, 0 being completely invisible...

TigerMan4
10-18-2006, 09:48 AM
what is stock gravity ? so that I dont have ninjas flying all over the place.

thanks

=|[76AD]|= TatsuSaisei
10-18-2006, 10:35 AM
what is stock gravity ? so that I dont have ninjas flying all over the place.

thanks
inside a plugin, gravity goes from 0.0 to 1.0 (0.0, 0.1, 0.2, ...)

in the server console, default gravity is 800 (0-1000)

=|[76AD]|= TatsuSaisei
10-18-2006, 10:40 AM
what is stock gravity ? so that I dont have ninjas flying all over the place.

thanks

In a different post you asked about ninjas "flying"... this is the bit of code that SETS the player to ninja with "abilities"


public cmd_blade (Player) {
set_user_health(Player,get_cvar_num("ninja_health"))
set_user_maxspeed(Player,999.0)
set_user_footsteps(Player,1)
set_user_gravity(Player,0.2) // <--- ALTER THIS VALUE
dod_set_stamina(Player,STAMINA_SET,100,100)
set_user_rendering(Player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_cvar_num("ninja_visibility"))

{
strip_user_weapons(Player)
if(get_user_team(Player) == 2){
give_item(Player,"weapon_spade")
}
else if(get_user_team(Player) == 1){
give_item(Player,"weapon_amerknife")
}

new name[32]
get_user_name(Player,name,31)
client_print(0,print_chat,"[AMXX] %s is now a Ninja",name)

}

return PLUGIN_HANDLED
}

TigerMan4
10-18-2006, 11:34 PM
yeah but what would keep the ninjas like regular players ?

I jumped last night and landed of a roof with the value in the plugin.

I opend the sma and changed it to 2.0 and it didnt help . then I changed it to 10.00 and havn`t tried it yet. (set_user_gravity(id,10.0)

I just dont want to screw it up.

What i`m looking for is the value to set the ninjas gravity at so they jump normally.

Thanks in advance

diamond-optic
10-19-2006, 01:02 AM
set_user_gravity, as already said, only takes float values 0.1-1.0 so setting it to anything over 1.0 wont do anything and id assume you'd get an error in your logs from it..

TigerMan4
10-19-2006, 02:04 AM
is there a way to disable the thing that says... <player> is a ninja ?

I saw it in the code , but I didnt know if I could ; it out or to make it not say it for everyone to see.

also there is a crazy noise when you ninja-fy yourself , it sounds like a chainsaw.....is this normal ?

Box Cutter
10-19-2006, 02:15 AM
I will tell you something funny though. Try activating the no scope snipers fun plugin and then turn yourself into a ninja. Everytime you slash your sword it fires a shot as if your shooting bullet out of your sword and your kills register as a sniper hit. Kind awesome and funny, just thought I would share.

Hell Phoenix
10-19-2006, 11:30 AM
Change : set_user_gravity(Player,0.2)
To: set_user_gravity(Player,1.0)

That will give you normal gravity.

To turn off the ninja notification:
Change: client_print(0,print_chat,"[AMXX] %s is now a Ninja",name)
To: //client_print(0,print_chat,"[AMXX] %s is now a Ninja",name)

TigerMan4
10-22-2006, 08:38 PM
I // the line like you said , and it still says it , then I // all 3 of the lines in that string and I think it still says it , actually I know it does.

any other ideas on how to get rid of the <name> is a ninja ?

or do I have to restart the server to fix it ?

diamond-optic
10-22-2006, 09:17 PM
I // the line like you said , and it still says it , then I // all 3 of the lines in that string and I think it still says it , actually I know it does.

any other ideas on how to get rid of the <name> is a ninja ?

or do I have to restart the server to fix it ?

lol


you have to recompile the plugin, upload, restart/change the map

TigerMan4
10-23-2006, 02:33 AM
i did that too ( i edited it and recompiled it ) and still...says....ninja

tegu
10-25-2006, 10:56 PM
|= TatsuSaisei;460']
here it is though .. put it in models folder...
http://76ad.com/downloads/p_katana.mdl

Do you still have a copy of that mdl? I am looking for it and cant follow that link due to a 404.

Thanks Tatsu

=|[76AD]|= TatsuSaisei
10-27-2006, 12:48 AM
Do you still have a copy of that mdl? I am looking for it and cant follow that link due to a 404.

Thanks Tatsu

fixed the link... sorry for the inconvenience...

TigerMan4
10-27-2006, 03:01 PM
is there anyway to get rid of the skull and crossbones thing that shows up when you kill someone as a ninja ?

sometimes when I wack someone , it shows up as a spade or knife but a lot of the time it shows up as a skull and crossbones like a mortar kill.

is there anyway to get rid of that ?

tegu
10-28-2006, 01:37 AM
|= TatsuSaisei;2013']fixed the link... sorry for the inconvenience...

No sir, Thank you for providing the correct link. I have edited the code (my first attempt-- IT EVEN COMPILED WOOHOO!) and am trying it out now.


Ok, I put this and got no katana whatsoever....


public check_weapon(id){
if (g_status[id]){
if ( read_data(1) !=19){
client_cmd(id,"drop")
}
new clip, ammo, wpnid = dod_get_user_weapon(id,clip,ammo)
if (wpnid == DODW_SPADE || wpnid == DODW_AMERKNIFE) {
entity_set_string(id, EV_SZ_viewmodel, "models/Katana.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_katana.mdl")
}
}
return PLUGIN_CONTINUE


and this

public plugin_precache() {
precache_model("models/Katana.mdl")
precache_model("models/p_katana.mdl")
return PLUGIN_CONTINUE
}


Anyone know what happened?

tegu
10-28-2006, 01:52 AM
Ok, nm, it seems that it doesnt like the K in Katana when used next to p_katana
I changed it to lower case and made the mdl match and it works fine.


Next question....
Could you tell me how to strip the invis from it? Also, what would it take for me to get you to add some cvars to allow me to transform everyone on the server to ninjas and not just one at a time?

I love this so far. With the invis though, I get tons of complaints of hackers etc...

Please let me know what I need to do and what you can do about the cvars. Thanks and keep up the good work!

=|[76AD]|= TatsuSaisei
10-28-2006, 03:41 AM
Could you tell me how to strip the invis from it? With the invis though, I get tons of complaints of hackers etc...

Change this...

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ninja", "cmd_ninja", ADMIN_SLAY, "<authid, nick or #userid> - Turn player into a Ninja")
register_cvar("ninja_health", "600")
register_cvar("ninja_visibility", "50")
register_event("ResetHUD", "set_normal", "be")
register_event("CurWeapon", "check_weapon","be")
register_forward(FM_AlertMessage,"blocksuicide")
}

to this...

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ninja", "cmd_ninja", ADMIN_SLAY, "<authid, nick or #userid> - Turn player into a Ninja")
register_cvar("ninja_health", "600")
//register_cvar("ninja_visibility", "50")
register_event("ResetHUD", "set_normal", "be")
register_event("CurWeapon", "check_weapon","be")
register_forward(FM_AlertMessage,"blocksuicide")
}


Change this...

public set_normal(id) {
if (g_status[id]){
g_status[id] = false
set_user_health(id,100)
set_user_maxspeed(id,320.0)
set_user_footsteps(id,0)
set_user_gravity(id,1.0)
dod_set_stamina(id,STAMINA_SET,0,100)
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
set_entity_visibility(id, 1)
}
return PLUGIN_HANDLED
}


to this...

public set_normal(id) {
if (g_status[id]){
g_status[id] = false
set_user_health(id,100)
set_user_maxspeed(id,320.0)
set_user_footsteps(id,0)
set_user_gravity(id,1.0)
dod_set_stamina(id,STAMINA_SET,0,100)
//set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255)
//set_entity_visibility(id, 1)
}
return PLUGIN_HANDLED
}


Change this...

public cmd_blade (Player) {
set_user_health(Player,get_cvar_num("ninja_health"))
set_user_maxspeed(Player,999.0)
set_user_footsteps(Player,1)
set_user_gravity(Player,0.2)
dod_set_stamina(Player,STAMINA_SET,100,100)
set_user_rendering(Player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_cvar_num("ninja_visibility"))

{
strip_user_weapons(Player)
if(get_user_team(Player) == 2){
give_item(Player,"weapon_spade")
}
else if(get_user_team(Player) == 1){
give_item(Player,"weapon_amerknife")
}

new name[32]
get_user_name(Player,name,31)
client_print(0,print_chat,"[AMXX] %s is now a Ninja",name)

}

return PLUGIN_HANDLED
}


to this...

public cmd_blade (Player) {
set_user_health(Player,get_cvar_num("ninja_health"))
set_user_maxspeed(Player,999.0)
set_user_footsteps(Player,1)
set_user_gravity(Player,0.2)
dod_set_stamina(Player,STAMINA_SET,100,100)
//set_user_rendering(Player, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, get_cvar_num("ninja_visibility"))

{
strip_user_weapons(Player)
if(get_user_team(Player) == 2){
give_item(Player,"weapon_spade")
}
else if(get_user_team(Player) == 1){
give_item(Player,"weapon_amerknife")
}

new name[32]
get_user_name(Player,name,31)
client_print(0,print_chat,"[AMXX] %s is now a Ninja",name)

}

return PLUGIN_HANDLED
}

tegu
10-28-2006, 01:51 PM
Thank you so much for that one.

Ok so I am realizing now that if there are several things to a plugin and you dont want something, you just comment it out? That is cool beans!

=|[76AD]|= TatsuSaisei
10-28-2006, 02:27 PM
Thank you so much for that one.

Ok so I am realizing now that if there are several things to a plugin and you dont want something, you just comment it out? That is cool beans!

lol, commenting out something is the "safe" way to do it, until you are sure the plugin is working as expected, then you can simply delete all the commented lines to save a few bytes of space... you can also add you own comments as well... as a way to "learn" and remember what things do for when you go back through the code at a later date...

tegu
10-29-2006, 11:00 PM
Hell Phoenix and Tatsu, you two have developed an awesome plugin here and I am not sure that you both know it. I have had nothing but comments on this one and all of them good. When the invisibility was on, I got a lot of cheater comments, but now that its off, people cant get enough of it.

Please think about making this have the ability to turn whole teams into ninjas or everyone at once. It would really make my life a lot easier lol.

GJ guys!

TigerMan4
10-30-2006, 01:41 AM
still anyone know how to get rid of the skull and cross bones that shows up when you wack somone with the katana ?

it would be nice to be a ninja and not have people know , its a dead give away when you kill somone and it shows like a mortar kill instead of a spade or knife

tegu
10-30-2006, 02:40 PM
Tiger I believe that it is from this line and down a few more, but I think it is there for a reason that has something to do with the grander scheme of things.


public blocksuicide(at_type, message[])

RAOCKFISH
12-02-2006, 08:18 PM
Hey has anyone thought of making a ninja model? Just so it looks better when you are a ninja, like take maybe the model from the half life black opps or a pre existing ninja model. Anyways yea if anyone has any ideas on this or would be willing to make it thank you.

=|[76AD]|= TatsuSaisei
12-03-2006, 12:14 AM
Hey has anyone thought of making a ninja model? Just so it looks better when you are a ninja, like take maybe the model from the half life black opps or a pre existing ninja model. Anyways yea if anyone has any ideas on this or would be willing to make it thank you.
There is a ninja player model, but it is designed for CS, and CS player models act and show up funny in DOD games..

http://customdod.com/amxx_plugins/gign.mdl

RAOCKFISH
12-04-2006, 06:24 PM
Would anyone be willing to make it work better in dod? Also how do I put this in to work with the ninja plugin?

MTCoors
03-08-2007, 07:54 PM
Great plugin! My question is, Is there a way to to make it a "CLIENT" friendly plugin...another words let the client set ninja mode instead of an "ADMIN"? Seems like everyone wants to be ninja and i really don't have time to play the map..lol..........Thanks for the plugin!:D

rebelios
04-12-2007, 08:32 PM
is there a way to set this so that all peole become ninjas whenever they spawn or whenever they join the server

Hell Phoenix
04-13-2007, 01:17 AM
At the current moment no...maybe I will look into doing that as soon as I finish up One weapon mod...its almost done.

rebelios
04-13-2007, 09:29 PM
ive been trying to get it to work, maybe you could take a look at my code and tell me where i should fix it, i was also trying to make 2 other game mode but they just dont work, it compiles fine but when i try to set the ninja to all or random it does not work


i just kind of pieced it together with code from other plugins and what i knew

EDIT: I decided to read a little more and now know where my mistakes came from,
BTW if i get this done can i rerelease it as long as i leave the original author in the file?

EDIT: Again
I got some help from some people at the amxx forums and it is fixed

Hell Phoenix
04-16-2007, 03:42 PM
You guys are funny. Deleting code to remove things that are controlled by cvars? Thats really the hard way of doing things.

Anyways, I updated this today as I didnt feel like doing actual work today at work.

Changelog V1.3:
Added Sword model so everyone sees a sword and not just you
Added ability to self-ninja by saying /ninja
Added random ninja mode
Optimized some code

rebelios
04-16-2007, 03:53 PM
your implementation of random ninja isnt very user friendly as i know of many admins who most likely do not know how to change cvars

Hell Phoenix
04-16-2007, 04:00 PM
Isnt user friendly? If you dont know how to change cvars then you shouldnt be running a server honestly. How hard is it to add dod_ninja_random 1 to your amxx.cfg file? Or, change the 0 to a 1 in the sma file before you compile it?

MBosta
04-16-2007, 04:13 PM
your implementation of random ninja isnt very user friendly as i know of many admins who most likely do not know how to change cvars

looks like you need new admins

rebelios
04-16-2007, 09:22 PM
Isnt user friendly? If you dont know how to change cvars then you shouldnt be running a server honestly. How hard is it to add dod_ninja_random 1 to your amxx.cfg file? Or, change the 0 to a 1 in the sma file before you compile it?

Ok but what if you dont want it on all the time then you have to be able to typee in the command for the correct cvar, and sometimes admins who arent in charge of this kind of stuff wont know the cvar

such as i know cause ive read the code that to change the cvar i type

amx_cvar dod_ninja_random 1

but that is a lot to remember for an admin that doesnt know the code itself

Hell Phoenix
04-18-2007, 06:00 PM
Ok, updated to 1.4.
Changelog:

Added everyones a ninja mode
Blocked possible exploits
Added menu so its more "User Friendly"

goodgirl
04-26-2007, 11:45 AM
I have added the plugin and it works...just kills everyone who becomes a ninja
what have I done wrong and how can I fix

GG

Hell Phoenix
04-26-2007, 12:04 PM
Thats how it is supposed to work if you turn everyone into a ninja (activate everyone is a ninja mode). It kills everyone then spawns them all at the same time...basically like restarting the round. Turning a single player into a ninja wont kill them though.

Is that what your talking about?

Panda
06-22-2007, 07:43 AM
so what are the codes that i put in the cvars.ini? :s i have been trying to figure it out all morning and i havent a clue.

Hell Phoenix
06-25-2007, 12:51 PM
dod_ninja_health 600
dod_ninja_visibility 100
dod_ninja_self 0
dod_ninja_random 0
dod_ninja_everyone 0

Panda
06-25-2007, 06:48 PM
dod_ninja_health 600
dod_ninja_visibility 100
dod_ninja_self 0
dod_ninja_random 0
dod_ninja_everyone 0


these didnt work :s

diamond-optic
06-25-2007, 07:01 PM
these didnt work :s

are you using the proper line format for the cvars.ini?

cvar values access

gfy mmf
08-23-2008, 08:38 PM
sory to bump this but the self ninja is not working?
dod_ninja_health 600
dod_ninja_visibility 50
dod_ninja_self 1
dod_ninja_random 0
dod_ninja_everyone 0

TigerMan4
12-21-2008, 04:25 AM
Its been a while since I had this activated on my server...for reasons that can only be , admin abuse.

but I was wondering if there was an update that got rid of the skull and cross bones thing when you kill someone as a ninja.

that is a dead give away when you are ninja-ing around.

any one ?

DUhBOy
01-04-2011, 03:39 PM
okey guys i download plugin and models.
i put models in models folder.
amxx in amxmodx and plugins putted amxx. and write it to config i added them any still they are not working please help me?! I love ninjas and i wanna test it on my server please! help help help