- Skocz do zawartości
Headshotplay

Prośba o aktualizację pluginów

Rekomendowane odpowiedzi

Witam,

Mógłby ktoś aktualizować te pluginy ?

Abner_res:

Spoiler
Cytat

#include <sourcemod>
#include <sdktools>
#include <colors>
#include <clientprefs>
#include <cstrike>

bool soundLib;


#include <abnersound>

#pragma newdecls required
#pragma semicolon 1
#define PLUGIN_VERSION "4.0.1"


//Cvars
ConVar g_hCTPath;
ConVar g_hTRPath;
ConVar g_hDrawPath;
ConVar g_hPlayType;
ConVar g_hStop;
ConVar g_PlayPrint;
ConVar g_ClientSettings; 
ConVar g_SoundVolume;
ConVar g_playToTheEnd;

bool SamePath = false;
Handle g_ResPlayCookie;
Handle g_ResVolumeCookie;

//Sounds Arrays
ArrayList ctSoundsArray;
ArrayList trSoundsArray;
ArrayList drawSoundsArray;
StringMap soundNames;

public Plugin myinfo =
{
    name             = "[CS:GO/CSS] AbNeR Round End Sounds",
    author             = "abnerfs",
    description     = "Play cool musics when round ends!",
    version         = PLUGIN_VERSION,
    url             = "https://github.com/abnerfs/round_end_sounds"
}

public void OnPluginStart()
{  
    //Cvars
    CreateConVar("abner_res_version", PLUGIN_VERSION, "Plugin version", FCVAR_NOTIFY|FCVAR_REPLICATED);
    
    g_hTRPath                  = CreateConVar("res_tr_path", "misc/tecnohard", "Path of sounds played when Terrorists Win the round");
    g_hCTPath                  = CreateConVar("res_ct_path", "misc/tecnohard", "Path of sounds played when Counter-Terrorists Win the round");
    g_hDrawPath                   = CreateConVar("res_draw_path", "1", "Path of sounds played when Round Draw or 0 - Don´t play sounds, 1 - Play TR sounds, 2 - Play CT sounds");
        
    g_hPlayType                = CreateConVar("res_play_type", "1", "1 - Random, 2 - Play in queue");
    g_hStop                    = CreateConVar("res_stop_map_music", "1", "Stop map musics");    
    
    g_PlayPrint                = CreateConVar("res_print_to_chat_mp3_name", "1", "Print mp3 name in chat (Suggested by m22b)");
    g_ClientSettings           = CreateConVar("res_client_preferences", "1", "Enable/Disable client preferences");

    g_SoundVolume                = CreateConVar("res_default_volume", "0.75", "Default sound volume.");
    g_playToTheEnd                = CreateConVar("res_play_to_the_end", "0", "Play sounds to the end.");
    
    //ClientPrefs
    g_ResPlayCookie = RegClientCookie("AbNeR Round End Sounds", "", CookieAccess_Private);
    g_ResVolumeCookie = RegClientCookie("abner_res_volume", "Round end sound volume", CookieAccess_Private);

    SetCookieMenuItem(SoundCookieHandler, 0, "AbNeR Round End Sounds");
    
    LoadTranslations("common.phrases");
    LoadTranslations("abner_res.phrases");
    AutoExecConfig(true, "abner_res");

    /* CMDS */
    RegAdminCmd("res_refresh", CommandLoad, ADMFLAG_SLAY);
    RegConsoleCmd("res", abnermenu);
        
    
    /* EVENTS */
    HookEvent("round_start", Event_RoundStart, EventHookMode_PostNoCopy);
    
    soundLib = (GetFeatureStatus(FeatureType_Native, "GetSoundLengthFloat") == FeatureStatus_Available);

    ctSoundsArray = new ArrayList(512);
    trSoundsArray = new ArrayList(512);
    drawSoundsArray = new ArrayList(512);
    soundNames = new StringMap();
}

