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

[Tutorial] Learn the new ways


Post New Thread Reply   
 
Thread Tools Display Modes
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 03-05-2011 , 08:59   Re: [Tutorial] Learn the new ways
Reply With Quote #31

Loose indentation means that your lines doesn't match up.

Good indentation:

PHP Code:
public plugin_init()
{
    
register_plugin("SUPERHERO Enchanter""1.0""Exploited")
    
    new 
pcvarLevel register_cvar("enchanter_level""6")
    
gPcvarStunspeed register_cvar("enchanter_stunspeed""200")
    
gPcvarStuntime register_cvar("enchanter_stuntime""1")
    
gPcvarSlapstrength register_cvar("enchanter_slapstrength""1")
    
    
gHeroID sh_create_hero("Enchanter"pcvarLevel)
    
sh_set_hero_info(gHeroID"Magical powers""Enchant your weapons to make them stronger in combat!")

Bad indentation:
PHP Code:
public plugin_init()
{
            
register_plugin("SUPERHERO Enchanter""1.0""Exploited")
    
  new 
pcvarLevel register_cvar("enchanter_level""6")
    
gPcvarStunspeed register_cvar("enchanter_stunspeed""200")
gPcvarStuntime register_cvar("enchanter_stuntime""1")
               
gPcvarSlapstrength register_cvar("enchanter_slapstrength""1")
    
 
gHeroID sh_create_hero("Enchanter"pcvarLevel)
       
sh_set_hero_info(gHeroID"Magical powers""Enchant your weapons to make them stronger in combat!")

It doesn't matter if you get a warning about loose indentation, it doesn't effect the code at all. It's just there to make the code more readable.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-05-2011 , 14:59   Re: [Tutorial] Learn the new ways
Reply With Quote #32

does anyone know hot to add auto godmode when someone shots at and you get godmode for like 3 second then reset after 5seconds so that u can use again?

also i want the player has yellow glow when the effect is on

anyone knows how?
RollerBlades is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 03-05-2011 , 16:06   Re: [Tutorial] Learn the new ways
Reply With Quote #33

Look at Captain America.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-05-2011 , 16:27   Re: [Tutorial] Learn the new ways
Reply With Quote #34

isn't there anything a bit closer to that?

if doesnt just say no
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-05-2011 , 16:46   Re: [Tutorial] Learn the new ways
Reply With Quote #35

look up the forward client_damage().
http://www.amxmodx.org/funcwiki.php

Use that forward and make a check if the victim being hit by a bullet has your hero. If he does, then set godmode with set_user_godmode(). You can look the native up on the amxmodx.org website too.

You might want to add the same health to the victim because he will obviously look the damage done by that bullet as godmode then will be set after the bullet has hit the victim.
You can do that with
set_user_health()
Look that one up too to find out how to use it.
Then you get what health he is at after the bullet has hit, and then add the damge to it which is done. client_damage returns how much damage is done. That information is on the funcwiki. Then all you gotta do is set that HP on the victim and he wont lose any HP.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-05-2011 , 17:24   Re: [Tutorial] Learn the new ways
Reply With Quote #36

does that mean i have to

#include <Fun> ???

ok how do i set the hp on victim?

didnt get that part...

so u mean if i use client_damage i can use that to set the godmode when i get hit from player to player?

Last edited by RollerBlades; 03-05-2011 at 18:03.
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-05-2011 , 18:24   Re: [Tutorial] Learn the new ways
Reply With Quote #37

Quote:
Originally Posted by RollerBlades View Post
does that mean i have to

#include <Fun> ???
Fun is already included when you include superheromod so no.

Quote:
Originally Posted by RollerBlades View Post
ok how do i set the hp on victim?

didnt get that part...
Quote:
Originally Posted by Jelle View Post
You might want to add the same health to the victim because he will obviously look the damage done by that bullet as godmode then will be set after the bullet has hit the victim.
You can do that with
set_user_health()

Look that one up too to find out how to use it.
Quote:
Originally Posted by RollerBlades View Post
so u mean if i use client_damage i can use that to set the godmode when i get hit from player to player?
Quote:
Originally Posted by Jelle View Post
look up the forward client_damage().
http://www.amxmodx.org/funcwiki.php

Use that forward and make a check if the victim being hit by a bullet has your hero. If he does, then set godmode with set_user_godmode(). You can look the native up on the amxmodx.org website too.
All the answers has already been given. Next time please read my post before you ask.
__________________
No idea what to write here...

Last edited by Jelle; 03-05-2011 at 21:21.
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-05-2011 , 18:42   Re: [Tutorial] Learn the new ways
Reply With Quote #38

i read everything, u made a great explanation but i wish i coud give a bit more detail about it so that i understand more......
RollerBlades is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 03-05-2011 , 21:21   Re: [Tutorial] Learn the new ways
Reply With Quote #39

You ask for how to set health, I tell you it is set_user_health() and you can look it up at the amxx funcwiki. How more detailed can it get?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
RollerBlades
Senior Member
Join Date: Feb 2011
Location: Sweden
Old 03-06-2011 , 03:32   Re: [Tutorial] Learn the new ways
Reply With Quote #40

it doesnt tell how to use it.......

does it mean i need

new damage = read_data(2)
new attacker = get_user_attacker(id)
new victim = read_data(2)

or something?

Last edited by RollerBlades; 03-06-2011 at 06:17.
RollerBlades 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 17:17.


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