Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

Cześć mam prośbę o przerobienie pluginu.


Gapcioszek1
 Udostępnij

1 Attachment

Rekomendowane odpowiedzi

Cześć nie dawno na internecie znalazłem plugin na super moce. Jest jeden problem niektóre super moce nie zawsze działają lub słabo, także jest ich mało. Czy mógłby ktoś naprawić ten plugin oraz dodać o wiele więcej super mocy?

Oto kod:
 

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

#pragma newdecls required //nowy syntax

public Plugin myinfo =
{
    name = "Super Moce",
    author = "xBBBay //rewrited by camerdisco",
    description = "",
    version = "2.0",
    url = "http://steamcommunity.com/id/xbbbay"
};


#define ILOSC_SUPERMOCY 17
#define ILOSC_SUPERMOCYFUNKCJA ILOSC_SUPERMOCY+1
#define NAZWA_FORUM "Nazwa-Forum.pl"

int    SuperMoc[MAXPLAYERS+1];
int    Laser;
int    g_LaserModel;
int    g_HaloModel;
int    sprite_blue;
int    g_iMyWeaponsMax = 63; 
int    freeze_time;
int    ReklamaInfoo[MAXPLAYERS+1];
int    C4TimerON, C4Timer;
int    g_iJumps[MAXPLAYERS+1]
int    g_iJumpMax
int    g_fLastButtons[MAXPLAYERS+1]
int    g_fLastFlags[MAXPLAYERS+1]
int    clientlevel[MAXPLAYERS+1];


ConVar g_cvJumpBoost;
ConVar g_cvJumpMax;
ConVar g_cvJumpKnife;

Handle WelcomeTimers[MAXPLAYERS+1];
Handle DajMocTimers[MAXPLAYERS+1];

float g_flBoost    = 250.0;
float obrazenia[MAXPLAYERS+1];
float wytrzymalosc[MAXPLAYERS+1];


char nazwa_gracza[MAXPLAYERS+1][65];

char modele_serwera[][] =
{
    "",
    "models/player/ctm_fbi.mdl",
    "models/player/ctm_gign.mdl",
    "models/player/ctm_gsg9.mdl",
    "models/player/ctm_sas.mdl",
    "models/player/ctm_st6.mdl",
    "models/player/tm_anarchist.mdl",
    "models/player/tm_phoenix.mdl",
    "models/player/tm_pirate.mdl",
    "models/player/tm_balkan_variantA.mdl",
    "models/player/tm_leet_variantA.mdl"
};

char SuperMocNazwy[ILOSC_SUPERMOCYFUNKCJA][] =
{
    {""}, //0
    {"Każde trafienie zabija"}, //1
    {"Tank"}, //2
    {"Wampir"}, //3
    {"Wallhack"}, //4
    {"Ninja"}, //5
    {"Grawitacja"}, //6
    {"Kamienna skóra"}, //7
    {"Super prędkość"}, //8
    {"Nieskończona amunicja"}, //9
    {"Medyk"}, //10
    {"Kameleon"}, //11
    {"Nożownik"}, //12
    {"Szybkostrzelność"}, //13
    {"Bogacz"}, //14
    {"Boomer"}, //15
    {"Jumper"}, //16
    {"Morfina"} //17
};
char SuperMocOpisy[ILOSC_SUPERMOCYFUNKCJA][] =
{
    {""},
    {"+1000 DMG z każdej broni"},
    {"Dostajesz +1000HP"},
    {"Gdy zadajesz dmg przeciwnikowi, dostajesz dodatkowe hp"},
    {"Posiadasz wallhacka, czerwona linia wskaże przeciwników"},
    {"30% widoczności"},
    {"Zmniejszona grawitacja"},
    {"-75% otrzymanych obrażeń"},
    {"2.5 raza szybsze chodzenie"},
    {"Amunicja nigdy się nie kończy"},
    {"4 Apteczki, możesz leczyć członków drużyny strzelając w nich"},
    {"Posiadasz ubranie wroga"},
    {"Natychmiastowe zabicie z noża"},
    {"Szybciej strzelasz"},
    {"+16000$"},
    {"Po śmierci wybuchasz, zabijasz przeciwników obok siebie"},
    {"Posiadasz +10 dodatkowych skoków"},
    {"Posiadasz 1/8 szans na ponowne odrodzenie po śmierci"}
};

