Raised This Month: $ Target: $400
 0% 

Warning countdown


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fireflasch7
Junior Member
Join Date: Feb 2015
Old 09-12-2015 , 06:55   Warning countdown
Reply With Quote #1

Hello,
can anyone explane me please how to make a Warning countdown that counts from 10 to one?
Thank you very much.
Regards Fireflasch7
Fireflasch7 is offline
bally
Senior Member
Join Date: Aug 2015
Old 09-12-2015 , 07:01   Re: Warning countdown
Reply With Quote #2

timers ^^
https://wiki.alliedmods.net/Timers_(SourceMod_Scripting)
bally is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 09-12-2015 , 07:18   Re: Warning countdown
Reply With Quote #3

Here's an actual example of using the PrintHintText for a countdown.
Code:
int Time = 10;

public Action Timer_CountDown(Handle timer, any client)
{
    if (!IsClientInGame(client) || !IsPlayerAlive(client))
        return Plugin_Stop;

    PrintHintText(client, "Warning!\nSomething will happen in: %i seconds", Time);
    Time--;

    if (Time <= 1)
    {
        return Plugin_Stop;
    }
    return Plugin_Continue;
}

Last edited by Maxximou5; 09-12-2015 at 07:20.
Maxximou5 is offline
Fireflasch7
Junior Member
Join Date: Feb 2015
Old 09-12-2015 , 11:18   Re: Warning countdown
Reply With Quote #4

Thank you very much Maxximou5
Fireflasch7 is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 09-12-2015 , 16:28   Re: Warning countdown
Reply With Quote #5

You're welcome. I remember looking for this tidbit when I was reading about timers and didn't find it either.
Maxximou5 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:27.


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