Raised This Month: $32 Target: $400
 8% 

[CS:GO] MyJailbreak - warden, days, menu & more (Beta 14 - 13/08/18)


Post New Thread Reply   
 
Thread Tools Display Modes
Danyloss
New Member
Join Date: Jul 2016
Location: Poland
Old 02-19-2017 , 14:53   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 10 / 18-02-17]
Reply With Quote #401

Do you wanna do support in myjailbreak for this plugin ?https://forums.alliedmods.net/showthread.php?t=293920
Danyloss is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-20-2017 , 11:08   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #402

New Update: MyJailbreak Beta 11

Quote:
[Beta 11.0] - Support for addicted CT Bans plugin

Added
  • Ratio: Support for new CTBans plugin by addicted
  • new plugin - disabled/ratio_ctbans_addicted.smx - Support plugin for addicted CT Bans plugin
Changed
  • Support Plugins: changed name for ctbans plugins - to many ct bans
  • renamed plugin - ratio_ctban to ratio_ctbans_databomb
  • renamed plugin - ratio_ct_bans to ratio_ctbans_fantom



Quote:
Originally Posted by Danyloss View Post
Do you wanna do support in myjailbreak for this plugin ?https://forums.alliedmods.net/showthread.php?t=293920 - [CS:GO/CS:S] Jailbreak Gangs
I already looked on it, but hasn't the time make deeper tests. I've been thinking about it, but on the fast, I don't see a benefit or disadvantage.
Is there a conflict? Where do you need support for this plugin? What would be a good addition to this?
__________________
coding & free software
shanapu is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 02-20-2017 , 12:02   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #403

Hey Shanapu !

