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

[Store] Gamble


Post New Thread Reply   
 
Thread Tools Display Modes
Author
B2SX
Member
Join Date: Dec 2015
Location: Israel
Plugin ID:
5712
Plugin Version:
1.0
Plugin Category:
Fun Stuff
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Gambling Store Module for Zephyrus Store
    Old 07-14-2017 , 17:34   [Store] Gamble
    Reply With Quote #1

    Zephyrus Store | Gamble Module By BaroNN

    About it:
    a small gambling plugin that I made a long time ago, you write /gamble <ammont> and you have a chance to win and of course a chance to lose your bet, it's a very small plugin but a lot of people were asking me about it so here is it. enjoy!

    Cvars:

    sm_gamble_showgamble - Show Gamble Message to All? (default: 0)
    sm_gamble_minbet - Minimum BetAmmont? (default: 25)
    sm_gamble_maxbet - Maximum BetAmmont? (default: 7000)
    sm_gamble_winingchance - Wining Chance? (default: 40)
    Attached Files
    File Type: sp Get Plugin or Get Source (store-gamble.sp - 1845 views - 2.8 KB)
    __________________
    ◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
    Steam Link

    Last edited by B2SX; 07-16-2017 at 08:10.
    B2SX is offline
    nhnkl159
    Senior Member
    Join Date: Jul 2012
    Location: Israel 3>
    Old 07-15-2017 , 00:08   Re: [Store] Gamble
    Reply With Quote #2

    This plugin made really bad, I've seen so far some bugs could be made by using this plugin and it's really messy too, I've attached a gamble plugin I made a long time ago for Zeph store and added few thing that you had at this plugin if you wish to learn.
    Attached Files
    File Type: sp Get Plugin or Get Source (ZephGamble.sp - 387 views - 4.1 KB)
    __________________
    nhnkl159 is offline
    Send a message via Skype™ to nhnkl159
    B2SX
    Member
    Join Date: Dec 2015
    Location: Israel
    Old 07-15-2017 , 03:04   Re: [Store] Gamble
    Reply With Quote #3

    Quote:
    Originally Posted by nhnkl159 View Post
    This plugin made really bad, I've seen so far some bugs could be made by using this plugin and it's really messy too, I've attached a gamble plugin I made a long time ago for Zeph store and added few thing that you had at this plugin if you wish to learn.
    its just a little bit more advanced both are working I used this plugin on my own a community a year ago, if you were actually reading the "about" it says that I made a long time ago and it's a small plugin, the plugin works great and if I really wanted to I could make it look good and more advanced but there is no reason to,
    __________________
    ◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
    Steam Link

    Last edited by B2SX; 07-15-2017 at 03:19.
    B2SX is offline
    nhnkl159
    Senior Member
    Join Date: Jul 2012
    Location: Israel 3>
    Old 07-15-2017 , 12:45   Re: [Store] Gamble
    Reply With Quote #4

    Quote:
    Originally Posted by B2SX View Post
    its just a little bit more advanced both are working I used this plugin on my own a community a year ago, if you were actually reading the "about" it says that I made a long time ago and it's a small plugin, the plugin works great and if I really wanted to I could make it look good and more advanced but there is no reason to,
    It's the same plugin, I just added few functions to prevent bugs and changed few things are unnecessary, Your plugin is "works" but had tons of unnecessary code lines and some bugs could be made.
    I will give you an example of a plugin I made in 2014: https://pastebin.com/HWvXGLMd
    this plugin "works" but had tons shit of bugs and made soo bad I wanna cry I actually made something like that, but everyone starting from somewhere and I can guess you are new to SM (or you were) by looking at your code.
    __________________

    Last edited by nhnkl159; 07-15-2017 at 12:47.
    nhnkl159 is offline
    Send a message via Skype™ to nhnkl159
    B2SX
    Member
    Join Date: Dec 2015
    Location: Israel
    Old 07-15-2017 , 12:57   Re: [Store] Gamble
    Reply With Quote #5

    Quote:
    Originally Posted by nhnkl159 View Post
    It's the same plugin, I just added few functions to prevent bugs and changed few things are unnecessary, Your plugin is "works" but had tons of unnecessary code lines and some bugs could be made.
    I will give you an example of a plugin I made in 2014: https://pastebin.com/HWvXGLMd
    this plugin "works" but had tons shit of bugs and made soo bad I wanna cry I actually made something like that, but everyone starting from somewhere and I can guess you are new to SM (or you were) by looking at your code.
    the code is working perfectly I don't know what are you talking about test it again, im not new to SM, im programming sm for a year and a half and I'm really good at it also so I don't know what are you talking about, also I have been programming in other languages for 9 years, im not starting anywhere i have something like 100-200 plugins (half are sourcepawn), 20 of them are gamemodes like jailbreak, deathrun, etc so....
    __________________
    ◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
    Steam Link

    Last edited by B2SX; 07-15-2017 at 12:59.
    B2SX is offline
    lay295
    Senior Member
    Join Date: Sep 2013
    Old 07-15-2017 , 15:49   Re: [Store] Gamble
    Reply With Quote #6

    Quote:
    Originally Posted by B2SX View Post
    the code is working perfectly I don't know what are you talking about test it again, im not new to SM, im programming sm for a year and a half and I'm really good at it also so I don't know what are you talking about, also I have been programming in other languages for 9 years, im not starting anywhere i have something like 100-200 plugins (half are sourcepawn), 20 of them are gamemodes like jailbreak, deathrun, etc so....
    From taking a quick look your IsValidClient seems to be messed up. I have no idea what he's talking about saying it's not clean though and "really bad" it seems fine besides a few small things.

    Code:
    stock bool IsValidClient(client)
    {
    	if (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && IsFakeClient(client) && IsClientSourceTV(client))return true;
    	return false;
    }
    Wouldn't this only return true if you're a bot and a sourcetv client? O.o

    Also your first check
    Code:
    if(args < 0 || !BetAmmont || IsValidClient(client))
    Wouldn't args never be less than 0? Maybe you meant args <=0 or args < 1. No real point in checking if they have -1 args.
    I'm also not sure what the purpose of !BetAmmont would be, as in your code that could never resolve to true. Since StringToInt would just return 0 on failure anyways. Thus (!BetAmmount) == false all the time.

    NOTE: I haven't actually tested the plugin, just making some observations.
    __________________


    Last edited by lay295; 07-15-2017 at 16:01.
    lay295 is offline
    B2SX
    Member
    Join Date: Dec 2015
    Location: Israel
    Old 07-15-2017 , 16:42   Re: [Store] Gamble
    Reply With Quote #7

    Quote:
    Originally Posted by lay295 View Post
    From taking a quick look your IsValidClient seems to be messed up. I have no idea what he's talking about saying it's not clean though and "really bad" it seems fine besides a few small things.

    Code:
    stock bool IsValidClient(client)
    {
    	if (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && IsFakeClient(client) && IsClientSourceTV(client))return true;
    	return false;
    }
    Wouldn't this only return true if you're a bot and a sourcetv client? O.o

    Also your first check
    Code:
    if(args < 0 || !BetAmmont || IsValidClient(client))
    Wouldn't args never be less than 0? Maybe you meant args <=0 or args < 1. No real point in checking if they have -1 args.
    I'm also not sure what the purpose of !BetAmmont would be, as in your code that could never resolve to true. Since StringToInt would just return 0 on failure anyways. Thus (!BetAmmount) == false all the time.

    NOTE: I haven't actually tested the plugin, just making some observations.
    i forget to add ! in the start in the isvalidclient i will fix now, and the arg check is working fine i do the same all the time, also the !BetAmmont checks if it is a number again using it in other plugins working great, fixed the plugin i uploaded the updated version.
    __________________
    ◆ Developer - C++,C#,Python,VB.NET,Java,SQF,AS 3.0,AS 2.0,SP,Pawn,LUA
    Steam Link

    Last edited by B2SX; 07-15-2017 at 16:44.
    B2SX is offline
    nhnkl159
    Senior Member
    Join Date: Jul 2012
    Location: Israel 3>
    Old 07-15-2017 , 17:41   Re: [Store] Gamble
    Reply With Quote #8

    Quote:
    Originally Posted by lay295 View Post
    From taking a quick look your IsValidClient seems to be messed up. I have no idea what he's talking about saying it's not clean though and "really bad" it seems fine besides a few small things.

    Code:
    stock bool IsValidClient(client)
    {
    	if (client >= 1 && client <= MaxClients && IsClientConnected(client) && IsClientInGame(client) && IsFakeClient(client) && IsClientSourceTV(client))return true;
    	return false;
    }
    Wouldn't this only return true if you're a bot and a sourcetv client? O.o

    Also your first check
    Code:
    if(args < 0 || !BetAmmont || IsValidClient(client))
    Wouldn't args never be less than 0? Maybe you meant args <=0 or args < 1. No real point in checking if they have -1 args.
    I'm also not sure what the purpose of !BetAmmont would be, as in your code that could never resolve to true. Since StringToInt would just return 0 on failure anyways. Thus (!BetAmmount) == false all the time.

    NOTE: I haven't actually tested the plugin, just making some observations.
    I've written it before he updated the plugin, he uploaded a new version of this plugin that made better and not really messy.
    __________________
    nhnkl159 is offline
    Send a message via Skype™ to nhnkl159
    ZeepTheDeep
    Junior Member
    Join Date: Oct 2018
    Old 11-09-2018 , 07:04   Re: [Store] Gamble
    Reply With Quote #9

    how can i do that the win/lost will be public that the all players in the server could be able to see it?
    ZeepTheDeep is offline
    Cruze
    Veteran Member
    Join Date: May 2017
    Old 11-09-2018 , 08:08   Re: [Store] Gamble
    Reply With Quote #10

    Quote:
    Originally Posted by ZeepTheDeep View Post
    how can i do that the win/lost will be public that the all players in the server could be able to see it?
    "sm_gamble_showgamble 1" in cfg/sourcemod/store_gamble.cfg
    __________________
    Taking paid private requests! Contact me
    Cruze is offline
    Reply


    Thread Tools
    Display Modes

    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 09:38.


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