Raised This Month: $ Target: $400
 0% 

Solved [CS:GO] Plugin Crashing Server - Need help!


Post New Thread Reply   
 
Thread Tools Display Modes
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 12-30-2018 , 09:43   Re: [CS:GO] Plugin Crashing Server - Need help!
Reply With Quote #11

PHP Code:

#pragma semicolon 1  
#pragma newdecls required 

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

public void OnPluginStart()  
{  
    
LoadTranslations("common.phrases");
    
RegConsoleCmd("sm_hs"Command_HeadshotOnly);  
}  

public 
Action Command_HeadshotOnly(int clientint args
{
    if (
IsVoteInProgress())  
    {  
        
ReplyToCommand(client"[SM] %t""Vote in Progress");
        return 
Plugin_Handled
    }

    
Menu menu = new Menu(Handle_VoteMenu);  
    
menu.VoteResultCallback Handler_VoteFinished;

    
menu.SetTitle("Headshot only?");  
    
menu.AddItem("Yes""Yes");  
    
menu.AddItem("No""No");  
    
    
menu.DisplayVoteToAll(60);
    return 
Plugin_Handled

    
public 
int Handle_VoteMenu(Menu menuMenuAction actionint param1int param2
{  
    if (
action == MenuAction_End
    { 
        
delete menu
    }
}

public 
void Handler_VoteFinished(Menu menuint num_votesint num_clients, const int[][] client_infoint num_items, const int[][] item_info)
{
    
char item[5];
    
menu.GetItem(item_info[0][VOTEINFO_ITEM_INDEX], itemsizeof(item));
    
    if (
StrEqual(item"Yes"))
    {
        
FindConVar("mp_damage_headshot_only").BoolValue true;
        
PrintToChatAll("[SM] HS ONLY MODE ENABLED."); 
    }
    else
    {
        
FindConVar("mp_damage_headshot_only").BoolValue false;
        
PrintToChatAll("[SM] HS ONLY MODE DISABLED."); 
    }

__________________
Ilusion9 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 23:52.


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