Raised This Month: $ Target: $400
 0% 

Ammo regen in every 2 mins + The screen so you can when it goes down please help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-09-2009 , 12:47   Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #1

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Ammo regen"
#define VERSION "1.3.3.7"
#define AUTHOR "Left4Dead"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_dictionary("regen.txt")
}

public 
client_authorized(id)
{
   
set_task(0.5,"Ammoregen",id// < Doesnt work
}

public 
Ammoregen(id)
{
    new 
task
    task 
set_task(4.0,"Fill")
    
client_print(idprint_chat"%L"LANG_PLAYER"AMMO_REGEN"task) << Doesnt shower above the hp or Amour Gen
    
//show_hudmessage(id, "Ammo regen in %s", Timer)
}

public 
Fill(id)
{
    
show_hudmessage(id"Here's some ammo")

X0Left4dead0X is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-09-2009 , 15:40   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #2

try

PHP Code:
public client_putinserver(id)
{
     
set_task(0.5,"Ammoregen",id)

If that doesn't work, I'd make the delay for that first set_task longer, like two seconds instead of half of a second; that can help, too.
__________________

Last edited by Bad_Bud; 01-09-2009 at 15:43.
Bad_Bud is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-09-2009 , 15:52   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #3

You should call it for spawn or even better event, because if he goes to spec for example, that's not the best thing. You can't also show hudmessage if you haven't set it. (Though I might be wrong, there can be some default hudsettings that I don't know)
SnoW is offline
Send a message via MSN to SnoW
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-09-2009 , 20:35   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #4

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <time>

#define PLUGIN "Ammo regen"
#define VERSION "1.3.3.7"
#define AUTHOR "Left4Dead"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_dictionary("regen.txt")
}

public 
client_authorized(id)
{
    
//new task
    //task = set_task(4.0,"Ammofill")
    
new time2count[31]
    
get_time("0:120:0",time2count,32//%H:%M:%S
    //time2count = time(0,120,0)
    
client_print(idprint_chat"%L"LANG_PLAYER"AMMO_REGEN"time2count)
    
//show_hudmessage(id, "Ammo regen in %s", Timer)

Someone test my code please and print screen and report bugs

regen.txt goes in addons/amxmodx/data/lang if your newb at amxmodx.
Attached Files
File Type: sma Get Plugin or Get Source (ammoregentst.sma - 658 views - 827 Bytes)
File Type: txt regen.txt (29 Bytes, 106 views)

Last edited by X0Left4dead0X; 01-09-2009 at 20:40.
X0Left4dead0X is offline
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-10-2009 , 06:28   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #5

Can anyone help..
X0Left4dead0X is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-10-2009 , 08:01   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #6

Quote:
Originally Posted by X0Left4dead0X View Post
PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <time>
 
#define PLUGIN "Ammo regen"
#define VERSION "1.3.3.7"
#define AUTHOR "Left4Dead"
 
 
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_dictionary("regen.txt")
}
 
public 
client_authorized(id)
{
    
//new task
    //task = set_task(4.0,"Ammofill")
    
new time2count[31]
    
get_time("0:120:0",time2count,32//%H:%M:%S
    //time2count = time(0,120,0)
    
client_print(idprint_chat"%L"LANG_PLAYER"AMMO_REGEN"time2count)
    
//show_hudmessage(id, "Ammo regen in %s", Timer)

Someone test my code please and print screen and report bugs

regen.txt goes in addons/amxmodx/data/lang if your newb at amxmodx.
This is scripting help, where you can ask help with your scripting. You don't ask here someone to test your code. What are you even doing, if you want this code for yourself, I doubt that you have a server to test this. You should really read the rules, because bump time is 2 weeks. I don't understand even what are you doing, why do you get that time into this? If you want to do it to make something every 2 mins, use set_task. Also as I said, don't use client_authorized.

EDIT: Btw:
Code:
public plugin_init()
      set_task(120.0, "function", 0);
public function()
{
        //loop alive players and make you thingys.
}

Last edited by SnoW; 01-10-2009 at 08:05.
SnoW is offline
Send a message via MSN to SnoW
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-10-2009 , 08:41   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #7

Try this.
Attached Files
File Type: sma Get Plugin or Get Source (ammo_regen.sma - 761 views - 2.0 KB)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
X0Left4dead0X
BANNED
Join Date: Jan 2009
Old 01-10-2009 , 09:24   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #8

Quote:
Originally Posted by SnoW View Post
This is scripting help, where you can ask help with your scripting. You don't ask here someone to test your code. What are you even doing, if you want this code for yourself, I doubt that you have a server to test this. You should really read the rules, because bump time is 2 weeks. I don't understand even what are you doing, why do you get that time into this? If you want to do it to make something every 2 mins, use set_task. Also as I said, don't use client_authorized.

EDIT: Btw:
Code:
public plugin_init()
      set_task(120.0, "function", 0);
public function()
{
        //loop alive players and make you thingys.
}
Don't post if your not gonna be help full.

Thank you connormclead is it possible to get more ammo like on every weapon in 2 minutes
and make it say above the health bar Ammo regen in %s seconds
X0Left4dead0X is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-10-2009 , 10:11   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #9

Untested.

Edit top of .sma if you want to regen ammo faster :

#define TIME_IN_SECONDS 60
Attached Files
File Type: sma Get Plugin or Get Source (ammo_regen.sma - 742 views - 2.5 KB)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 01-10-2009 , 11:29   Re: Ammo regen in every 2 mins + The screen so you can when it goes down please help.
Reply With Quote #10

Quote:
Originally Posted by X0Left4dead0X View Post
Don't post if your not gonna be help full.
If you thougth that you got no help from my post then it's fine. Still I think it was really helpful. It doesn't matter do I post "Oh my friend" and smile faces after that, People understand much better if you make simple phrases and don't talk trash.
SnoW is offline
Send a message via MSN to SnoW
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 09:15.


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