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

Round start


Post New Thread Reply   
 
Thread Tools Display Modes
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 11:21  
Reply With Quote #11

Ok, I think I understood that.

Now is their a quick way to just kill all the settings you get when turning off "ninja"

Right now I have the glitchy and cumbersome way of just changing th values for a ninja when it turns off.


Code:
public ninja(id,level,cid) {     if(hasNinja[id])     {         client_print (id,print_chat,"[AMXX] You are already a Ninja.")         return PLUGIN_CONTINUE     }     if(AlreadyNinjad[id])     {         client_print (id,print_chat,"[AMXX] You have already been a Ninja this round.")         return PLUGIN_CONTINUE     }     AlreadyNinjad[id]=true     set_user_health(id,355)     set_user_armor(id,355)     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,70)     client_print (id,print_chat,"[AMXX] You are now a Ninja, you have increased health and armor, as well as stealth.")     set_user_gravity(id,0.4)     set_user_footsteps(id,1)     hasNinja[id] = true     return PLUGIN_CONTINUE } public ninjaoff(id) {     set_user_health (id,100)     set_user_armor (id,100)     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 255)     client_print (id,print_chat,"[AMXX] Your Ninja powers have worn off, you are now normal.")      set_user_gravity (id,1.0)     set_user_footsteps (id,0)     hasNinja[id]=false }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 11:25  
Reply With Quote #12

you have to do it that way.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 11:26  
Reply With Quote #13

EDIT: bug, made me double post :/
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 11:27  
Reply With Quote #14

Seriously?!

Cause I dont like them getting free hp and armor when they turn if off.

And again with the round reset thingy. Can you noob what you said down lol. I'm not getting it. I want them to not have any powers when the round starts, like just all normal.

Would I have to put the ninjaoff settings in there?
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 11:36  
Reply With Quote #15

Does this look right?

Code:
public round_start() {      for( i=1; i < get_maxplayers(); i++ ) {          if( !is_user_connected(i) ) continue            if( hasNinja[i] == true ) {         set_user_health (id,100)         set_user_armor (id,100)         set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 255)         client_print (id,print_chat,"[AMXX] Your Ninja powers have worn off, you are now normal.")          set_user_gravity (id,1.0)         set_user_footsteps (id,0)         hasNinja[id]=false             }        } }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 11:37  
Reply With Quote #16

EDIT: we posted at the same time


yes it looks right, although set_user_aromor shoulde be

Code:
set_user_armor(id, 0) // we dont want to give them free armor :P
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 11:45  
Reply With Quote #17

Okay, I tried compiling that, and i get 1 warning and 4 errors.

3 errors are all "undefined symbol "i""

1 error is just that there's too many errors on one line.

The warning says that: "redundant test: constant expression is non-zero"
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-25-2005 , 11:46  
Reply With Quote #18

psot your plugin plz and tell me what lines the errors are on
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 09-25-2005 , 11:48  
Reply With Quote #19

Here's how i'd do it. Should help with the free armour/hp cuz that will be abused like a dog in a shelter... sorry I can't test this cuz my compiler is FUBAR atm.

Code:
public round_start() { 

     for( i=1; i < get_maxplayers(); i++ ) { 

         if( !is_user_connected(i) && hasNinja[i] == true) continue         
        /*(set_user_health (i,100)
        set_user_armor (i,100) 

why are u changing their hp and ap anyways? It is auto set to 100 and 0 at begining of round. I'm sure no one has had the chance to buy armour yet, but just in case: */
       set_user_armour(i, get_user_armour(i))
        set_user_rendering(i,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 255)
        client_print (i,print_chat,"[NINJA] Your Ninja powers have worn off, you are now normal.")  
        set_user_gravity (i,1.0)
        set_user_footsteps (i,0)
        hasNinja[i]=false 
//NOTE: id isn't going to work cuz u r in a loop counted by "i"
            } 
       } 
}
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 09-25-2005 , 11:48  
Reply With Quote #20

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> new bool:hasNinja[33]=false public plugin_init() {     register_plugin("Ninja Mode","0.1","smallwimpyboy")     register_cvar("amx_ninjaon", "1")     register_clcmd("say /ninja","ninja")     register_clcmd("say_team /ninja","ninja")     register_clcmd("say /ninjaoff","ninjaoff")     register_clcmd("say_team /ninjaoff","ninjaoff")     register_event("CurWeapon","CurWeapon","be")     register_logevent("round_start",2,"0=World triggered","1=Round_Start") } public client_connect(id) {     hasNinja[id] = false } public ninja(id,level,cid) {     if(hasNinja[id])     {         client_print (id,print_chat,"[AMXX] You are already a Ninja.")         return PLUGIN_CONTINUE     }     set_user_health(id,355)     set_user_armor(id,355)     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha,50)     client_print (id,print_chat,"[AMXX] You are now a Ninja, you have increased health and armor, as well as stealth.")     set_user_gravity(id,0.4)     set_user_footsteps(id,1)     hasNinja[id] = true     return PLUGIN_CONTINUE } public ninjaoff(id) {     set_user_health (id,100)     set_user_armor (id,0)     set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 255)     client_print (id,print_chat,"[AMXX] Your Ninja powers have worn off, you are now normal.")      set_user_gravity (id,1.0)     set_user_footsteps (id,0)     hasNinja[id]=false } public round_start() {      for( i=1; i < get_maxplayers() i++ ) {  //Everything seems to be coming from here.          if( !is_user_connected(i) ) continue            if( hasNinja[i] == true ) {         set_user_health (id,100)         set_user_armor (id,0)         set_user_rendering(id,kRenderFxGlowShell,0,0,0,kRenderTransAlpha, 255)         client_print (id,print_chat,"[AMXX] Your Ninja powers have worn off, you are now normal.")          set_user_gravity (id,1.0)         set_user_footsteps (id,0)         hasNinja[id]=false             }        } }  public CurWeapon(id) {     if(hasNinja[id]==true)     {            client_cmd(id,"weapon_knife")     }     return PLUGIN_HANDLED }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
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 13:29.


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