stock bool IsValidClient(int client)
{
    if(client <= 0 ) return false;
    if(client > MaxClients) return false;
    if(!IsClientConnected(client)) return false;
    return IsClientInGame(client);
}

int TRWIN[] = {0, 3, 8, 12, 17, 18};
int CTWIN[] = {4, 5, 6, 7, 10, 11, 13, 16, 19};

bool IsCTReason(int reason) {
    for(int i = 0;i<sizeof(CTWIN);i++)
        if(CTWIN == reason) return true;

    return false;
}

bool IsTRReason(int reason) {
    for(int i = 0;i<sizeof(TRWIN);i++)
        if(TRWIN == reason) return true;

    return false;
}

int GetWinner(int reason) {
    if(IsTRReason(reason))
        return 2;

    if(IsCTReason(reason))
        return 3;

    return 0;
}



public Action CS_OnTerminateRound(float &delay, CSRoundEndReason &reason)
{
    int winner = GetWinner(view_as<int>(reason));
    bool random = GetConVarInt(g_hPlayType) == 1;

    char szSound[128];

    bool Success = false;
    if((winner == CS_TEAM_CT && SamePath) || winner == CS_TEAM_T) 
        Success = GetSound(trSoundsArray, g_hTRPath, random, szSound, sizeof(szSound));
    else if(winner == CS_TEAM_CT) 
        Success = GetSound(ctSoundsArray, g_hCTPath, random, szSound, sizeof(szSound));
    else 
        Success = GetSound(drawSoundsArray, g_hDrawPath, random, szSound, sizeof(szSound));
    
    if(Success) {
        PlayMusicAll(szSound);

        if(GetConVarInt(g_hStop) == 1)
            StopMapMusic();

        if(GetConVarBool(g_playToTheEnd) && soundLib) {
            float length = soundLenght(szSound);
            delay = length;
            return Plugin_Changed;
        }
    }

    return Plugin_Continue;
}


void PlayMusicAll(char[] szSound)
{
    for (int i = 1; i <= MaxClients; i++)
    {
        if(IsValidClient(i) && (GetConVarInt(g_ClientSettings) == 0 || GetIntCookie(i, g_ResPlayCookie) == 0))
        {
            float selectedVolume = GetClientVolume(i);
            PlaySoundClient(i, szSound, selectedVolume);
        }
    }
    
    if(GetConVarInt(g_PlayPrint) == 1)
    {
        char soundKey[100];
        char soundPrint[512];
        char buffer[20][255];
        
        int numberRetrieved = ExplodeString(szSound, "/", buffer, sizeof(buffer), sizeof(buffer[]), false);
        if (numberRetrieved > 0)
            Format(soundKey, sizeof(soundKey), buffer[numberRetrieved - 1]);
        
        soundNames.GetString(soundKey, soundPrint, sizeof(soundPrint));
                        
        CPrintToChatAll("{green}[Muzyka] {default}%t", "mp3 print", !StrEqual(soundPrint, "") ? soundPrint : szSound);
    }
}


public void Event_RoundStart(Handle event, const char[] name, bool dontBroadcast)
{
    if(GetConVarInt(g_hStop) == 1)
    {
        MapSounds();
    }
}

