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

Solved [TF2] Put Merasmus on Gray Team


Post New Thread Reply   
 
Thread Tools Display Modes
Whai
Senior Member
Join Date: Jul 2018
Old 11-19-2018 , 02:24   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #11

Don’t use bewizard2, use bewizard. Because on bewizard there is the gray team code of datchtone. On bewizard2 there is another method but not safe, it’s about SetEntProp.


The problem with bewizard2 is the server can crash and he is a lot of buggy because when you change the team of a player via SetEntProp he will change team but the game/server still considere him be in his old team (red or blu)

for example : (on red team there are 2 players) A player is on red team he use the command «gray» of my plugin that has SetEntProp, he is now on gray team, but as you could see, the number of player in red team didn’t decrease, so that means there are still 2 players but we can see only 1 player via the scoreboard. If the gray player return to red team, the team number will increase, so now the game/server considere there is 3 players instead of 2 in red team
__________________

Last edited by Whai; 11-19-2018 at 13:08. Reason: Typo
Whai is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-21-2018 , 11:27   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #12

After taking a look on your code,

This :
PHP Code:
stock TF2_GetNameOfClass(TFClassType:class, String:name[], maxlen

    switch (class) 
    { 
    case 
TFClass_ScoutFormat(namemaxlen"scout"); 
    case 
TFClass_SoldierFormat(namemaxlen"soldier"); 
    case 
TFClass_PyroFormat(namemaxlen"pyro"); 
    case 
TFClass_DemoManFormat(namemaxlen"demoman"); 
    case 
TFClass_HeavyFormat(namemaxlen"heavy"); 
    case 
TFClass_EngineerFormat(namemaxlen"engineer"); 
    case 
TFClass_MedicFormat(namemaxlen"medic"); 
    case 
TFClass_SniperFormat(namemaxlen"sniper"); 
    case 
TFClass_SpyFormat(namemaxlen"spy"); 
    } 

is useless because you didn't use in your code.


You forgot to do a command for this :

PHP Code:
public Action:Command_getmsnow(clientargs

    
CreateTimer(0.1Command_GetmsRandom); 

And for the SDKHook_OnTakeDamage : You should write this :

PHP Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if(
IsValidClient(attacker))
    {
        if(
g_bIsHHH[victim] && g_bIsHHH[attacker])
        {
            if(
victim == attacker)
            {
                return 
Plugin_Handled;
            }
        }
    }
    return 
Plugin_Continue;

instead of this
PHP Code:
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
    if(
attacker >= && attacker <= MaxClients)
    {
        if(
g_bIsHHH[victim] && g_bIsHHH[attacker])
        {
            return 
Plugin_Handled;
        }
    }
    return 
Plugin_Continue;

For your reports :

1)For the "Fancy SpellBook" : There is something on tf2_stocks.inc :
Code:
// TF2 Weapon Loadout Slots
enum
{
	TFWeaponSlot_Primary, //0
	TFWeaponSlot_Secondary, //1
	TFWeaponSlot_Melee, //2
	TFWeaponSlot_Grenade, //3
	TFWeaponSlot_Building, //4
	TFWeaponSlot_PDA, //5
	TFWeaponSlot_Item1, //6
	TFWeaponSlot_Item2 //7
};
Try to remove the weapon slot 6 or 7 or both.

PHP Code:
TF2_RemoveWeaponSlot(client6); 
2) Already Awnsered on my previous post

3) Same as above
__________________

Last edited by Whai; 11-21-2018 at 11:28.
Whai is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-21-2018 , 15:39   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #13

Some notes about your code :
  • let's take an example :
PHP Code:
CreateTimer(Float:1.0DoHellfireclient); 
You don't need to use the "Float:", you can just do :
PHP Code:
CreateTimer(1.0DoHellfireclient); 
  • When you become Merasmus, the sound is too loud because :
Code:
#define SPAWN    "vo/halloween_merasmus/sf12_appears04.mp3"
#define DOOM1    "vo/halloween_merasmus/sf12_appears04.mp3" 

//They are the same, when you become merasmus SPAWN will play but DOOM1 will play if you have some changes because DOOM1 is attached to a function that is called when another function called "SetModel" is invoked and that is attached to Makewizard function
That's why it's too loud.
  • When you press reload button, you throw bombs, but after that, you are on first person be cause of this :
