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

Show message 30 sec. after spawn...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 03-19-2015 , 09:11   Show message 30 sec. after spawn...
Reply With Quote #1

Hello everyone,

I have created one plugin who show message to player 30 seconds after spawn.

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

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHamHam_Spawn"player""repture_reminder"true );
}

public 
repture_reminder(id)
{
    
set_task(30.0"Show_Repture_reminder"id)
}

public 
Show_Repture_reminder(id)
{
    if (
is_user_alive(id))
    {
        new 
health get_user_health(id)
        
        
ColorChat(idGREEN"You still have^3 %d health"health)
    }

Simple..

But, 30 seconds after spawn, plugin show message to player 2 or 3 times in row, whay ?

You still have 100 health
You still have 100 health
You still have 100 health

WHAY, CAN NAYONE HELP ME ?
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-19-2015 , 10:27   Re: Show message 30 sec. after spawn...
Reply With Quote #2

Try now i edited

PHP Code:

#include <amxmodx> 
#include <colorchat> 

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "author" 


public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
register_logevent"logevent_roundstart"2"1=Round_Start" );


public 
logevent_roundstart(id

    
set_task(30.0"Show_Repture_reminder"id


public 
Show_Repture_reminder(id

    new 
Players[32 ]; 
    new 
iNum
    new 
id
    
get_playersPlayersiNum"ch" ); 
    for( --
iNumiNum >= 0iNum-- ) 
    { 
        
id PlayersiNum ];
        if (
is_user_alive(id)) 
        {   
            
ColorChat(idGREEN"You still have^3 %d health",get_user_health(id)) 
        } 
    }

__________________
Thanks everyone. #miss_you_all
indraraj striker is offline
bat
Veteran Member
Join Date: Jul 2012
Old 03-19-2015 , 10:36   Re: Show message 30 sec. after spawn...
Reply With Quote #3

PHP Code:

/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <colorchat> 
#include <hamsandwich> 

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "author" 

#define TASK_MESSAGE 1006

public plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
     
    
RegisterHamHam_Spawn"player""repture_reminder"true ); 


public 
client_disconnect(idremove_task(id TASK_MESSAGE)

public 
repture_reminder(id

    
remove_task(id TASK_MESSAGE)
    
set_task(30.0"Show_Repture_reminder"id TASK_MESSAGE


public 
Show_Repture_reminder(taskid

    new 
id taskid TASK_MESSAGE
    
if (is_user_alive(id)) 
    { 
        new 
health get_user_health(id
        
ColorChat(idGREEN"You still have^3 %d health"health
    } 

__________________
bat is offline
Send a message via Skype™ to bat
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 03-19-2015 , 16:19   Re: Show message 30 sec. after spawn...
Reply With Quote #4

THX
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
BaD CopY
Senior Member
Join Date: Oct 2014
Location: Home
Old 03-20-2015 , 05:52   Re: Show message 30 sec. after spawn...
Reply With Quote #5

Can you edit code and make to show message 30 sec. before round end ?
BaD CopY is offline
Send a message via Yahoo to BaD CopY Send a message via Skype™ to BaD CopY
indraraj striker
Veteran Member
Join Date: Mar 2014
Location: Under the water
Old 03-20-2015 , 10:17   Re: Show message 30 sec. after spawn...
Reply With Quote #6

just set the time in set task instead of 30sec put 100sec
Full round - 30
__________________
Thanks everyone. #miss_you_all
indraraj striker 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 17:53.


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