public void SoundCookieHandler(int client, CookieMenuAction action, any info, char[] buffer, int maxlen)
{
    abnermenu(client, 0);


public void OnClientPutInServer(int client)
{
    if(GetConVarInt(g_ClientSettings) == 1)
    {
        CreateTimer(3.0, msg, client);
    }
}

public Action msg(Handle timer, any client)
{
    if(IsValidClient(client))
    {
        CPrintToChat(client, "{default}{green}[Muzyka] {default}%t", "JoinMsg");
    }
}

public Action abnermenu(int client, int args)
{
    if(GetConVarInt(g_ClientSettings) != 1)
    {
        return Plugin_Handled;
    }
    
    int cookievalue = GetIntCookie(client, g_ResPlayCookie);
    Handle g_CookieMenu = CreateMenu(AbNeRMenuHandler);
    SetMenuTitle(g_CookieMenu, "Round End Sounds by AbNeR_CSS");
    char Item[128];
    if(cookievalue == 0)
    {
        Format(Item, sizeof(Item), "%t %t", "RES_ON", "Selected"); 
        AddMenuItem(g_CookieMenu, "ON", Item);
        Format(Item, sizeof(Item), "%t", "RES_OFF"); 
        AddMenuItem(g_CookieMenu, "OFF", Item);
    }
    else
    {
        Format(Item, sizeof(Item), "%t", "RES_ON");
        AddMenuItem(g_CookieMenu, "ON", Item);
        Format(Item, sizeof(Item), "%t %t", "RES_OFF", "Selected"); 
        AddMenuItem(g_CookieMenu, "OFF", Item);
    }

    Format(Item, sizeof(Item), "%t", "VOLUME");
    AddMenuItem(g_CookieMenu, "volume", Item);


    SetMenuExitBackButton(g_CookieMenu, true);
    SetMenuExitButton(g_CookieMenu, true);
    DisplayMenu(g_CookieMenu, client, 30);
    return Plugin_Continue;
}

public int AbNeRMenuHandler(Handle menu, MenuAction action, int client, int param2)
{
    Handle g_CookieMenu = CreateMenu(AbNeRMenuHandler);
    if (action == MenuAction_DrawItem)
    {
        return ITEMDRAW_DEFAULT;
    }
    else if(param2 == MenuCancel_ExitBack)
    {
        ShowCookieMenu(client);
    }
    else if (action == MenuAction_Select)
    {
        switch (param2)
        {
            case 0:
            {
                SetClientCookie(client, g_ResPlayCookie, "0");
                abnermenu(client, 0);
            }
            case 1:
            {
                SetClientCookie(client, g_ResPlayCookie, "1");
                abnermenu(client, 0);
            }
            case 2: 
            {
                VolumeMenu(client);
            }
        }
        CloseHandle(g_CookieMenu);
    }
    else if(action == MenuAction_End)
    {
        delete menu;
    }
    return 0;
}

void VolumeMenu(int client){
    

    float volumeArray[] = { 1.0, 0.75, 0.50, 0.25, 0.10 };
    float selectedVolume = GetClientVolume(client);

    Menu volumeMenu = new Menu(VolumeMenuHandler);
    volumeMenu.SetTitle("%t", "Sound Menu Title");
    volumeMenu.ExitBackButton = true;

    for(int i = 0; i < sizeof(volumeArray); i++)
    {
        char strInfo[10];
        Format(strInfo, sizeof(strInfo), "%0.2f", volumeArray);

        char display[20], selected[5];
        if(volumeArray == selectedVolume)
            Format(selected, sizeof(selected), "%t", "Selected");

        Format(display, sizeof(display), "%s %s", strInfo, selected);

        volumeMenu.AddItem(strInfo, display);
    }

    volumeMenu.Display(client, MENU_TIME_FOREVER);
}

public int VolumeMenuHandler(Menu menu, MenuAction action, int client, int param2)
{
    if(action == MenuAction_Select){
        char sInfo[10];
        GetMenuItem(menu, param2, sInfo, sizeof(sInfo));
        SetClientCookie(client, g_ResVolumeCookie, sInfo);
        VolumeMenu(client);
    }
    else if(param2 == MenuCancel_ExitBack)
    {
        abnermenu(client, 0);
    }
    else if(action == MenuAction_End)
    {
        delete menu;
    }
}


public void OnMapStart()
{
    RefreshSounds(0);
}

void RefreshSounds(int client)
{
    char trSoundPath[PLATFORM_MAX_PATH];
    char ctSoundPath[PLATFORM_MAX_PATH];
    char drawSoundPath[PLATFORM_MAX_PATH];
    
    GetConVarString(g_hTRPath, trSoundPath, sizeof(trSoundPath));
    GetConVarString(g_hCTPath, ctSoundPath, sizeof(ctSoundPath));
    GetConVarString(g_hDrawPath, drawSoundPath, sizeof(drawSoundPath));
        
    SamePath = StrEqual(trSoundPath, ctSoundPath);

    if(SamePath)
    {
        ReplyToCommand(client, "[Muzyka] SOUNDS: %d sounds loaded from \"sound/%s\"", LoadSounds(trSoundsArray, g_hTRPath), trSoundPath);
    }
    else
    {
        ReplyToCommand(client, "[Muzyka] CT SOUNDS: %d sounds loaded from \"sound/%s\"", LoadSounds(ctSoundsArray, g_hCTPath), ctSoundPath);
        ReplyToCommand(client, "[Muzyka] TR SOUNDS: %d sounds loaded from \"sound/%s\"", LoadSounds(trSoundsArray, g_hTRPath), trSoundPath);
    }
    
    int RoundDrawOption = GetConVarInt(g_hDrawPath);
    if(RoundDrawOption != 0)
        switch(RoundDrawOption)
        {
            case 1:
            {
                drawSoundsArray = trSoundsArray;
                g_hDrawPath = g_hTRPath;
                ReplyToCommand(client, "[Muzyka] DRAW SOUNDS: %d sounds loaded from \"sound/%s\"", trSoundsArray.Length, trSoundPath);
            }
            case 2:
            {
                drawSoundsArray = ctSoundsArray;
                g_hDrawPath = g_hCTPath;
                ReplyToCommand(client, "[Muzyka] DRAW SOUNDS: %d sounds loaded from \"sound/%s\"", ctSoundsArray.Length, ctSoundPath);
            }
            default:
            {
                char drawSoundsPath[PLATFORM_MAX_PATH];
                GetConVarString(g_hDrawPath, drawSoundsPath, sizeof(drawSoundsPath));
                
                if(!StrEqual(drawSoundsPath, ""))
                    ReplyToCommand(client, "[Muzyka] DRAW SOUNDS: %d sounds loaded from \"sound/%s\"", LoadSounds(drawSoundsArray, g_hDrawPath), drawSoundsPath);
            }
        }
    
    ParseSongNameKvFile();
}


public void ParseSongNameKvFile()
{
    soundNames.Clear();

    char sPath[PLATFORM_MAX_PATH];
    Format(sPath, sizeof(sPath), "configs/abner_res.txt");
    BuildPath(Path_SM, sPath, sizeof(sPath), sPath);

    if (!FileExists(sPath))
        return;

    KeyValues hKeyValues = CreateKeyValues("Abner Res");
    if (!hKeyValues.ImportFromFile(sPath))
        return;

    if(hKeyValues.GotoFirstSubKey())
    {
        do
        {
            char sSectionName[255];
            char sSongName[255];

            hKeyValues.GetSectionName(sSectionName, sizeof(sSectionName));
            hKeyValues.GetString("songname", sSongName, sizeof(sSongName));
            soundNames.SetString(sSectionName, sSongName);
        }
        while(hKeyValues.GotoNextKey(false));
    }
    hKeyValues.Close();
}
 



public Action CommandLoad(int client, int args)
{   
    RefreshSounds(client);
    return Plugin_Handled;
}

float GetClientVolume(int client){
    float defaultVolume = GetConVarFloat(g_SoundVolume);

    char sCookieValue[11];
    GetClientCookie(client, g_ResVolumeCookie, sCookieValue, sizeof(sCookieValue));

    if(!GetConVarBool(g_ClientSettings) || StrEqual(sCookieValue, "") || StrEqual(sCookieValue, "0"))
        Format(sCookieValue , sizeof(sCookieValue), "%0.2f", defaultVolume);

    return StringToFloat(sCookieValue);
}

int GetIntCookie(int client, Handle handle)
{
    char sCookieValue[11];
    GetClientCookie(client, handle, sCookieValue, sizeof(sCookieValue));
    return StringToInt(sCookieValue);
}

 


 

Oraz abner_resetscore:

Spoiler
Cytat

/*
    [CSS/CS:GO] AbNeR ResetScore V1.5
    -Added admin command m_setpoints <name or #userid> <points> to set custom points.
    -sm_setscore changed to sm_setscore <name or #userid> <Kills> <Deaths><Assists><Stars><Points> in CSGO.
    -sm_setscore changed to sm_setscore <name or #userid> <Kills> <Deaths><Stars> in CSS.
    -Added sm_resetscore_savescores 1/0 - To save scores when players retry.
    -Added sm_resetscore_cost "amount" - If you want charge money by reset, 0 to disable.
    
    V1.5fix
    - Fixed an error when a invalid player disconnects.
*/


#include <sourcemod>
#include <sdktools>
#include <cstrike>
#include <colors>

#define PLUGIN_VERSION "1.5fix"
#pragma newdecls required

Handle hPluginEnable;
Handle hPublic;
Handle hSaveScores;
Handle hResetCost;
bool CSGO;

ArrayList playersList;
ArrayList scores;

public Plugin myinfo =
{
    name = "[CSS/CS:GO] AbNeR ResetScore",
    author = "AbNeR_CSS",
    description = "Type !resetscore to reset your score",
    version = PLUGIN_VERSION,
    url = "www.tecnohardclan.com"
};

public void OnPluginStart()
{  
    HookEvent("player_disconnect", PlayerDisconnect);
    
    char theFolder[40];
    GetGameFolderName(theFolder, sizeof(theFolder));
    CSGO = StrEqual(theFolder, "csgo");
    
    RegConsoleCmd("resetscore", CommandResetScore);
    RegConsoleCmd("rs", CommandResetScore);
    
    RegAdminCmd("sm_resetplayer", CommandResetPlayer, ADMFLAG_SLAY);
    RegAdminCmd("sm_reset", CommandResetPlayer, ADMFLAG_SLAY);
    RegAdminCmd("sm_setstars", CommandSetStars, ADMFLAG_SLAY);
    
    LoadTranslations("common.phrases");
    LoadTranslations("abner_resetscore.phrases");
    
    ServerCommand("mp_backup_round_file \"\"");
    ServerCommand("mp_backup_round_file_last \"\"");
    ServerCommand("mp_backup_round_file_pattern \"\"");
    ServerCommand("mp_backup_round_auto 0");
        
    if(CSGO)
    {
        RegAdminCmd("sm_setassists", CommandSetAssists, ADMFLAG_SLAY);
        RegAdminCmd("sm_setpoints", CommandSetPoints, ADMFLAG_SLAY);
        RegAdminCmd("sm_setscore", CommandSetScoreCSGO, ADMFLAG_SLAY);
    }
    else
    {
        RegAdminCmd("sm_setscore", CommandSetScore, ADMFLAG_SLAY);
    }
    
    AutoExecConfig();
    CreateConVar("abner_resetscore_version", PLUGIN_VERSION, "Resetscore Version", FCVAR_NOTIFY|FCVAR_REPLICATED);
    hPluginEnable = CreateConVar("sm_resetscore", "1", "Enable/Disable the Plugin.");
    hPublic = CreateConVar("sm_resetscore_public", "1", "Enable or disable the messages when player reset score.");
    hSaveScores = CreateConVar("sm_resetscore_savescores", "1", "Save scores when players retry.");
    hResetCost = CreateConVar("sm_resetscore_cost", "0", "Money cost to reset score.");
    
    playersList = new ArrayList(64);
    scores = new ArrayList(4);
    
    for(int i = 0;i < GetMaxClients();i++)
    {
        if(!IsValidClient(i))
            continue;
        OnClientPutInServer(i);
    }
}


public void OnMapStart()
{
    playersList = new ArrayList(64);
    scores = new ArrayList(4);
    ServerCommand("mp_backup_round_file \"\"");
    ServerCommand("mp_backup_round_file_last \"\"");
    ServerCommand("mp_backup_round_file_pattern \"\"");
    ServerCommand("mp_backup_round_auto 0");
}  

public void OnClientPutInServer(int client)
{
    if(GetConVarInt(hSaveScores) != 1 || IsFakeClient(client))
        return;
    
    char steamId[64];
    GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId));
    int infoArray[5];
    int index = playersList.FindString(steamId);
    if(index != -1)
    {
        CreateTimer(2.0, MSG, client);
        scores.GetArray(index, infoArray, sizeof(infoArray));
        SetEntProp(client, Prop_Data, "m_iFrags", infoArray[0]);
        SetEntProp(client, Prop_Data, "m_iDeaths", infoArray[1]);
        CS_SetMVPCount(client, infoArray[2]);
        if(CSGO)
        {
            CS_SetClientContributionScore(client, infoArray[3]);
            CS_SetClientAssists(client, infoArray[4]);
        }
    }
    else
    {
        playersList.PushString(steamId);
        scores.PushArray(infoArray);
    }
}