public void OnPluginStart()
{
    CreateConVar("Super Moce", "2.0", "xBBBay");
    
    CreateTimer(0.1, UpdateLine, 0, 1);
    CreateTimer(5.0, SetCvars, 0, 1);
    
    Laser = -1;
    
    HookEvent("weapon_fire",  EventWeaponFire);
    HookEvent("player_spawn", PlayerSpawn);
    HookEvent("player_death", PlayerDeath);
    
    HookEvent("round_freeze_end", PoczatekRundy);
    HookEvent("round_start", NowaRunda);
    HookEvent("bomb_planted", BombaPodlozona);
    HookEvent("bomb_defused", BombaRozbrojona);
    
    g_cvJumpKnife = CreateConVar("csgo_doublejump_knife", "0",    "disable(0) / enable(1) double-jumping only on Knife Level for AR (GunGame)");
    g_cvJumpBoost = CreateConVar("csgo_doublejump_boost", "300.0", "The amount of vertical boost to apply to double jumps");
    g_cvJumpMax = CreateConVar("csgo_doublejump_max", "10", "The maximum number of re-jumps allowed while already jumping");
    
    AutoExecConfig(true);
    
    HookConVarChange(g_cvJumpBoost,        convar_ChangeBoost);
    HookConVarChange(g_cvJumpMax,        convar_ChangeMax);
    
    g_flBoost        = g_cvJumpBoost.FloatValue;
    g_iJumpMax       = g_cvJumpMax.IntValue;
    
    HookEventEx("player_spawn", OnPlayerSpawn, EventHookMode_Post);
}
public void OnMapStart()
{
    for(int i = 1; i < sizeof modele_serwera; i++)
        PrecacheModel(modele_serwera[i]);
        
    g_LaserModel = PrecacheModel("sprites/laserbeam.vmt", true);
    g_HaloModel  = PrecacheModel("sprites/glow01.vmt", true);
    sprite_blue  = PrecacheModel("materials/sprites/blueflare1.vmt");
}
public void OnClientPutInServer(int client)
{
    SDKHook(client, SDKHook_PreThink, Prethink);
    SDKHook(client, SDKHook_OnTakeDamage, TakeDamage);
    SDKHook(client, SDKHook_WeaponEquipPost, OnWeaponEquipPost)
    GetClientName(client, nazwa_gracza[client], 64);
    
    ReklamaInfoo[client] = 0;
    WelcomeTimers[client] = CreateTimer(5.0, ReklamaInfo, client, TIMER_FLAG_NO_MAPCHANGE);
}
public void OnClientDisconnect(int client)
{
    SDKUnhook(client, SDKHook_PreThink, Prethink);
    SDKUnhook(client, SDKHook_OnTakeDamage, TakeDamage);
    SDKUnhook(client, SDKHook_WeaponEquipPost, OnWeaponEquipPost)
}
public Action TakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype)
{
    if(!IsValidClient(victim))
        return Plugin_Continue;

    if(IsValidClient(attacker) && GetClientTeam(victim) != GetClientTeam(attacker))
    {
        int dmg = 0;
        
        char weapon[32];
        GetClientWeapon(attacker, weapon, sizeof(weapon));
        
        if(SuperMoc[attacker] == 12)
        {
            if(StrEqual(weapon, "weapon_knife") && damagetype & DMG_SLASH)
            {
                dmg += GetClientHealth(victim)+1;
            }
        }
        
        damage = RoundFloat(damage+dmg)+(obrazenia[attacker]-wytrzymalosc[victim]);
    
        return Plugin_Changed;
    }
    if (IsValidClient(attacker) && IsValidClient(victim) && GetClientTeam(attacker) == GetClientTeam(victim))
    {
        if(SuperMoc[attacker] == 10)
        {
            if(SuperMoc[victim] == 2)
            {
                return Plugin_Continue;
            }
            else
            {
                if (GetClientHealth(victim) < 100)
                {
                    int ClientHealth = GetClientHealth(victim);
                    SetClientHealth(victim, ClientHealth + RoundFloat(damage * 0.2));
                }
                if (GetClientHealth(victim) > 100)
                {
                    SetClientHealth(victim, 100);
                }
                damagetype = -1;
                damage = 0.0;
            }
        }
    }
    if (IsValidClient(attacker) && IsValidClient(victim) && GetClientTeam(attacker) != GetClientTeam(victim))
    {
        if(SuperMoc[attacker] == 3)
        {
            int ClientHealth = GetClientHealth(attacker);
            SetClientHealth(attacker, ClientHealth + RoundFloat(damage * 0.2));
        }
    }
    return Plugin_Continue;
}