PHP Code:
public Action:ResetTaunt(Handle:timerany:client

    ...
    
SetVariantInt(0); 
    
AcceptEntityInput(client"SetForcedTauntCam");

Fixed.
  • You don't need TF2_StunPlayer, and also when you are merasmus, you can attack while you throw bombs because you forgot TF2_StunPlayer, so now removed and added an alternative :
PHP Code:
        if(buttons IN_ATTACK && IsTaunting[client] == true && g_bIsHHH[client] == true)         
        { 
            return 
Plugin_Handled;
        } 

Plugin Information
  • Fixed an issue when for some reason your speed is higher than the normal speed of your class
  • Added damage on "DoHellFire" (deal 30 dmg) if you don't like it, remove it on lines 535 and 536
  • Added/Fixed something : when a player die while being Merasmus, the dropped weapon (very powerful knife) is erase so now players can't get this knife

Here is the .sp file
Now with this plugin, you are Merasmus and be now in Gray team (MvM maps doesn't work, be patient MvM players I'll release another version of this)
Attached Files
File Type: sp Get Plugin or Get Source (bewizard.sp - 65 views - 25.9 KB)
__________________

Last edited by Whai; 11-21-2018 at 15:41.
Whai is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-22-2018 , 12:54   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #14

The version you posted on 21 November didn't work for me. It just changed me into a Sniper without becoming Wizard. However, I really like the addition of the Hellfire doing damage. Thanks for that.

After lots of testing I learned the problem had to do with things happening too fast after the ChangeClientTeam command. So.... I made some changes.

1. Added timers to slow things down a bit on creating Wizard.
2. Removed the code to destroy weapon on death. It took too much overhead to check every entity created in the game for purpose of finding one weapon.

Good News: Plugin works great, except....

Very Bad News: Plugin can cause client to crash to desktop.

Any ideas on how to fix the problem of client crashing to desktop?
Attached Files
File Type: sp Get Plugin or Get Source (bewizard.sp - 63 views - 25.7 KB)
PC Gamer is offline
Naydef
Senior Member
Join Date: Dec 2015
Location: Doom Town, Nevada
Old 11-22-2018 , 13:15   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #15

Quote:
Originally Posted by PC Gamer View Post
The version you posted on 21 November didn't work for me. It just changed me into a Sniper without becoming Wizard. However, I really like the addition of the Hellfire doing damage. Thanks for that.

After lots of testing I learned the problem had to do with things happening too fast after the ChangeClientTeam command. So.... I made some changes.

1. Added timers to slow things down a bit on creating Wizard.
2. Removed the code to destroy weapon on death. It took too much overhead to check every entity created in the game for purpose of finding one weapon.

Good News: Plugin works great, except....

Very Bad News: Plugin can cause client to crash to desktop.

Any ideas on how to fix the problem of client crashing to desktop?
This was happening with the Neutral Mode plugin i made, if the player is in the unsassigned team and dies, often it will crash the player and the players near the player which died. From my testing it seems it's caused by the ragdoll, removing the ragdoll before it's transmitted to clients is the best way of preventing the crash.
__________________
My plugins:
*None for now*


Steam:
naydef
Naydef is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-22-2018 , 13:40   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #16

So when you have the fancy book, did your game or server crashed ?

Also, when you become "Merasmus" but it did just change you to sniper, did you get an error about "tf2attributes" ?

For the "ChangeClientTeam" thing, it was about checking if the player is atleast on team blu or red, you removed it, so if someone enter the command to become Merasmus, and re-enter again the command while being Merasmus, and die : he'll be always in unassigned team.

For your 2) What will you do when the powerful knife is dropped and someone take it ?

For your Very Bad News : What happened ? what did you do for getting the game crashing ? Did you die while being Merasmus ? Did you have the "Fancy book" equipped ?
__________________
Whai is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-25-2018 , 11:21   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #17

This version fixed all the bugs I was having and appears to be stable. Thanks for your help!
Attached Files
File Type: sp Get Plugin or Get Source (bewizard.sp - 69 views - 24.5 KB)
PC Gamer 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:24.


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