Raised This Month: $ Target: $400
 0% 

Spawn with armor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iknowiz58
Member
Join Date: Sep 2006
Old 12-13-2008 , 19:41   Spawn with armor
Reply With Quote #1

I have searched everywhere for a give armor plugin.
Would anyone make this plugin for me. It could be a simple spawn with armor plugin but if you could add the below features on that would be great.

features:
- team 0=both 1=ter 2=ct
- amount of armor=?
- helmet?

reason: it could be conventional, maybe there are people that would love this, like me.
__________________

iknowiz58 is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-14-2008 , 05:42   Re: Spawn with armor
Reply With Quote #2

Code:
#include <amxmodx> #include <hamsandwich> #include <cstrike>   new amx_swa_team, amx_swa_amount, amx_swa_helmet;   public plugin_init() {         register_plugin("Spawn With Armor", "1.2", "hleV");           // 0 - disabled, 1 - CTs only, 2 - Ts only, 3 - both         amx_swa_team = register_cvar("amx_swa_team", "3");         amx_swa_amount = register_cvar("amx_swa_amount", "100");         amx_swa_helmet = register_cvar("amx_swa_helmet", "1");           RegisterHam(Ham_Spawn, "player", "hamSpawn", 1); }   public hamSpawn(id) {         if (!get_pcvar_num(amx_swa_team) || cs_get_user_vip(id) || !is_user_alive(id))                 return;           new CsArmorType:iArmorType;         new iAmount = get_pcvar_num(amx_swa_amount);         new iHelmet = get_pcvar_num(amx_swa_helmet);         new CsTeams:iTeam = cs_get_user_team(id);           if (cs_get_user_armor(id, iArmorType) >= iAmount)                 return;           switch (iHelmet)         {                 case 0: if (iArmorType < 2) iArmorType = CS_ARMOR_KEVLAR;                 case 1: iArmorType = CS_ARMOR_VESTHELM;         }           switch (get_pcvar_num(amx_swa_team))         {                 case 1: if (iTeam == CS_TEAM_CT) cs_set_user_armor(id, iAmount, iArmorType);                 case 2: if (iTeam == CS_TEAM_T) cs_set_user_armor(id, iAmount, iArmorType);                 case 3: cs_set_user_armor(id, iAmount, iArmorType);         }           client_print(id, print_chat, "[SWA] You have been given %d armor", iAmount); }
__________________

Last edited by hleV; 12-14-2008 at 07:55. Reason: Fixed.
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2008 , 06:00   Re: Spawn with armor
Reply With Quote #3

You should add support for VIP, VIPs spawn with 200AP, dunno if they have a helmet or not.
Also, you forget to check if players already have some kind of armor, so if a player has a helmet, but your plugin cvar is set on vest, you gonna remove his helmet.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 12-14-2008 , 06:08   Re: Spawn with armor
Reply With Quote #4

Should be good now.
__________________
hleV is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-14-2008 , 07:34   Re: Spawn with armor
Reply With Quote #5

No all, you should do something like this :

switch (iHelmet)
{
case 0: if(iArmorType < 2) iArmorType = CS_ARMOR_KEVLAR;
case 1: iArmorType = CS_ARMOR_VESTHELM;
}

So you don't remove players helmets.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
iknowiz58
Member
Join Date: Sep 2006
Old 12-14-2008 , 19:39   Re: Spawn with armor
Reply With Quote #6

I love you!
__________________

iknowiz58 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 01:26.


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