public Action MSG(Handle timer, any client)
{
    if(IsValidClient(client))
        CPrintToChat(client, "{green}[AbNeR ResetScore] \x01%t", "Restored");
}
public void PlayerDisconnect(Handle event,const char[] name,bool dontBroadcast)
{
    int client = GetClientOfUserId(GetEventInt(event, "userid"));
    if(!IsValidClient(client))
        return;
    if(GetConVarInt(hSaveScores) != 1 || IsFakeClient(client))
        return;
        
    char steamId[64];
    GetClientAuthId(client, AuthId_Steam2, steamId, sizeof(steamId));
    int infoArray[5];
    int index = playersList.FindString(steamId);
    if(index != -1)
    {
        infoArray[0] = GetClientFrags(client);
        infoArray[1] = GetClientDeaths(client);
        infoArray[2] = CS_GetMVPCount(client);
        if(CSGO)
        {
            infoArray[3] = CS_GetClientContributionScore(client);
            infoArray[4] = CS_GetClientAssists(client);
        }
        scores.SetArray(index, infoArray);
    }
}

public Action CommandResetScore(int client, int args)
{                        
    if(GetConVarInt(hPluginEnable) == 0)
    {
        CPrintToChat(client, "[\x02Statystyki\x01] \x03%t", "Plugin Disabled");
        return Plugin_Continue;
    }
    
    if(GetClientDeaths(client) == 0 && GetClientFrags(client) == 0 && CS_GetMVPCount(client) == 0)
    {
        if(!CSGO || CS_GetClientAssists(client) == 0)
        {
            CPrintToChat(client, "[\x02Statystyki\x01] \x03%t", "Score 0");
            return Plugin_Continue;
        }
    }
    
    int cost = GetConVarInt(hResetCost);
    int money = GetEntProp(client, Prop_Send, "m_iAccount");
    if(cost > 0 && money < cost)
    {
        CPrintToChat(client, "[\x02Statystyki\x01] \x03%t", "No Money", cost);
        return Plugin_Continue;
    }
    
    ResetPlayer(client);
    SetEntProp(client, Prop_Send, "m_iAccount", money-cost);
    
    char name[MAX_NAME_LENGTH];
    GetClientName(client, name, sizeof(name));
    if(GetConVarInt(hPublic) == 1)
    {
        if(GetClientTeam(client) == 2)
        {
            CPrintToChatAll("[\x02Statystyki\x01] \x03%t", "Player Reset Red", name);
        }
        else if(GetClientTeam(client) == 3)
        {
            CPrintToChatAll("[\x02Statystyki\x01] \x03%t", "Player Reset Blue", name);
        }
        else
        {
            CPrintToChatAll("[\x02Statystyki\x01] \x03%t", "Player Reset Normal", name);
        }
    }
    else
    {
        CPrintToChat(client, "[\x02Statystyki\x01] \x03%t", "You Reset");
    }
    return Plugin_Continue;
}

