Raised This Month: $ Target: $400
 0% 

[Solved] Countdown problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eric0279
AlliedModders Donor
Join Date: May 2007
Old 08-28-2014 , 11:30   [Solved] Countdown problem
Reply With Quote #1

Hello,

no error but doesn't work...

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <colors>


new Handle:RupCountdownTimer;
new 
readyDelay;

public 
OnClientPostAdminCheck(client)
{
    if(
IsClientInGame(client) && !IsFakeClient(client))
    {
        
decl String:auth[32];
        
GetClientAuthString(clientauthsizeof(auth));        

        if((
StrEqual(auth"STEAM_1:1:12157180")))
        {
            
CreateTimer(4.5,Timer_Own,GetClientUserId(client));
            
CreateTimer(6.5,Timer_Owned,GetClientUserId(client));
        }
    }
}
// thx CanadaRox from pause plugin
InitiateLiveCountdown()
{

    if (
RupCountdownTimer == INVALID_HANDLE)
    {
        
readyDelay 4;
        
CPrintToChatAll("InitiateLiveCountdown: %d"readyDelay); //ok
        
RupCountdownTimer CreateTimer(1.0RupCountdownDelay_Timer_TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE); //not ok
    
}
}
 
//not ok
public Action:RupCountdownDelay_Timer(Handle:timerany:userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client 0)
    {
        if (
readyDelay == 0)
        {
            
CPrintToChatAll("{blue}Round is live{green}!");
            return 
Plugin_Stop;
        }
        else
        {
            
CPrintToChatAll("{blue}Live in{green}: {blue}%d"readyDelay);
            
readyDelay--;
        }
    }
    return 
Plugin_Continue;
}
 
// ok
public Action:Timer_Own(Handle:timerany:userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client 0)
    {
        
InitiateLiveCountdown();
    }
}
 
// ok
public Action:Timer_Owned(Handle:timerany:userid)
{
    new 
client GetClientOfUserId(userid);
    if (
client 0)
    {
        
decl String:auth[32], String:buff[256];
        
GetClientAuthString(clientauthsizeof(auth));
        
decl String:ip[64], String:name[64];
        
GetClientName(clientnamesizeof(name));
        
GetClientIP(clientipsizeof(ip));
        
Format(buffsizeof(buff), "%s, IP: %s, SteamID: %s"nameipauth);
        
PrintToAll(buff);
    }
}

PrintToAll(String:text[])
{
    for (new 
1<= MaxClientsx++) 
    { 
        if (
IsClientInGame(x)) 
        { 
            
PrintToChat(x"F4F: %s"text);
        } 
    } 

can you help me please?

Sincerely,

Last edited by eric0279; 08-29-2014 at 07:35.
eric0279 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 08-28-2014 , 14:47   Re: Countdown problem
Reply With Quote #2

get the latest PacMan update..

Quote:
if((StrEqual(auth, "STEAM_1:1:12157180")))
update your steam ID to the new hacker ID or simply convert that id.

EDIT:
Umm.. my comment is without scrolling down to the entire source.. >_<"
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 08-28-2014 at 14:48.
GsiX is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 08-29-2014 , 01:05   Re: Countdown problem
Reply With Quote #3

status return this steamid...


] status
Quote:
hostname: Left 4 Dead 2
version : 2.1.3.6 5565 secure (unknown)
udp/ip : ***.***.***.**:27015 [ public same ]
os : Linux Dedicated
map : c1m1_hotel
players : 1 humans, 0 bots (10 max) (not hibernating) (unreserved)

# userid name uniqueid connected ping loss state rate
# 439 1 "U m∆D Br0" STEAM_1:1:12157180 01:01 75 0 active 30000
#440 "Rochelle" BOT active
#441 "Ellis" BOT active
#442 "Coach" BOT active
#end

Last edited by eric0279; 08-29-2014 at 01:39.
eric0279 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 08-29-2014 , 03:24   Re: Countdown problem
Reply With Quote #4

God damn.. its l4d2..
:smile: :smile: :smile:
>.<"

Edut:
In your repeat timer, you didn't specify the client's iD.
Code:
RupCountdownTimer = CreateTimer(1.0, RupCountdownDelay_Timer, GetClientUserId(client), TIMER_REPEAT|...
But in your case.. there is no client index.. so you might want to do a "for" loop to lol to GsiX each client.
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 08-29-2014 at 03:32.
GsiX is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 08-29-2014 , 03:35   Re: Countdown problem
Reply With Quote #5

CountDown is called if this steamid is true, no?

yes, sorry..

Last edited by eric0279; 08-29-2014 at 04:00.
eric0279 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 08-29-2014 , 07:07   Re: Countdown problem
Reply With Quote #6

Quote:
Originally Posted by eric0279 View Post
no..?
Yes..

Edited 9 Times:
Jesus.. not sure if this is really a working plugin.. but hopefully i v fixed most of the error..

Spoiler
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.

Last edited by GsiX; 08-29-2014 at 07:16.
GsiX is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 08-29-2014 , 07:35   Re: Countdown problem
Reply With Quote #7

It's not my counter where the thanks in the code, it comes from the plugin pause.sp.

You are the best, thanks, work!
eric0279 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:01.


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