void SetClientHealth(int client, int amount)
{
    int HealthOffs = FindDataMapInfo(client, "m_iHealth");
    SetEntData(client, HealthOffs, amount, true);
}
public Action NowaRunda(Handle event_newround, const char[] name, bool dontBroadcast)
{
    freeze_time = 1;
}
public Action PoczatekRundy(Handle event_freezetime, const char[] name, bool dontBroadcast)
{
    C4TimerON = 0;
    freeze_time = 0;
}
public Action Prethink(int client)
{
    if(!IsValidClient(client) || IsFakeClient(client))
        return Plugin_Continue;

    if(IsPlayerAlive(client))
    {
        if(freeze_time == 0)
        {
            switch(C4TimerON)
            {
                case 0:
                {
                    PrintHintText(client, "<font size='16'><font color='#006699'>%s</font>\n<font color='#666699'>Super Moc:</font> <b>%s</b>\n<font color='#666699'>Opis Super Mocy:</font> <b>%s</b></font>", NAZWA_FORUM, SuperMocNazwy[SuperMoc[client]], SuperMocOpisy[SuperMoc[client]]);
                }
                case 1:
                {
                    if(C4Timer > 0)
                    {
                        PrintHintText(client, "<font size='16'><font color='#006699'>%s</font>\n<font color='#666699'>Super Moc:</font> <b>%s</b>\n<font color='#666699'>Bomba została podłożona\nCzas do wybuchu:</font> <b>%ds</b></font>", NAZWA_FORUM, SuperMocNazwy[SuperMoc[client]], C4Timer);
                    }
                    if(C4Timer < 1)
                    {
                        PrintHintText(client, "<font size='16'><font color='#006699'>%s</font>\n<font color='#666699'>Super Moc:</font> <b>%s</b>\n<font color='#666699'>Bomba eksplodowała</font></font>", NAZWA_FORUM, SuperMocNazwy[SuperMoc[client]]);
                    }
                }
                case 2:
                {
                    PrintHintText(client, "<font size='16'><font color='#006699'>%s</font>\n<font color='#666699'>Super Moc:</font> <b>%s</b>\n\n<font color='#666699'>Bomba została rozbrojona", NAZWA_FORUM, SuperMocNazwy[SuperMoc[client]]);
                }
            }
            
            switch(SuperMoc[client])
            {
                case 0: Odrodzenie(client);
                case ILOSC_SUPERMOCYFUNKCJA: Odrodzenie(client);
            }
        }
        if(freeze_time == 1)
        {
            int c1 = GetRandomInt(0, 9);
            int c2 = GetRandomInt(0, 9);
            int c3 = GetRandomInt(0, 9);
            int c4 = GetRandomInt(0, 9);
            int c5 = GetRandomInt(0, 9);
            int c6 = GetRandomInt(0, 9);
            PrintHintText(client, "<font size='36'>   LOSOWANIE</font><br><font size='20' color='#%d%d%d%d%d%d'>             SUPER MOCY</font>", c1, c2, c3, c4, c5, c6);
                
            switch(SuperMoc[client])
            {
                case 0: Odrodzenie(client);
                case ILOSC_SUPERMOCYFUNKCJA: Odrodzenie(client);
            }
        }
        
        if(SuperMoc[client] == 13)
        {
            float flNextPrimaryAttack = GetEntDataFloat(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"), FindSendPropInfo("CBaseCombatWeapon", "m_flNextPrimaryAttack"))-GetGameTime();
            SetEntDataFloat(GetEntPropEnt(client, Prop_Send, "m_hActiveWeapon"), FindSendPropInfo("CBaseCombatWeapon", "m_flNextPrimaryAttack"), (flNextPrimaryAttack/1.2)+GetGameTime());
        }
    }
    else
    {
        int spect = GetEntProp(client, Prop_Send, "m_iObserverMode");
        if(spect == 4 || spect == 5) 
        {
            int target = GetEntPropEnt(client, Prop_Send, "m_hObserverTarget");
            if(!(target == -1) && IsValidClient(target))
            {
                if(freeze_time == 0)
                {
                    PrintHintText(client, "<font size='16'><font color='#006699'>%s - <b>%s</b></font>\n<font color='#666699'>Super Moc:</font> <b>%s</b></font>", NAZWA_FORUM, nazwa_gracza[target], SuperMocNazwy[SuperMoc[target]]);
                }
                if(freeze_time == 1)
                {
                    int c1 = GetRandomInt(0, 9);
                    int c2 = GetRandomInt(0, 9);
                    int c3 = GetRandomInt(0, 9);
                    int c4 = GetRandomInt(0, 9);
                    int c5 = GetRandomInt(0, 9);
                    int c6 = GetRandomInt(0, 9);
                    PrintHintText(client, "<font size='36'>   LOSOWANIE</font><br><font size='20' color='#%d%d%d%d%d%d'>             SUPER MOCY</font>", c1, c2, c3, c4, c5, c6);
                }
            }
        }
    }

    return Plugin_Continue;
}
public Action PlayerSpawn(Handle event_spawn, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event_spawn, "userid"));
    if(!IsValidClient(client) || IsFakeClient(client))
        return;

    Odrodzenie(client);
}