void ResetPlayer(int client)
{
    if(IsValidClient(client))
    {
        SetEntProp(client, Prop_Data, "m_iFrags", 0);
        SetEntProp(client, Prop_Data, "m_iDeaths", 0);
        CS_SetMVPCount(client, 0);
        if(CSGO)
        {
            CS_SetClientAssists(client, 0);
            CS_SetClientContributionScore(client, 0);
        }
    }
}
    
public Action CommandResetPlayer(int client, int args)
{                           
    char arg1[32];
    GetCmdArg(1, arg1, sizeof(arg1));

    if (args != 1)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03] Sm_resetscore <nazwa lub id>");
        return Plugin_Continue;
    }
     
    char target_name[MAX_TARGET_LENGTH];
    char nameadm[MAX_NAME_LENGTH];
    GetClientName(client, nameadm, sizeof(nameadm));
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;
    
    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

      for (int i = 0; i < target_count; i++)
    {
        ResetPlayer(target_list);
    }
    ShowActivity2(client, "[\x02Statystyki\x01]", "%t", "Reset Score of", "target_name");
    return Plugin_Continue;
}

public Action CommandSetScore(int client, int args)
{                           
      char arg1[32], arg2[20], arg3[20],arg4[20];
    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    GetCmdArg(3, arg3, sizeof(arg3));
    GetCmdArg(4, arg4, sizeof(arg4));
    int kills = StringToInt(arg2);
    int deaths = StringToInt(arg3);
    int stars = StringToInt(arg4);
      
    if (args != 4)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03 sm_setscore <name or #userid> <Kills> <Deaths><Stars>");
        return Plugin_Continue;
    }
     
    char target_name[MAX_TARGET_LENGTH];
    char nameadm[MAX_NAME_LENGTH];
    GetClientName(client, nameadm, sizeof(nameadm));
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;
    
    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

      for (int i = 0; i < target_count; i++)
    {
        SetEntProp(target_list, Prop_Data, "m_iFrags", kills);
        SetEntProp(target_list, Prop_Data, "m_iDeaths", deaths);
        CS_SetMVPCount(target_list, stars);
    }
    
    ShowActivity2(client, "[\x02Statystyki\x01] \x03", "%t", "Set Score", "target_name");
    return Plugin_Continue;
}

