Raised This Month: $51 Target: $400
 12% 

TeamBets 2.6 (Mani Conversion)


Post New Thread Reply   
 
Thread Tools Display Modes
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 08-29-2017 , 20:21   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #211

Sometimes if player bets on any team, and his bet is winning - plugin takes away money..
So, if i bet on T all, and T's wins the round - i can lose all my money..
waylander3 is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 08-30-2017 , 10:21   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #212

Quote:
Originally Posted by waylander3 View Post
Sometimes if player bets on any team, and his bet is winning - plugin takes away money..
So, if i bet on T all, and T's wins the round - i can lose all my money..
It's working 100% on my server.

Have you tried this code here?

https://forums.alliedmods.net/showpo...&postcount=206


Quote:
Originally Posted by St00ne View Post
It's because it uses say_commands as a chat trigger and detects if the word bet is the 1st word.
It's not based on sm_bet console command. The sm_bet you see in the file is only the enable cvar.
Anyway this plugin would need a rewrite for this reason (maybe others?), but I'm quite lazy right now.

And it works, and I don't think it harms servers, even if it would've been better to avoid all this chat detections... so personally, I use the default version.
Thanks for clarifying
__________________

Last edited by Obyboby; 08-30-2017 at 10:21.
Obyboby is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 09-14-2017 , 18:48   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #213

Is it easy to add a message for clients upon player's death, that serves as a reminder for team betting?
Most players forget that they can place a bet.
Something like:

*player dies*
chat message: don't forget to place your bet!
__________________
Obyboby is offline
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 10-13-2017 , 03:52   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #214

Quote:
Originally Posted by Obyboby View Post
Is it easy to add a message for clients upon player's death, that serves as a reminder for team betting?
Most players forget that they can place a bet.
Something like:

*player dies*
chat message: don't forget to place your bet!
+1, can somebody tell me how i could do this in the plugin ?

Thank you!
cristi_ip is offline
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
cristi_ip
Senior Member
Join Date: Dec 2010
Location: Bucharest
Old 10-13-2017 , 07:23   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #216

Thank you Obyboby!
cristi_ip is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 12-02-2017 , 20:05   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #217

As a request, I made a fast rewrite to fit new syntax & use zephyrus store credits.

edit: added !pot command as further request. used a snippet & translation from Wilczek post #206

Translations:
PHP Code:
    "In Pot Total"
    
{
        
"#format"        "{1:d}"
        "en"            "There are 
${1} in the pot."
    

edit2: removed bad plugin for fix.
Attached Files
File Type: sp Get Plugin or Get Source (zstore-teambets.sp - 280 views - 11.5 KB)
File Type: smx zstore-teambets.smx (10.3 KB, 263 views)
__________________
coding & free software

Last edited by shanapu; 12-02-2017 at 21:42.
shanapu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-02-2017 , 20:26   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #218

Quote:
Originally Posted by shanapu View Post
As a request, I made a fast rewrite to fit new syntax & use zephyrus store credits.

edit: added !pot command as further request. used a snippet & translation from Wilczek post #206

Translations:
PHP Code:
    "In Pot Total"
    
{
        
"#format"        "{1:d}"
        "en"            "There are 
${1} in the pot."
    

PHP Code:
void SetMoney(int clientint amount)
{
    
Store_SetClientCredits(clientamount);

the dude's store credit is going to be in a world of hurt
__________________
8guawong is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 12-02-2017 , 21:10   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #219

Quote:
Originally Posted by 8guawong View Post
[code]

the dude's store credit is going to be in a world of hurt
sry, I don't get it.
__________________
coding & free software
shanapu is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 12-03-2017 , 05:22   Re: TeamBets 2.6 (Mani Conversion)
Reply With Quote #220

Quote:
Originally Posted by shanapu View Post
sry, I don't get it.
i think you edited the plugin

but the old code

PHP Code:
if ((iMoney GetMoney(i) + g_iPlayerBetData[i][BET_AMOUNT] + g_iPlayerBetData[i][BET_WIN]) > g_iConfig_mp_maxmoneyiMoney g_iConfig_mp_maxmoney;
SetMoney(i,iMoney); 
g_iConfig_mp_maxmoney is always 0
so if they won their credits will be set to 0
__________________

Last edited by 8guawong; 12-03-2017 at 05:23.
8guawong 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 01:22.


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