public Action Odrodzenie(int client)
{
    if(!IsValidClient(client) || !IsPlayerAlive(client))
        return;
    
    CS_UpdateClientModel(client);
    SetEntityHealth(client, 100);
    SetEntityRenderMode(client, RENDER_TRANSCOLOR);
    SetEntityRenderColor(client, 255, 255, 255, 255);
    obrazenia[client] = 0.0;
    wytrzymalosc[client] = 0.0;
    SetEntityGravity(client, 1.0);
    SetClientSpeed(client, 1.0);
    Laser = -1;
    SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(1, 5)]: modele_serwera[GetRandomInt(6, 10)]);
    
    for(int x = 0; x <= g_iMyWeaponsMax; x++) 
    { 
        int index = GetEntPropEnt(client, Prop_Send, "m_hMyWeapons", x); 
        if(index && IsValidEdict(index)) 
        { 
            char classname[64]; 
            GetEdictClassname(index, classname, sizeof(classname)); 
            if(StrEqual("weapon_healthshot", classname)) 
            { 
                RemoveWeaponDrop(client, index); 
            }
        } 
    } 
    
    int randomnum = GetRandomInt(1, ILOSC_SUPERMOCY);
    
    SuperMoc[client] = randomnum;
    
    DajMocTimers[client] = CreateTimer(5.0, DajMoc, client, TIMER_FLAG_NO_MAPCHANGE);
}
public Action DajMoc(Handle timer, any client)
{
    if(!IsValidClient(client))
        return;
        
    switch(SuperMoc[client])
    {
        case 1: obrazenia[client] = 1000.0;
        case 2: SetEntData(client, FindDataMapInfo(client, "m_iHealth"), 100*10);
        case 4: Laser = client;
        case 5:
        {
            SetEntityRenderMode(client, RENDER_TRANSCOLOR);
            SetEntityRenderColor(client, 255, 255, 255, 255);
        }
        case 6: SetEntityGravity(client, 0.3)
        case 7: wytrzymalosc[client] = 30.0;
        case 8: SetClientSpeed(client, 5.0)
        case 10:
        {
            GivePlayerItem(client, "weapon_healthshot", 0);
            GivePlayerItem(client, "weapon_healthshot", 0);
            GivePlayerItem(client, "weapon_healthshot", 0);
            GivePlayerItem(client, "weapon_healthshot", 0);
        }
        case 11: SetEntityModel(client, (GetClientTeam(client) == CS_TEAM_CT)? modele_serwera[GetRandomInt(6, 10)]: modele_serwera[GetRandomInt(1, 5)]);
        case 14: SetEntData(client, FindSendPropInfo("CCSPlayer", "m_iAccount"), 16000);
    }
}
void RemoveWeaponDrop(int client, int entity) 
{ 
    CS_DropWeapon(client, entity, true, true); 
    AcceptEntityInput(entity, "Kill") 
}
public Action PlayerDeath(Handle event_death, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event_death, "userid"));
    int killer = GetClientOfUserId(GetEventInt(event_death, "attacker"));
    
    if(!IsValidClient(client) || !IsValidClient(killer))
        return;
    
    if(GetClientTeam(client) != GetClientTeam(killer))
    {
        PrintToChat(client, "\x01[\x04SuperMoce\x01] Zabiłeś zabity przez: %s", nazwa_gracza[killer]);
        PrintToChat(client, "\x01[\x04SuperMoce\x01] Jego Super moc to: %s", SuperMocNazwy[SuperMoc[killer]]);
    }
    switch(SuperMoc[client])
    {
        case 15:
        {
            float fOrigin[3];
            float iOrigin[3];
            GetClientEyePosition(client, fOrigin);

            for(int i = 1; i <= MaxClients; i++)
            {
                if(!IsClientInGame(i) || !IsPlayerAlive(i))
                    continue;

                if(GetClientTeam(client) == GetClientTeam(i))
                    continue;

                GetClientEyePosition(i, iOrigin);
                if(GetVectorDistance(fOrigin, iOrigin) <= 500.0)
                    SDKHooks_TakeDamage(i, client, client, (1000.0+GetClientHealth(i)), DMG_GENERIC);
            }

            TE_SetupExplosion(fOrigin, sprite_blue, 10.0, 1, 0, 200, 200);
            TE_SendToAll();
        }
        case 17:
        {
            if(GetRandomInt(1, 8) == 1)
                CreateTimer(0.1, Wskrzes, client, TIMER_FLAG_NO_MAPCHANGE);
        }
    }
}
public Action Wskrzes(Handle timer, any client)
{
    if(!IsValidClient(client))
        return;

    CS_RespawnPlayer(client);
}