public Action CommandSetScoreCSGO(int client, int args)
{                           
      if (args != 6)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03 sm_setscore <name or #userid> <Kills> <Deaths><Assists><Stars><Points>");
        return Plugin_Continue;
    }
    
    char arg1[32], arg2[20], arg3[20], arg4[20], arg5[20], arg6[20];
    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    GetCmdArg(3, arg3, sizeof(arg3));
    GetCmdArg(4, arg4, sizeof(arg4));
    GetCmdArg(5, arg5, sizeof(arg5));
    GetCmdArg(6, arg6, sizeof(arg6));
    int kills = StringToInt(arg2);
    int deaths = StringToInt(arg3);
    int assists = StringToInt(arg4);
    int stars = StringToInt(arg5);
    int points = StringToInt(arg6);
     
    char target_name[MAX_TARGET_LENGTH];
    char nameadm[MAX_NAME_LENGTH];
    GetClientName(client, nameadm, sizeof(nameadm));
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;
    
    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

      for (int i = 0; i < target_count; i++)
    {
        SetEntProp(target_list, Prop_Data, "m_iFrags", kills);
        SetEntProp(target_list, Prop_Data, "m_iDeaths", deaths);
        CS_SetClientAssists(target_list, assists);
        CS_SetMVPCount(target_list, stars);
        CS_SetClientContributionScore(target_list, points);
    }
    
    ShowActivity2(client, "[\x02Statystyki\x01] \x03 ", "\x03%t", "Set Score", target_name);
    return Plugin_Continue;
}

