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

Anti Infection Armor [BIOHAZARD]


Post New Thread Reply   
 
Thread Tools Display Modes
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-25-2009 , 10:19   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #21

Code:
/* Plugin generated by Emilioneri */ #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <biohazard> #define PLUGIN "Anti Infection Armor" #define VERSION "1.0" #define AUTHOR "Emilioneri" //new g_Cost new g_maxplayers public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // Add your code here...     //g_Cost = register_cvar("amx_infectarmor", "2500")     register_logevent("Event_Round_Start", 2, "1=Round_Start")     //register_clcmd("say /antiinfect", "cmd_buyarmor")     register_dictionary("anti_infect_armor.txt")         g_maxplayers = get_maxplayers() } public Event_Round_Start() {     for (new id = 1; id <= g_maxplayers; id++)     {             set_user_armor(id, 0)             set_task(10.0,"cmd_buyarmor",id)     }         server_cmd("bh_obeyarmor 1")         //client_print(0, print_chat, "[AMXX] %L", LANG_PLAYER, "TO_BUY") } public cmd_buyarmor(id) {     if (!is_user_alive(id) || is_user_zombie(id))     {         client_print(id, print_chat, "[AMXX] %L", LANG_PLAYER, "ZOMBIE_OR_DEAD")         return PLUGIN_HANDLED     }     else     {                 cs_set_user_armor(id, 100)                 client_print(id, print_chat, "You received 100 armor")     } }

Try that.
__________________

Last edited by DarkGod; 07-28-2009 at 11:19.
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
ds811888
BANNED
Join Date: Mar 2009
Location: Hong Kong
Old 07-27-2009 , 07:15   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #22

Nice plugin!
ds811888 is offline
deejay87
Senior Member
Join Date: Apr 2004
Location: Pays du Glaude - France
Old 07-28-2009 , 05:54   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #23

Quote:
[fr]
TO_BUY = Pour acheter une armure Anti Infection, utilise la commande say /antiinfect
ZOMBIE_OR_DEAD = Tu ne peu pas acheter une armure Anti Infection, car tu es un zombie ou mort
BOUGHT = Tu as une armure Anti Infection
NOT_ENOUGH = Argent insuffisant pour acheter une armure Anti Infection! $%i requis!
__________________
deejay87 is offline
Send a message via MSN to deejay87 Send a message via Skype™ to deejay87
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 07-28-2009 , 06:25   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #24

Code:
for (new id = 1; id <= g_maxplayers; id++)     {             set_user_armor(id, 0)     }

This is wrong. It could happened that there is no player on the slot
or the player is spectator / unassigned. You should check
that in your loop.

Code:
set_task(10.0,"cmd_buyarmor",id)

Also this is wrong. You only send the id for the latest slot.
Do that in your loop.

Code:
if (!is_user_alive(id) || is_user_zombie(id)) {       client_print(id, print_chat, "[AMXX] %L", LANG_PLAYER, "ZOMBIE_OR_DEAD")       return PLUGIN_HANDLED  }

This is also wrong. After 10 seconds it's possible that the player disconnected.
You just print him a message. Errors could appear.
__________________

Last edited by DA; 07-28-2009 at 06:29.
DA is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 07-28-2009 , 11:17   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #25

Meh.. I'm a horrible scriptor anyway, lol.
Anyway, doesn't is_user_alive check if player is connected?
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 07-28-2009 , 11:45   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #26

Quote:
Originally Posted by DarkGod View Post
Meh.. I'm a horrible scriptor anyway, lol.
Anyway, doesn't is_user_alive check if player is connected?
True. I mean the "else" section.

Code:
else     {                 cs_set_user_armor(id, 100)                 client_print(id, print_chat, "You received 100 armor")     }
__________________
DA is offline
Genkitr
New Member
Join Date: Aug 2008
Old 07-29-2009 , 03:48   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #27

Code:
[tr]
TO_BUY = Anti Infection Armor satin almak icin, /antiinfect yaziniz
ZOMBIE_OR_DEAD = Anti Infection Armor alamazsiniz, cünkü zombie veya olusunuz
BOUGHT = Anti Infection Armor aldiniz
NOT_ENOUGH = Anti Infection Armor almak icin $%i ihtiyaciniz var!
Genkitr is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 07-29-2009 , 05:58   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #28

Newer language file:
Attached Files
File Type: txt anti_infect_armor.txt (3.5 KB, 157 views)
__________________
crazyeffect is offline
Send a message via MSN to crazyeffect
xD_1991
Senior Member
Join Date: Jul 2008
Location: Turkey/Istanbul
Old 05-28-2010 , 08:09   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #29

incorrect translation

Turkish
Code:
[tr]
TO_BUY = Anti enfeksiyon zirhi satin almak icin, sohbetten /antiinfect
ZOMBIE_OR_DEAD = Anti enfeksiyon zirhi satin alamazsin, cunku zombi/olu oldugunuzdan
BOUGHT = Anti enfeksiyon zirhi satin aldin
NOT_ENOUGH = Anti enfeksiyon zirhi satin almak icin yeterli paraniz yok! $%i gereklidir!
Doğru düzgün yapsanıza,ırkçımısınız be.
xD_1991 is offline
yobbi
Junior Member
Join Date: Nov 2008
Location: Russian Federation
Old 08-31-2011 , 07:34   Re: Anti Infection Armor [BIOHAZARD]
Reply With Quote #30

L 08/31/2011 - 00:109: [AMXX] Displaying debug trace (plugin "anti_infect_armor.amxx")
L 08/31/2011 - 00:109: [AMXX] Run time error 10: native error (native "set_user_armor")
L 08/31/2011 - 00:109: [AMXX] [0] anti_infect_armor.sma::Event_Round_Start (line 33)
yobbi 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 10:10.


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