public Action EventWeaponFire(Event gEventHook, const char[] gEventName, bool iDontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(gEventHook, "userid")); 

    if(SuperMoc[client] == 9)
    {
        int iWeapon = Client_GetActiveWeapon(client);

        if(IsValidEdict(iWeapon))
        {
            Weapon_SetPrimaryClip(iWeapon, Weapon_GetPrimaryClip(iWeapon) + 1);
        }
    }
}

stock int Client_GetActiveWeapon(int client)
{
    int weapon =  GetEntPropEnt(client, Prop_Data, "m_hActiveWeapon");
    
    if (!Entity_IsValid(weapon)) {
        return INVALID_ENT_REFERENCE;
    }
    
    return weapon;
}

stock int Entity_IsValid(int entity)
{
    return IsValidEntity(entity);
} 

stock int Weapon_GetPrimaryClip(int weapon)
{
    return GetEntProp(weapon, Prop_Data, "m_iClip1");
}

stock int Weapon_SetPrimaryClip(int weapon, int value)
{
    SetEntProp(weapon, Prop_Data, "m_iClip1", value);
}

public void SetClientSpeed(int client, float speed) 
{ 
    SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue",speed)
}

public Action SetCvars(Handle timer)
{
    ServerCommand("sv_disable_immunity_alpha 1");
    ServerCommand("sv_hibernate_when_empty 0");
    ServerCommand("mp_limitteams 0");
    ServerCommand("mp_autoteambalance 0");
    ServerCommand("mp_friendlyfire 1");
    ServerCommand("mp_freezetime 9");
    ServerCommand("mp_roundtime 1.75");
    ServerCommand("mp_roundtime_defuse 1.75");
    ServerCommand("mp_roundtime_hostage 1.75");
}

public Action UpdateLine(Handle timer)
{
    for(int i = 1; i <= MaxClients; i++)
    {
        if(!IsValidClient(i))
            return;
        
        if (IsClientInGame(i) && IsPlayerAlive(i))
        {    
            if (Laser != -1)
            {
                if(!IsValidClient(Laser))
                    return;
            
                if (GetClientTeam(Laser) != GetClientTeam(i))
                {
                    int color[4] = {255,0,0,200};
                    TE_SetupBeamLaser(i, Laser, g_LaserModel, g_HaloModel, 1, 1, 0.1, 2.0, 1.0, 1, 0.0, color, 1);
                    TE_SendToClient(Laser, 0.0);
                }
            }
        }
        i++;
    }
    return;
}