public Action CommandSetPoints(int client, int args)
{                           
    char arg1[32], arg2[20];
    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    int points = StringToInt(arg2);
        
    if (args != 2)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03 sm_setpoints <name or #userid> <points>");
        return Plugin_Continue;
    }

    char target_name[MAX_TARGET_LENGTH];
    char nameadm[MAX_NAME_LENGTH];
    GetClientName(client, nameadm, sizeof(nameadm));
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;

    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

    for (int i = 0; i < target_count; i++)
    {   
        CS_SetClientContributionScore(target_list, points);
    }

    ShowActivity2(client, "[\x02Statystyki\x01] \x03", "\x03%t", "Set Points of", target_name, points);
    return Plugin_Continue;
}

public Action CommandSetAssists(int client, int args)
{                           
    char arg1[32], arg2[20];
    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    int assists = StringToInt(arg2);
        
    if (args != 2)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03 sm_setassists <name or #userid> <assists>");
        return Plugin_Continue;
    }

    char target_name[MAX_TARGET_LENGTH];
    char nameadm[MAX_NAME_LENGTH];
    GetClientName(client, nameadm, sizeof(nameadm));
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;

    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

    for (int i = 0; i < target_count; i++)
    {   
        CS_SetClientAssists(target_list, assists);
    }

    ShowActivity2(client, "[\x02Statystyki\x01] \x03 ", "\x03%t", "Set Assists of", target_name, assists);
    return Plugin_Continue;
}

