Raised This Month: $ Target: $400
 0% 

Subplugin Submission [ZP50] Zombie Random invisibility !!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-12-2013 , 01:25   [ZP50] Zombie Random invisibility !!
Reply With Quote #1

Description:- Well i was testing my server and found out that there are a lot of things that are human biased so i made this to give zombies a chance to stand against humans !

What it basically does is that when a human shoots a zombie there is a random chance that the zombie goes invisible for 4 seconds.... the chances are not so frequent but they are also not way to "once in a blue moon " In short it's balanced.

ENJOY !!

Updated
Attached Files
File Type: sma Get Plugin or Get Source (Addon_random_invisi.sma - 677 views - 1.6 KB)

Last edited by Catastrophe; 04-16-2013 at 03:12.
Catastrophe is offline
artos
Senior Member
Join Date: Mar 2010
Old 04-13-2013 , 18:06   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #2

What the heck is that?

PHP Code:
if(random_num(0100) < random_num(0100) < random_num(0100) < random_num(0100)) 
BTW. Your code is hardly readable.
__________________
artos is offline
Send a message via Skype™ to artos
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-14-2013 , 06:19   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #3

Quote:
Originally Posted by artos View Post
What the heck is that?

PHP Code:
if(random_num(0100) < random_num(0100) < random_num(0100) < random_num(0100)) 
.
This is normal for useing in "chance" code it creates rundom number from 1 - 100 then again and again so if the first number is lower and then the second number is higher it crits or becomes invisable in this case. Not much chance to happen as you can see from that part. But one hit is nothing for this code.
__________________
H.RED.ZONE is offline
artos
Senior Member
Join Date: Mar 2010
Old 04-14-2013 , 06:54   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #4

Quote:
Originally Posted by H.RED.ZONE View Post
This is normal for useing in "chance" code it creates rundom number from 1 - 100 then again and again so if the first number is lower and then the second number is higher it crits or becomes invisable in this case. Not much chance to happen as you can see from that part. But one hit is nothing for this code.
This isn't normal method I think. His code isn't optimized. He should use:

PHP Code:
switch(random_num(1100))
{
    case 
.. 33:
    {
        
set_user_rendering(victimkRenderFxGlowShell000kRenderTransAlpha1);
            
        
set_hudmessage(02550, -1.0, -1.006.01.10.00.01)
        
ShowSyncHudMsg(attackergSyncHud"You made a zombie invisible")
            
        
set_task(4.0"remove_glow"victim+TASK_REMOVE)
    }
    default: return 
HAM_IGNORED;

Where 1 .. 33: means 33% chance to get zombie invisible.
__________________

Last edited by artos; 04-14-2013 at 10:03.
artos is offline
Send a message via Skype™ to artos
H.RED.ZONE
Veteran Member
Join Date: Sep 2011
Location: Serbia, Belgrade
Old 04-14-2013 , 12:36   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #5

Yes but that would be to much like 10 shots 3 of them will make them invisable so the one on the top is better to be used in this situation specially if the coder is not that skilled to continue and use switch.
__________________
H.RED.ZONE is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-15-2013 , 01:21   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #6

See i'm barely learning coding yet.... plzz dont criticize... i needed this plugin so i made it.... and if u have any suggestions just post it dont use such words:-
Quote:
specially if the coder is not that skilled to continue and use switch.
It demoralizes new coders... :\

Last edited by Catastrophe; 04-15-2013 at 01:22.
Catastrophe is offline
artos
Senior Member
Join Date: Mar 2010
Old 04-15-2013 , 08:16   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #7

Quote:
Originally Posted by Catastrophe View Post
See i'm barely learning coding yet.... plzz dont criticize... i needed this plugin so i made it.... and if u have any suggestions just post it dont use such words:-
It demoralizes new coders... :\
He didn't want to offend you. He just explained to me why you used random_num in this weird way. Try to make it with switch.
__________________
artos is offline
Send a message via Skype™ to artos
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 04-16-2013 , 02:54   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #8

Anyways.... thnxx if u appreciate it....


EDIT: Updated used switch ... happy ? xD

Last edited by Catastrophe; 04-16-2013 at 03:16.
Catastrophe is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 07-27-2013 , 14:18   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #9

The addon is fine just a suggestion make another version with damage, i mean if the zombie receives an amount of damage he turn invisible and of course add a cvar too change the amount of damage..
wicho is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 07-30-2013 , 10:56   Re: [ZP50] Zombie Random invisibility !!
Reply With Quote #10

Sorry, i cant support it anymore, i am not active on alliedmodders anymore, have lots of work to do, Private scripter now, if u wanna do it, take the credits and do it , i dont mind at all
__________________
You will find everything u need :-
Catastrophe 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 09:29.


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