public Action ReklamaInfo(Handle timer, any client)
{
    if(!IsValidClient(client))
        return;
        
    switch(ReklamaInfoo[client])
    {
        case 0:
        {
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Witaj \x04%s\x01 na serwerze [\x04Super Moce\x01]!", nazwa_gracza[client]);
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Życzymy miłej gry!");
            
            if(GetUserFlagBits(client) & ADMFLAG_CUSTOM1)
            {
                PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Jesteś VIP'em.");
            }
        
            ReklamaInfoo[client] = 1;
        }
        case 1:
        {
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Jeżeli chcesz kupić VIP'a wpisz\x01 /vip");
            ReklamaInfoo[client] = 2;
        }
        case 2:
        {
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] HeadAdmin serwera to: \x04xBBBay");
            ReklamaInfoo[client] = 3;
        }
        case 3:
        {
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Nasze forum to: \x04%s", NAZWA_FORUM);
            ReklamaInfoo[client] = 4;
        }
        case 4:
        {
            PrintToChat(client, "\x0B\x01[\x04SuperMoce\x01] Jeżeli znalazłeś błąd zgłoś to do \x04HeadAdmina\x01!");
            ReklamaInfoo[client] = 1;
        }
    }

    WelcomeTimers[client] = CreateTimer(40.0, ReklamaInfo, client, TIMER_FLAG_NO_MAPCHANGE);
}

public Action BombaPodlozona(Handle event_bomb_planted, const char[] name, bool dontBroadcast)
{
    C4TimerON = 1;
    C4Timer = 40;
    C4Timer--;
    CreateTimer(1.0, C4Timerek, TIMER_FLAG_NO_MAPCHANGE);
}

public Action C4Timerek(Handle timer)
{
    if(C4TimerON == 1)
    {
        C4Timer--;
        CreateTimer(1.0, C4Timerek, TIMER_FLAG_NO_MAPCHANGE);
    }
}

public Action BombaRozbrojona(Handle event_bomb_defused, const char[] name, bool dontBroadcast)
{
    C4TimerON = 2;
}

public void OnWeaponEquipPost(int client, int weapon)
{
    clientlevel[client] = 0
    if (g_cvJumpKnife) 
    {
        if(LastLevel(client) == true)
        {
            clientlevel[client] = 1
        }
    }    
}
public Action OnPlayerSpawn(Handle event, const char[] name, bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "userid"))
    clientlevel[client] = 0
    if (g_cvJumpKnife.IntValue == 1)
    {
        if(LastLevel(client) == true)
        {
            clientlevel[client] = 1
        }
    }    
}

public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
    if(SuperMoc[client] == 16)
    {
        DoubleJump(client)
    }
}

void DoubleJump(int client)
{
    int fCurFlags = GetEntityFlags(client), fCurButtons = GetClientButtons(client)
    if (g_fLastFlags[client] & FL_ONGROUND)
    {
        if (!(fCurFlags & FL_ONGROUND) && !(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
        {
            OriginalJump(client)
        }
    }
    else if (fCurFlags & FL_ONGROUND)
    {
        Landed(client)
    }
    else if (!(g_fLastButtons[client] & IN_JUMP) && fCurButtons & IN_JUMP)
    {
        ReJump(client)
    }
    g_fLastFlags[client]    = fCurFlags
    g_fLastButtons[client]    = fCurButtons
}

void OriginalJump(int client)
{
    g_iJumps[client]++
}

void Landed(int client)
{
    g_iJumps[client] = 0
}

void ReJump(int client)
{
    if ( 1 <= g_iJumps[client] <= g_iJumpMax)
    {
        g_iJumps[client]++
        float vVel[3]
        GetEntPropVector(client, Prop_Data, "m_vecVelocity", vVel)
        vVel[2] = g_flBoost
        TeleportEntity(client, NULL_VECTOR, NULL_VECTOR, vVel)
    }
}

public void convar_ChangeBoost(Handle convar, const char[] oldVal, const char[] newVal)
{
    g_flBoost = StringToFloat(newVal)
}

public void convar_ChangeMax(Handle convar, const char[] oldVal, const char[] newVal)
{
    g_iJumpMax = StringToInt(newVal)
}

public bool LastLevel(int client)
{
    if(IsValidClient(client) && IsPlayerAlive(client))
    {
        int weapon_count = 0
        for(int i = 0; i <= 4; i++)
        {
            int wpn = GetPlayerWeaponSlot(client, i)
            if(wpn != -1)
            {
                weapon_count++
            }
        }
        if(weapon_count == 1)
            return true;
        else
            return false;
    }
    return false
}

public bool IsValidClient(int client)
{
    if(client >= 1 && client <= MaxClients && IsClientInGame(client))
        return true;

    return false;
} 

 

supermoce1.sp

Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
 Udostępnij

×
×
  • Dodaj nową pozycję...