AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   EDIT - plugin turbo (https://forums.alliedmods.net/showthread.php?t=328784)

Grafitosky 11-25-2020 05:51

EDIT - plugin turbo
 
Hello, I have a turbo plugin and I want to be able to use it every 60 seconds, now I have only a well-done message that displays that in X time it can be used. Can someone change it so that it can be used every 60 seconds?



Code:

#include <sourcemod>
#include <cstrike>
#include <sdktools>
#include <sdkhooks>
#include <colorvariables>

public Plugin myinfo = {
    name        = "Turbo na 7 sekund dla vipa",
    author      = "",
    description = "Komenda dla vipa, ktora daje turbo na 7 sekund",
    version    = "0.0.0",
    url        = "-----"
};

#define IsValidAlive(%1) ( 1 <= %1 <= MaxClients && IsClientInGame(%1) && IsPlayerAlive(%1) )

int g_iZmiennaPrzetrzymujacaCzasAbySprawdzacCzyMoznaUzycKomendy[MAXPLAYERS+1];


public void OnMapStart() {
    for(int i = 0; i < MaxClients; i++)
        g_iZmiennaPrzetrzymujacaCzasAbySprawdzacCzyMoznaUzycKomendy[i] = 0;
}
public void OnPluginStart() {
        RegAdminCmd("sm_vturbo", CMD_SKILL, ADMFLAG_CUSTOM6);
}

public Action CMD_SKILL(int client, int args) {
   
    if(IsValidAlive(client))
        {
                SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.4);
                CreateTimer(7.0, TIMER_SKILL, GetClientUserId(client));
        }
                if(g_iZmiennaPrzetrzymujacaCzasAbySprawdzacCzyMoznaUzycKomendy[client] >= GetTime()) {
        PrintToChat(client, " \x02 Aby użyć jeszcze raz turbo, poczekaj \x06 %i \x02 sekund!", g_iZmiennaPrzetrzymujacaCzasAbySprawdzacCzyMoznaUzycKomendy[client] - GetTime());
        return Plugin_Handled;
        }
    g_iZmiennaPrzetrzymujacaCzasAbySprawdzacCzyMoznaUzycKomendy[client] = GetTime()+60;
    return Plugin_Handled;
}

public Action TIMER_SKILL(Handle hTimer, int userid)
{
        int client = GetClientOfUserId(userid);
       
        if(IsValidAlive(client))
        {
                SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", 1.0);
        }
}


GsiX 11-25-2020 10:02

Re: EDIT - plugin turbo
 
I write this purely and willingly from my heart and love.. i promise, no funny business.

P/S: I dont have CS:S installed so i cant test.

Edit; my instinct tell me you probably didn't need
- #include <cstrike>
- #include <sdkhooks>

Spoiler

Grafitosky 12-20-2020 10:18

Re: EDIT - plugin turbo
 
Quote:

Originally Posted by GsiX (Post 2726200)
I write this purely and willingly from my heart and love.. i promise, no funny business.

P/S: I dont have CS:S installed so i cant test.

Edit; my instinct tell me you probably didn't need
- #include <cstrike>
- #include <sdkhooks>

Spoiler


sometimes the reset time does not count pls help

GsiX 12-21-2020 04:53

Re: EDIT - plugin turbo
 
1 Attachment(s)
Try this awesome turbo.. i added cvar so you can finetune it much better.

and... no funny business. i promise. :fingercross: :fingercross:

Spoiler


Edit: I didn't test, so hopefully it work as intended.
.


All times are GMT -4. The time now is 02:40.

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