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

Help please


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zombieplague
Veteran Member
Join Date: Apr 2009
Old 04-26-2009 , 03:25   Help please
Reply With Quote #1

Is there anyway i can add armor to everyhuman at the start of the game ? without them buying extra item ?
zombieplague is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 04-26-2009 , 04:59   Re: Help please
Reply With Quote #2

Ok, I'm not 100%, but this might work. To change the armor set change the number.
the cvar is human_armor.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new armoradded

public plugin_init() {
    
register_plugin("Round Armor""1.0""Tirant")
    
armoradded register_cvar("human_armor","100")
    
register_logevent("give_armor",2,"1=Round_Start")
}

public 
give_armor(id) {
    if(
get_user_team(id) == 2)
    {
        
set_user_armor(idarmoradded)
    }

__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]

Last edited by Tirant; 04-26-2009 at 06:45.
Tirant is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 04-26-2009 , 05:24   Re: Help please
Reply With Quote #3

Quote:
Originally Posted by Tirant View Post
Ok, I'm not 100%, but this might work. To change the armor set change the number.
the cvar is human_armor.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
 
new armoradded
 
public plugin_init() {
    
register_plugin("Round Armor""1.0""Tirant")
    
armoradded register_cvar("human_armor","100")
    
register_logevent("give_armor",2,"1=Round_Start")
}
 
public 
give_armor(id) {
    if(
get_user_team(id) == 1);
    {
        
set_user_armor(idarmoradded)
    }

I thought team id 1 is terrorist? or am i wrong?
__________________
Zombie Lurker is offline
Hello-World
Senior Member
Join Date: May 2008
Old 04-26-2009 , 05:56   Re: Help please
Reply With Quote #4

Quote:
Originally Posted by Tirant View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
 
new armoradded
 
public plugin_init() {
    
register_plugin("Round Armor""1.0""Tirant")
    
armoradded register_cvar("human_armor","100")
    
register_logevent("give_armor",2,"1=Round_Start")
}
 
public 
give_armor(id) {
    if(
get_user_team(id) == 1);
    {
        
set_user_armor(idarmoradded)
    }

there's should'nt be a ; at the
Quote:
if(get_user_team(id) == 1);
edit : i've tested it and not work with me
__________________
sry for my bad english
I'm helpful !! +karma 4 me
I said something wrong !! Don't -karma
Learnin' scripting and skinning 4 Now !
Mine Comp Got Burned , can't do anything for 3 month

Last edited by Hello-World; 04-26-2009 at 06:02.
Hello-World is offline
Zombie Lurker
Senior Member
Join Date: Mar 2009
Old 04-26-2009 , 06:05   Re: Help please
Reply With Quote #5

Quote:
Originally Posted by Hello-World View Post
there's should'nt be a ; at the

edit : i've tested it and not work with me
Try doing this :
Code:
if(get_user_team(id) == 1);
==========>
if(get_user_team(id) == 2);
__________________
Zombie Lurker is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 04-26-2009 , 06:31   Re: Help please
Reply With Quote #6

using logevent won't pass id to the function so you would need to loop through all players, also your better off using the zp_round_start forward to properly catch when round truly begins i.e. something like
PHP Code:
#include <amxmodx>
#include <zombieplague>
#include <fun>

new gMaxPlayerspArmor;
public 
plugin_init()
{
    
register_plugin("[ZP] Free Armor""1.0""Random1");
    
pArmor register_cvar("zp_start_armor""100");
    
    
gMaxPlayers get_maxplayers();
}

public 
zp_round_started(gamemodeid)
{
    static 
iiArmoruserArmor;
    
iArmor get_pcvar_num(pArmor);
    
    for ( 
1<= gMaxPlayersi++)
    {
        if ( !
is_user_alive(i) || zp_get_user_zombie(i) ) continue;
        
        
userArmor get_user_armor(i);
        
userArmor max(userArmoriArmor);
        
        
set_user_armor(iuserArmor);
    }

__________________
If at first you don't succeed, then skydiving isn't for you.

Last edited by G-Dog; 04-26-2009 at 10:25.
G-Dog is offline
Send a message via AIM to G-Dog
Old 04-26-2009, 06:40
Hello-World
This message has been deleted by Hello-World. Reason: hmm..... disconnect while typing
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 04-26-2009 , 06:44   Re: Help please
Reply With Quote #7

Quote:
Originally Posted by Zombie Lurker View Post
Try doing this :
Code:
if(get_user_team(id) == 1);
==========>
if(get_user_team(id) == 2);
o, my bad, I've been workin with a plugin that effects terrorists. I just fixed mine if you want to use it.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
Old 04-26-2009, 06:53
Hello-World
This message has been deleted by Hello-World. Reason: he solved it
zombieplague
Veteran Member
Join Date: Apr 2009
Old 04-26-2009 , 07:04   Re: Help please
Reply With Quote #8

Sorry it doesn't work.

Problem fix.

Last edited by zombieplague; 04-26-2009 at 07:31.
zombieplague is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 04-26-2009 , 10:29   Re: Help please
Reply With Quote #9

whoops coded on the fly and missed the bracket, updated my original post.
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 04-28-2009 , 09:50   Re: Help please
Reply With Quote #10

As per the Global Forum Rules, you need to have a descriptive topic title. If you wish for this topic to stay open, please correct the topic title before you post again.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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 16:38.


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