I tried to compile your Ghosts.sp but there is 4 errors (and i haven't add anything yet).

There :

1: error 092: number of arguments does not match definition

Code:
if (gp_bMyJailbreak)
	{
		MyJailbreak_SetEventDayPlanned(false);
		MyJailbreak_SetEventDayRunning(true, 0);

		if (gc_fBeaconTime.FloatValue > 0.0)
		{
			g_hTimerBeacon = CreateTimer(gc_fBeaconTime.FloatValue, Timer_BeaconOn, TIMER_FLAG_NO_MAPCHANGE);
		}
	}
2: error 092: number of arguments does not match definition

Code:
if (gp_bMyJailbreak)
			{
				MyJailbreak_SetEventDayRunning(false, winner);
				MyJailbreak_SetEventDayName("none");
			}
3: error 092: number of arguments does not match definition

Code:
if (gp_bMyJailbreak)
			{
				MyJailbreak_SetEventDayName("none");
				MyJailbreak_SetEventDayRunning(false, 0);
			}
4: error 180: function return type deffiers from prototype. expected 'int', but go 'void'

Code:
public void OnAvailableLR(int Announced)
__________________
\o/
fraise is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-20-2017 , 12:11   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #404

Quote:
Originally Posted by fraise View Post
~snip~
use the latest include files coming with MyJailbreaks.
__________________
coding & free software
shanapu is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 02-20-2017 , 12:16   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #405

Already done, don't change anything :s but maybe my bad, i just want to help you =)

Edit : You were right ! So i add my stuff about credits, i guess you remember that :

Code:
			LoopValidClients(i, false, false)  // (i, false, false) only surviver get credits - (i, false, true) Dead player get credits too
			{
				if (GetClientTeam(i) == CS_TEAM_CT)
				{
					Store_SetClientCredits(i, Store_GetClientCredits(i) + 10);
				}
			}
well, that tell me "LoopValidClients" :undefined symbol blablabla

What the matter ? :s

(btw, someone could explain to me how to work a loop ? i don't find anything about it on google :s)
__________________
\o/

Last edited by fraise; 02-20-2017 at 12:23.
fraise is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-20-2017 , 15:46   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #406

Quote:
Originally Posted by fraise View Post
Already done, don't change anything :s but maybe my bad, i just want to help you =)

Edit : You were right ! So i add my stuff about credits, i guess you remember that :

[CODE]

well, that tell me "LoopValidClients" :undefined symbol blablabla

What the matter ? :s

(btw, someone could explain to me how to work a loop ? i don't find anything about it on google :s)
I forgot to add this to the changelog: "Removed define marco loops - LoopClients(i) & LoopValidClients(i)"

Chaosxk gave me the hint that #define macros like LoopClients(i) isn't a good way and may be removed in later sm builds. you can read about it here: https://forums.alliedmods.net/showthread.php?t=250251

So, what is a Loop, a macro and how to fix your problem:

This is a Loop through all available Clients on your server. This loop will execute the //code for all ingame player on the server
PHP Code:
for (int client 1client <= MaxClientsclient++)    // MaxClients as variable depends on game eg. .../32/64 slots
{
    if (
IsClientInGame(client)
    {
        
// code
    
}

On my beginner days, I thought it would be good idea, to "shrink" this "magic/unreadable" code with a macro.
So I defined a macro for this Loop :
PHP Code:
#define LoopClients(%1) for (int %1 = 1; %1 <= MaxClients; %1++) if (IsClientInGame(%1))  // don't use this in future 
With this macro I just used this short code instead the (much longer & "complicated") code above in first example. This do the same like the code in the first snippet.
PHP Code:
LoopClients(client)   // don't use this in future
{
    
// code

But like I mentioned above this is "bad coding behavior" so I removed the macros LoopClients(i) with Beta 10 and used the full loop code (for (int client = 1; ...)

Your issue:
LoopValidClients(i, false, false) is an extented macro with client validation if (IsValidClient(i, true, true)).
Use instead the full loop code above with IsValidClient if-statemant.

BUT: You don't need to edit every MyJailbreak EventDay in future for your store credits feature.
On your request, I implemented a forward on Event Day End which sends the winner team. With this forward it's very easy to write a very small plugin for your needs.
PHP Code:
#include <myjailbreak>
#include <mystocks>
#include <store>

public void MyJailbreak_OnEventDayEnd(char[] nameint winner)
{
    if (
winner <= 1)
        return;
    
    for (
int client 1client <= MaxClientsclient++)
    {
        if (
IsValidClient(client))
        {
            if (
GetClientTeam(client) == winner)
            {
                
Store_SetClientCredits(clientStore_GetClientCredits(client) + 10);
            }
        }
    }

I hope you learned something.
Attached Files
File Type: smx myjb_eventday_credits.smx (4.1 KB, 60 views)
File Type: sp Get Plugin or Get Source (myjb_eventday_credits.sp - 64 views - 1.2 KB)
__________________
coding & free software

Last edited by shanapu; 02-20-2017 at 15:54.
shanapu is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 02-20-2017 , 16:03   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #407

You...are... just the best dev of the universe '-' thank you so much !!!
__________________
\o/
fraise is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 02-26-2017 , 19:36   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #408

Hiiiiii there ! New question here !

How should i use your Myjailbreak.inc to do some stuff on an event "Last CT set last guard rules" ?

I try to open a menu when the last guard make sm_lastguard =)
__________________
\o/
fraise is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 02-27-2017 , 08:13   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #409

Quote:
Originally Posted by fraise View Post
Hiiiiii there ! New question here !

How should i use your Myjailbreak.inc to do some stuff on an event "Last CT set last guard rules" ?

I try to open a menu when the last guard make sm_lastguard =)
Use forward:
PHP Code:
/*********************************************************
 * Called when a the Last Guard Rule is active
 * 
 * @NoReturn
 *********************************************************/
forward void MyJailbreak_OnLastGuardRuleStart(); 
like
PHP Code:
public void MyJailbreak_OnLastGuardRuleStart()
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && IsPlayerAlive(i))
        {
            if (
GetClientTeam(i) == CS_TEAM_CT)
            {
                
// menu for the last guard
            
}
        }
    }

__________________
coding & free software
shanapu is offline
fraise
Member
Join Date: Sep 2016
Location: Paris, France
Old 02-27-2017 , 14:30   Re: [CS:GO] MyJailbreak (warden, days, menu & more) [Beta 11 / 20-02-17]
Reply With Quote #410

thanks ! =)
__________________
\o/
fraise 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 22:27.


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