Quantcast
Channel: Forum VeryGames
Viewing all articles
Browse latest Browse all 5196

Problème plugin jour et nuit

$
0
0
Bonjour,

J'ai un problème avec un plugin jour et nuit que j'ai trouvé dans un RolePlay. Je voudrais afficher l'heure en continue en PrintHintText mais ça ne fonctionne pas, comment faire ?

Code:

public OnPluginStart(){
        HookEvent("round_start", OnRoundStart);
}


public Action:OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
        new client = GetClientOfUserId(GetEventInt(event, "userid"));
        CreateTimer(0.7, horloge, client, TIMER_REPEAT);
}


public OnMapStart()
{
        startheure();
}


public startheure()
{
        Timers = CreateTimer(1.0, Timer_Horloge, _, TIMER_REPEAT);
}


public OnMapEnd()
{
        KillTimer(Timers);
}


public Action:Timer_Horloge(Handle:timer, any:client)
{
        g_countminute2 += 1;
       
        if (g_countminute2 >= 10)
        {
                g_countminute2 = 0;
                g_countminute1 = g_countminute1 + 1;
               
                if ((g_countminute1 >= 6) && (g_countminute2 >= 0))
                {
                        g_countminute1 = 0;
                        g_countheure2 = g_countheure2 + 1;
                       
                        if (g_countheure2 >= 10)
                        {
                                g_countheure2 = 0;
                                g_countheure1 = g_countheure1 + 1;
                        }
                }
        }
        if ((g_countheure1 >= 2) && (g_countheure2 >= 4))
        {
                g_countheure1 = 0;
                g_countheure2 = 0;


                for (new i = 1; i <= MaxClients; i++)
                {
                        if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) > 1)
                        {
                                //.....
                        }
                }
        }
        if (g_countheure1 == 0 && g_countheure2 == 8 && g_countminute1 == 0 && g_countminute2 == 0)
        {
                SetLightStyle(0, "l");
                PrintToChatAll("%s Le jour vient de se lever.", LOGO);
               
                new maxent = GetMaxEntities(), String:szClass[65];
       
                for (new i = MaxClients; i <= maxent; i++)
                {
                        if(IsValidEdict(i) && IsValidEntity(i))
                        {
                                GetEdictClassname(i, szClass, sizeof(szClass));
                                if(StrEqual("light_dynamic", szClass))
                                {
                                        RemoveEdict(i);
                                }
                        }
                }
        }
        if (g_countheure1 == 1 && g_countheure2 == 9 && g_countminute1 == 0 && g_countminute2 == 0)
        {
                SetLightStyle(0, "b");
                PrintToChatAll("%s La nuit vient de tomber.", LOGO);
        }
}


public Action:horloge(Handle:timer, any:client)
{
    for(new i = 1; i <= MaxClients; i++)
    {
        if(IsClientInGame(i))
        {
                        PrintHintText(client, "Horloge: %i%ih%i%i", g_countheure1, g_countheure2, g_countminute1, g_countminute2);
        }
    }
        return Plugin_Handled;
}

Merci :)

Viewing all articles
Browse latest Browse all 5196

Trending Articles


Vimeo 10.7.1 by Vimeo.com, Inc.


UPDATE SC IDOL: TWO BECOME ONE


KASAMBAHAY BILL IN THE HOUSE


Girasoles para colorear


Presence Quotes – Positive Quotes


EASY COME, EASY GO


Love with Heart Breaking Quotes


Re:Mutton Pies (lleechef)


Ka longiing longsem kaba skhem bad kaba khlain ka pynlong kein ia ka...


Vimeo 10.7.0 by Vimeo.com, Inc.


FORECLOSURE OF REAL ESTATE MORTGAGE


FORTUITOUS EVENT


Pokemon para colorear


Sapos para colorear


Smile Quotes


Letting Go Quotes


Love Song lyrics that marks your Heart


RE: Mutton Pies (frankie241)


Hato lada ym dei namar ka jingpyrshah jong U JJM Nichols Roy (Bah Joy) ngin...


Long Distance Relationship Tagalog Love Quotes