View Single Post
Obyboby
Veteran Member
Join Date: Sep 2013
Old 10-13-2017 , 06:04   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #215

Quote:
Originally Posted by cristi_ip View Post
+1, can somebody tell me how i could do this in the plugin ?

Thank you!
Since I'm a noob and don't know crap about coding, I made a new plugin that shows the message.
I did copy some of the code from other plugins so I don't really want to take credit for it.. well it's just a few lines so I don't think anyone would mind anyway I honestly forgot where I took each piece of code from, so, apologies if anyone here recognizes any of their own code :C
You will need a .phrases.txt file in the translations folder as well for the messages that are displayed in chat.

PHP Code:
#include <sourcemod> 
#include <cstrike>  
#include <sdktools>
#include <multicolors>

public Plugin myinfo =   

    
name "[CS:GO] Bet reminder",  
    
author "Obyboby",  
    
description "Display a bet reminder to client upon death",  
    
version "0.1",  
    
url "http://steamcommunity.com/id/p0py/" 
}; 

public 
void OnPluginStart() 

    
HookEvent("player_death"OnPlayerDeath);
    
LoadTranslations("ez_betmsg.phrases.txt"); 


public 
Action OnPlayerDeath(Handle event, const char[] namebool dontBroadcast
{

    
//Ignore warmup   
    
if (GameRules_GetProp("m_bWarmupPeriod") == 1)   
        return; 

    new 
userid GetEventInt(event"userid"); // Get player #userid from event player_death
    
new client GetClientOfUserId(userid); // Get client index by #userid

    
CPrintToChat(client"%t""mex_1");

__________________

Last edited by Obyboby; 10-13-2017 at 06:16.
Obyboby is offline