public Action CommandSetStars(int client, int args)
{                           
    char arg1[32], arg2[20];
    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    int stars = StringToInt(arg2);

    if (args != 2)
    {
        ReplyToCommand(client, "[\x02Statystyki\x01] \x03 sm_setstars <name or #userid> <stars>");
        return Plugin_Continue;
    }

    char target_name[MAX_TARGET_LENGTH];
    int target_list[MAXPLAYERS], target_count; bool tn_is_ml;

    if ((target_count = ProcessTargetString(
    arg1,
    client,
    target_list,
    MAXPLAYERS,
    COMMAND_TARGET_NONE,
    target_name,
    sizeof(target_name),
    tn_is_ml)) <= 0)
    {
        ReplyToTargetError(client, target_count);
        return Plugin_Continue;
    }

    for (int i = 0; i < target_count; i++)
    {
        CS_SetMVPCount(target_list, stars);
    }

    ShowActivity2(client, "[\x02Statystyki\x01] \x03", "\x03%t", "Set Stars of", target_name, stars);
    return Plugin_Continue;
}

stock bool IsValidClient(int client)
{
    if(client <= 0 ) return false;
    if(client > MaxClients) return false;
    if(!IsClientConnected(client)) return false;
    return IsClientInGame(client);
}

 

 

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

https://forums.alliedmods.net/showthread.php?t=270882
Hej! Skorzystałeś z linku lub pobrałeś załącznik? Uhonoruj naszą pracę poprzez rejestrację na forum i rośnij razem z nami!

https://forums.alliedmods.net/showthread.php?p=1871412
Hej! Skorzystałeś z linku lub pobrałeś załącznik? Uhonoruj naszą pracę poprzez rejestrację na forum i rośnij razem z nami!

Udostępnij tę odpowiedź


Odnośnik do odpowiedzi
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Gość
Dodaj odpowiedź do tematu...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić obrazków. Dodaj lub załącz obrazki z adresu URL.


×
×
  • Dodaj nową pozycję...