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

Solved [TF2] Put Merasmus on Gray Team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 10-09-2018 , 16:57   [TF2] Put Merasmus on Gray Team
Reply With Quote #1

Coders,

How can I place Merasmus on the Gray Team (Spectator, Team 0)?

Every effort on my part to put Merasmus on Spectator team using code
results in Merasmus not functioning correctly or crashing server on disconnect.

Can you help? The goal is for the bewizard plugin to know the players
original team (red or blue), make the player Merasmus on the gray team,
and on death place the player back on their original team as a player.

The desired effect is achieved if I use two commands separately:
1. First, use the !gray command with the gray plugin written by Dachtone
2. Next, use the !bewizard command from the bewizard plugin

Goal: Use only the bewizard plugin to achieve the desired effect.

bewizard code:
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <tf2>
#include <tf2_stocks>
#include <tf2attributes>
#include <tf2items>
#include <tf2items_giveweapon>

#define PLUGIN_VERSION "1.0"

#define HHH        "models/bots/merasmus/merasmus.mdl"
#define BOMBMODEL        "models/props_lakeside_event/bomb_temp.mdl"
#define SPAWN    "vo/halloween_merasmus/sf12_appears04.mp3"
#define DEATH    "vo/halloween_merasmus/sf12_defeated01.mp3"

#define MERASMUS "models/bots/merasmus/merasmus.mdl"
#define DOOM1    "vo/halloween_merasmus/sf12_appears04.mp3"
#define DOOM2    "vo/halloween_merasmus/sf12_appears09.mp3"
#define DOOM3    "vo/halloween_merasmus/sf12_appears01.mp3"
#define DOOM4            "vo/halloween_merasmus/sf12_appears08.mp3"

#define DEATH1    "vo/halloween_merasmus/sf12_defeated01.mp3"
#define DEATH2    "vo/halloween_merasmus/sf12_defeated06.mp3"
#define DEATH3    "vo/halloween_merasmus/sf12_defeated08.mp3"

#define HELLFIRE "vo/halloween_merasmus/sf12_ranged_attack08.mp3"
#define HELLFIRE2 "vo/halloween_merasmus/sf12_ranged_attack04.mp3"
#define HELLFIRE3 "vo/halloween_merasmus/sf12_ranged_attack05.mp3"

#define BOMB            "vo/halloween_merasmus/sf12_bombinomicon03.mp3"
#define BOMB2            "vo/halloween_merasmus/sf12_bombinomicon09.mp3"
#define BOMB3            "vo/halloween_merasmus/sf12_bombinomicon11.mp3"
#define BOMB4            "vo/halloween_merasmus/sf12_bombinomicon14.mp3"

#define LOL            "vo/halloween_merasmus/sf12_combat_idle01.mp3"
#define LOL2            "vo/halloween_merasmus/sf12_combat_idle02.mp3"

new iLastRand;
new 
Handle:g_hCvarThirdPerson;
new 
bool:g_bIsHHH[MAXPLAYERS 1];
new 
bool:IsTaunting[MAXPLAYERS 1];
new 
bool:ms false;

public 
Plugin:myinfo 
{
    
name "[TF2] Be the Wizard Merasmus",
    
author "Starman4xz, Mitch, Pelipoika, FlamingSarge, Tylerst, modified by PC Gamer",
    
description "Play as the Wizard Merasmus",
    
version PLUGIN_VERSION,
    
url "www.sourcemod.com"
}

public 
OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
g_hCvarThirdPerson CreateConVar("bewizard_thirdperson""1""Whether or not wizard ought to be in third-person"0true0.0true1.0);
    
    
RegAdminCmd("sm_bewizard"Command_wizardADMFLAG_SLAY"It's a good time to run");

    
HookEvent("post_inventory_application"EventInventoryApplicationEventHookMode_Post);
    
HookEvent("player_death"Event_DeathEventHookMode_Post);

}

public 
OnClientPutInServer(client)
{
    
OnClientDisconnect_Post(client);
}

public 
OnClientDisconnect_Post(client)
{
    if (
g_bIsHHH[client])
    {
        
g_bIsHHH[client] = false;
    }
}

public 
OnMapStart()
{
    
PrecacheModel(HHH);
    
PrecacheSound(SPAWN);
    
PrecacheSound(DEATH);
    
PrecacheSound(DOOM1true);
    
PrecacheSound(DOOM2true);
    
PrecacheSound(DOOM3true);
    
PrecacheSound(DOOM4true);

    
PrecacheSound(HELLFIREtrue);
    
PrecacheSound(HELLFIRE2true);
    
    
PrecacheSound(BOMBtrue);
    
PrecacheSound(BOMB2true);    
    
PrecacheSound(BOMB3true);    
    
PrecacheSound(BOMB4true);    
    
    
PrecacheSound(LOLtrue);
    
PrecacheSound(LOL2true);
}

public 
EventInventoryApplication(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if(
g_bIsHHH[client])
    {
        
RemoveModel(client);
        
        
TF2Attrib_RemoveAll(client);
        
        new 
weapon GetPlayerWeaponSlot(client2); 
        
TF2Attrib_RemoveAll(weapon);
        
        
SetVariantInt(0);
        
AcceptEntityInput(client"SetForcedTauntCam");
        
TF2Attrib_RemoveAll(client);
        
SetWearableAlpha(client255);            
        
        
g_bIsHHH[client] = false;
    }
}

public 
Event_Death(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
deathflags GetEventInt(event"death_flags");
    if (!(
deathflags TF_DEATHFLAG_DEADRINGER))
    {
        if (
IsValidClient(client) && g_bIsHHH[client])
        {
            
TF2Attrib_RemoveAll(client);
            new 
weapon GetPlayerWeaponSlot(client2); 
            
TF2Attrib_RemoveAll(weapon);            
            
SetWearableAlpha(client255);                
            
EmitSoundToAll(DEATH);
            
SetVariantInt(0);
            
AcceptEntityInput(client"SetForcedTauntCam");
            
g_bIsHHH[client] = false;    
            
RemoveModel(client);            
        }
    }
}

public 
Action:SetModel(client, const String:model[])
{
    if (
IsValidClient(client) && IsPlayerAlive(client))
    {
        
RemoveModel(client);
        
        
SetVariantString(model);
        
AcceptEntityInput(client"SetCustomModel");

        
SetEntProp(clientProp_Send"m_bUseClassAnimations"1);
        
SetWearableAlpha(client0);
        
forceSpellbook(client);
        
SetSpell2(client0500);        
        
Command_getms1(client);
    }
}

public 
Action:RemoveModel(client)
{
    if (
IsValidClient(client))
    {
        new 
weapon GetPlayerWeaponSlot(client2); 
        
        
TF2Attrib_RemoveAll(weapon);
        
SetEntPropFloat(clientProp_Send"m_flModelScale"1.0);
        
UpdatePlayerHitbox(client2.0);

        
SetSpell2(client00);

        
SetVariantString("");
        
AcceptEntityInput(client"SetCustomModel");
        
SetWearableAlpha(client255);
        
Command_getms3(client);
    }
}

public 
Action:Command_wizard(clientargs)
{
    
decl String:arg1[32];
    if (
args 1)
    {
        
arg1 "@me";
    }
    else 
GetCmdArg(1arg1sizeof(arg1));
    new 
String:target_name[MAX_TARGET_LENGTH];
    new 
target_list[MAXPLAYERS], target_count;
    new 
bool:tn_is_ml;

    if ((
target_count ProcessTargetString(
                    
arg1,
                    
client,
                    
target_list,
                    
MAXPLAYERS,
                    
COMMAND_FILTER_ALIVE|(args COMMAND_FILTER_NO_IMMUNITY 0),
                    
target_name,
                    
sizeof(target_name),
                    
tn_is_ml)) <= 0)
    {
        
ReplyToTargetError(clienttarget_count);
        return 
Plugin_Handled;
    }
    for (new 
0target_counti++)
    {
        
Makewizard(target_list[i]);    
        
LogAction(clienttarget_list[i], "\"%L\" made \"%L\" a Giant Wizard!"clienttarget_list[i]);
    }
    
EmitSoundToAll(SPAWN);
    return 
Plugin_Handled;
}

Makewizard(client)
{
    
TF2_SetPlayerClass(clientTFClass_Sniper);
    
TF2_RegeneratePlayer(client);

    new 
ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll");
    if (
ragdoll MaxClients && IsValidEntity(ragdoll)) AcceptEntityInput(ragdoll"Kill");
    
decl String:weaponname[32];
    
GetClientWeapon(clientweaponnamesizeof(weaponname));
    if (
strcmp(weaponname"tf_weapon_"false) == 0
    {
        
SetEntProp(GetPlayerWeaponSlot(client0), Prop_Send"m_iWeaponState"0);
        
TF2_RemoveCondition(clientTFCond_Slowed);
    }
    
CreateTimer(0.0Timer_Switchclient);
    
SetModel(clientHHH);

    if (
GetConVarBool(g_hCvarThirdPerson))
    {
        
SetVariantInt(1);
        
AcceptEntityInput(client"SetForcedTauntCam");
    }
    
    
TF2_RemoveWeaponSlot(client1);
    
TF2_RemoveWeaponSlot(client0);
    
TF2Items_GiveWeapon(client3);    
    new 
weapon GetPlayerWeaponSlot(client2);
    
SetEntPropEnt(clientProp_Send"m_hActiveWeapon"weapon);
    
    
TF2_SetHealth(client5000);
    
    
SetEntPropFloat(clientProp_Send"m_flModelScale"1.0);
    
UpdatePlayerHitbox(client2.0);
    
    
TF2_AddCondition(clientTFCond_SpeedBuffAlly0.1);
    
g_bIsHHH[client] = true;
    
PrintToChat(client"Wizard Commands: Use Right-Click to launch players, Use 'H' to cast Fireball spell, Use 'R' to throw bombs.");
}

stock UpdatePlayerHitbox(const client, const Float:fScale)
{
    static const 
Float:vecTF2PlayerMin[3] = { -24.5, -24.50.0 }, Float:vecTF2PlayerMax[3] = { 24.5,  24.583.0 };
    
    
decl Float:vecScaledPlayerMin[3], Float:vecScaledPlayerMax[3];

    
vecScaledPlayerMin vecTF2PlayerMin;
    
vecScaledPlayerMax vecTF2PlayerMax;
    
    
ScaleVector(vecScaledPlayerMinfScale);
    
ScaleVector(vecScaledPlayerMaxfScale);
    
    
SetEntPropVector(clientProp_Send"m_vecSpecifiedSurroundingMins"vecScaledPlayerMin);
    
SetEntPropVector(clientProp_Send"m_vecSpecifiedSurroundingMaxs"vecScaledPlayerMax);
}

stock TF2_SetHealth(clientNewHealth)
{
    
SetEntProp(clientProp_Send"m_iHealth"NewHealth1);
    
SetEntProp(clientProp_Data"m_iHealth"NewHealth1);
}

public 
Action:Timer_Switch(Handle:timerany:client)
{
    if (
IsValidClient(client))
    
Givewizard(client);
}

stock Givewizard(client)
{
    
TF2Attrib_RemoveAll(client);
    
    
TF2Attrib_SetByName(client"max health additive bonus"4875.0);
    
TF2Attrib_SetByName(client"health from packs decreased"0.001);
    
TF2Attrib_SetByName(client"major move speed bonus"100.0);
    
TF2Attrib_SetByName(client"cancel falling damage"1.0);            
    
TF2Attrib_SetByName(client"dmg taken from blast reduced"0.5);
    
TF2Attrib_SetByName(client"dmg taken from fire reduced"0.5);
    
TF2Attrib_SetByName(client"dmg taken from bullets reduced"0.5);
    
TF2Attrib_SetByName(client"dmg taken from crit reduced"0.5);
    
TF2Attrib_SetByName(client"dmg from ranged reduced"0.5);
    
TF2Attrib_SetByName(client"SET BONUS: dmg from sentry reduced"0.5);    
    
TF2Attrib_SetByName(client"damage force reduction"0.5);                
    
TF2Attrib_SetByName(client"major increased jump height"2.0);
    
TF2Attrib_SetByName(client"parachute attribute"1.0);
    
TF2Attrib_SetByName(client"cannot be backstabbed"1.0);
    
TF2Attrib_SetByName(client"increased air control"20.0);    
    
TF2Attrib_SetByName(client"airblast vulnerability multiplier"0.0);
    
TF2Attrib_SetByName(client"airblast vertical vulnerability multiplier"0.0);


    new 
Weapon3 GetPlayerWeaponSlot(client2); 
    
TF2Attrib_SetByName(Weapon3"melee attack rate bonus"0.3);    
    
TF2Attrib_SetByName(Weapon3"melee bounds multiplier"3.0);                    
    
TF2Attrib_SetByName(Weapon3"melee range multiplier"3.0);
    
TF2Attrib_SetByName(Weapon3"damage bonus"5.0);
    
TF2Attrib_SetByName(Weapon3"turn to gold"1.0);
    
    
TF2_RemoveAllWearables(client);
}

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");
    }
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    if (
GetEntityFlags(client) & FL_ONGROUND && g_bIsHHH[client] == true)
    {
        if (
buttons IN_ATTACK2 && g_bIsHHH[client] == true && IsTaunting[client] != true && g_bIsHHH[client] == true)
        { 
            
TF2_StunPlayer(clientFloat:3.0Float:1.0TF_STUNFLAGS_LOSERSTATE);
            
MakePlayerInvisible(client0);
            
            new 
Model CreateEntityByName("prop_dynamic");
            if (
IsValidEdict(Model))
            {
                
IsTaunting[client] = true;
                new 
Float:pos[3], Float:ang[3];
                
decl String:ClientModel[256];
                
                
GetClientModel(clientClientModelsizeof(ClientModel));
                
GetEntPropVector(clientProp_Send"m_vecOrigin"pos);
                
TeleportEntity(ModelposNULL_VECTORNULL_VECTOR);
                
GetClientEyeAngles(clientang);
                
ang[0] = 0.0;
                
ang[2] = 0.0;

                
DispatchKeyValue(Model"model"ClientModel);
                
DispatchKeyValue(Model"DefaultAnim""zap_attack");    
                
DispatchKeyValueVector(Model"angles"ang);
                
                
DispatchSpawn(Model);
                
                
SetVariantString("OnAnimationDone !self:KillHierarchy::0.0:1");
                
AcceptEntityInput(Model"AddOutput");
                
                
CreateTimer(Float:1.0DoHellfireclient);
                
SetEntityMoveType(clientMOVETYPE_NONE);
                
PlayHellfire();
                
                
CreateTimer(Float:2.8ResetTauntclient);
                
SetWeaponsAlpha(client0);                
            }
        }
        else if(
buttons IN_RELOAD && IsTaunting[client] != true && g_bIsHHH[client] == true)        
        {
            
MakePlayerInvisible(client0);

            
SetVariantInt(1);
            
AcceptEntityInput(client"SetForcedTauntCam");
            
            new 
Model CreateEntityByName("prop_dynamic");
            if (
IsValidEdict(Model))
            {
                
IsTaunting[client] = true;
                new 
Float:posc[3], Float:ang[3];
                
decl String:ClientModel[256];
                
                
GetClientModel(clientClientModelsizeof(ClientModel));
                
GetEntPropVector(clientProp_Send"m_vecOrigin"posc);
                
TeleportEntity(ModelposcNULL_VECTORNULL_VECTOR);
                
GetClientEyeAngles(clientang);
                
ang[0] = 0.0;
                
ang[2] = 0.0;

                
DispatchKeyValue(Model"model"ClientModel);
                
DispatchKeyValue(Model"DefaultAnim""bomb_attack");    
                
DispatchKeyValueVector(Model"angles"ang);
                
                
DispatchSpawn(Model);
                
                
SetVariantString("OnAnimationDone !self:KillHierarchy::0.0:1");
                
AcceptEntityInput(Model"AddOutput");
                
                
SetEntityMoveType(clientMOVETYPE_NONE);
                
Playbombsound();
                
CreateTimer(Float:3.0StartBombAttackclient);
                
SetWeaponsAlpha(client0);
            }
        }
    }
    return 
Plugin_Continue;
}

public 
Action:ResetTaunt(Handle:timerany:client)
{
    
IsTaunting[client] = false;
    
MakePlayerInvisible(client255);
    
SetEntityMoveType(clientMOVETYPE_ISOMETRIC);    

}

stock MakePlayerInvisible(clientalpha)
{
    
SetWeaponsAlpha(clientalpha);
    
SetWearableAlpha(clientalpha);
    
SetEntityRenderMode(clientRENDER_TRANSCOLOR);
    
SetEntityRenderColor(client255255255alpha);
}

stock SetWeaponsAlpha (clientalpha)
{
    
decl String:classname[64];
//    new m_hMyWeapons = FindSendPropOffs("CBasePlayer", "m_hMyWeapons");
    
new m_hMyWeapons FindSendPropInfo("CBasePlayer""m_hMyWeapons");
    for(new 
0weapon189+= 4)
    {
        
weapon GetEntDataEnt2(clientm_hMyWeapons i);
        if(
weapon > -&& IsValidEdict(weapon))
        {
            
GetEdictClassname(weaponclassnamesizeof(classname));
            if(
StrContains(classname"tf_weapon"false) != -|| StrContains(classname"tf_wearable"false) != -1)
            {
                
SetEntityRenderMode(weaponRENDER_TRANSCOLOR);
                
SetEntityRenderColor(weapon255255255alpha);
            }
        }
    }
}

public 
Action:DoHellfire(Handle:timerany:client)
{
    new 
Float:vec[3];
    
GetClientEyePosition(clientvec);
    
    
    for(new 
i=1i<=MaxClientsi++)
    {
        if(!
IsClientInGame(i) || !IsPlayerAlive(i)) continue;
        
        new 
Float:pos[3];
        
GetClientEyePosition(ipos);
        
        new 
Float:distance GetVectorDistance(vecpos);
        
        new 
Float:dist 310.0;
        
        
        if(
distance dist)
        {
            if (
== client) continue;
            
            new 
Float:vecc[3];
            
            
vecc[0] = 0.0;
            
vecc[1] = 0.0;
            
vecc[2] = 1500.0;
            
            
TeleportEntity(iNULL_VECTORNULL_VECTORvecc);
            
TF2_IgnitePlayer(iclient);
        }
    }
}

public 
PlayHellfire()
{
    new 
soundswitch;
    
soundswitch GetRandomInt(13);

    
    switch(
soundswitch)
    {
    case 
1:
        {
            
EmitSoundToAll(HELLFIRE);
        }
        
    case 
2:
        {
            
EmitSoundToAll(HELLFIRE2);
        }
        
    case 
3:
        {
            
EmitSoundToAll(HELLFIRE3);
        }
    }
}

stock bool:IsValidClient(client)
{
    if (
client <= 0) return false;
    if (
client MaxClients) return false;
    return 
IsClientInGame(client);
}

stock TF2_RemoveAllWearables(client)
{
    new 
wearable = -1;
    while ((
wearable FindEntityByClassname(wearable"tf_wearable*")) != -1)
    {
        if (
IsValidEntity(wearable))
        {
            new 
player GetEntPropEnt(wearableProp_Send"m_hOwnerEntity");
            if (
client == player)
            {
                
TF2_RemoveWearable(clientwearable);
            }
        }
    }

    while ((
wearable FindEntityByClassname(wearable"tf_powerup_bottle")) != -1)
    {
        if (
IsValidEntity(wearable))
        {
            new 
player GetEntPropEnt(wearableProp_Send"m_hOwnerEntity");
            if (
client == player)
            {
                
TF2_RemoveWearable(clientwearable);
            }
        }
    }

    while ((
wearable FindEntityByClassname(wearable"tf_weapon_spellbook")) != -1)
    {
        if (
IsValidEntity(wearable))
        {
            new 
player GetEntPropEnt(wearableProp_Send"m_hOwnerEntity");
            if (
client == player)
            {
                
TF2_RemoveWearable(clientwearable);
            }
        }
    }
}

stock SetWearableAlpha(clientalphabool:override false)
{
    new 
count;
    for (new 
MaxClients 1<= 2048z++)
    {
        if (!
IsValidEntity(z)) continue;
        
decl String:cls[35];
        
GetEntityClassname(zclssizeof(cls));
        if (!
StrEqual(cls"tf_wearable") && !StrEqual(cls"tf_powerup_bottle")) continue;
        if (
client != GetEntPropEnt(zProp_Send"m_hOwnerEntity")) continue;
        {
            
SetEntityRenderMode(zRENDER_TRANSCOLOR);
            
SetEntityRenderColor(z255255255alpha);
        }
        if (
alpha == 0AcceptEntityInput(z"Kill");
        
count++;
    }
    return 
count;
}

public 
Action:Command_getms1(client)

    new 
soundswitch;
    
soundswitch GetRandomInt(14);    
    switch(
soundswitch)
    {
    case 
1:
        {
            
EmitSoundToAll(DOOM1);
        }
    case 
2:
        {
            
EmitSoundToAll(DOOM2);
        }
    case 
3:
        {
            
EmitSoundToAll(DOOM3);
        }
    case 
4:
        {
            
EmitSoundToAll(DOOM4);
        }
    }
    
ms true;
    
CreateTimer(10.0Command_getms2);    
}

public 
Action:Command_getms2(Handle timer)

    if (
ms == false)
    {
        return 
Plugin_Handled;
    }
    new 
soundswitch2;
    
soundswitch2 GetRandomInt(12);    
    switch(
soundswitch2)
    {
    case 
1:
        {
            
EmitSoundToAll(LOL);
        }
    case 
2:
        {
            
EmitSoundToAll(LOL2);
        }
    }    
    
CreateTimer(10.0Command_GetmsRandom);
    
    return 
Plugin_Handled;
}

public 
Action:Command_getms3(client)

    
ms false;
    return 
Plugin_Handled;
}

public 
Action:Command_getmsnow(clientargs)
{
    
CreateTimer(0.1Command_GetmsRandom);
}

public 
Action:Command_GetmsRandom(Handle timer)
{
    new 
iRand GetRandomInt(1,11);
    if (
iRand == iLastRand)
    {
        
iRand GetRandomInt(1,11);    
    }
    if (
iRand == iLastRand)
    {
        
iRand GetRandomInt(1,11);    
    }    
    switch(
iRand)
    {
    case 
1:
        {
            
EmitSoundToAll(HELLFIRE);
        }
    case 
2:
        {
            
EmitSoundToAll(HELLFIRE2);            
        }
    case 
3:
        {
            
EmitSoundToAll(BOMB);                
        }
    case 
4:
        {
            
EmitSoundToAll(BOMB2);                
        }
    case 
5:
        {
            
EmitSoundToAll(DOOM1);            
        }
    case 
6:
        {
            
EmitSoundToAll(DOOM2);                
        }
    case 
7:
        {
            
EmitSoundToAll(DOOM3);                
        }
    case 
8:
        {
            
EmitSoundToAll(DOOM4);                
        }
    case 
9:
        {
            
EmitSoundToAll(LOL);            
        }
    case 
10:
        {
            
EmitSoundToAll(LOL2);            
        }
    case 
11:
        {
            
EmitSoundToAll(LOL);        
        }            
    }
    
iLastRand iRand;

    
CreateTimer(10.0Command_getms2);
    
    return 
Plugin_Handled;
}

stock forceSpellbook(client)
{
    new 
Handle:hWeapon TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
    
TF2Items_SetClassname(hWeapon"tf_weapon_spellbook");
    
TF2Items_SetItemIndex(hWeapon1070);
    
TF2Items_SetLevel(hWeapon100);
    
TF2Items_SetQuality(hWeapon6);
    
TF2Items_SetNumAttributes(hWeapon1);
    
TF2Items_SetAttribute(hWeapon05470.5);

    new 
entity TF2Items_GiveNamedItem(clienthWeapon);
    
CloseHandle(hWeapon);
    
EquipPlayerWeapon(cliententity);
    return 
entity;
}

SetSpell2(clientspelluses)
{
    new 
ent GetSpellBook(client);
    if(!
IsValidEntity(ent)) return;
    
SetEntProp(entProp_Send"m_iSelectedSpellIndex"spell);
    
SetEntProp(entProp_Send"m_iSpellCharges"uses);
}  

GetSpellBook(client)
{
    new 
entity = -1;
    while((
entity FindEntityByClassname(entity"tf_weapon_spellbook")) != INVALID_ENT_REFERENCE)
    {
        if(
GetEntPropEnt(entityProp_Send"m_hOwnerEntity") == client) return entity;
    }
    return -
1;
}

public 
Playbombsound()
{
    new 
soundswitch;
    
soundswitch GetRandomInt(14);    
    switch(
soundswitch)
    {
    case 
1:
        {
            
EmitSoundToAll(BOMB);
        }
    case 
2:
        {
            
EmitSoundToAll(BOMB2);
        }
    case 
3:
        {
            
EmitSoundToAll(BOMB3);
        }
    case 
4:
        {
            
EmitSoundToAll(BOMB4);
        }
    }
}

public 
Action:StartBombAttack(Handle:timerany:client)
{
    new 
Handle:BTime CreateTimer(Float:2.0CreateBombclientTIMER_REPEAT);
    
CreateTimer(Float:11.75ResetTauntclient);
    
CreateTimer(Float:11.0KillBombsBTime);
    
TimedParticle(client"merasmus_book_attack"Float:11.0);
}
public 
Action:CreateBomb(Handle:timerany:client)
{
    if(
g_bIsHHH[client] == true)
    {
        
SpawnClusters(client);
    }
}
public 
Action:KillBombs(Handle:timerany:Btimer)
{
    
KillTimer(Btimer);
}

public 
SpawnClusters(ent)
{
    if (
IsValidEntity(ent))
    {
        new 
Float:bombSpreadVel 50.0;
        new 
Float:bombVertVel 90.0;
        new 
bombVariation 2;
        
        new 
Float:pos[3];
        
GetClientEyePosition(entpos);
        
pos[2] += 105.0;
        
        
decl Float:ang[3];
        
        for (new 
011i++)
        {
            
ang[0] = ((GetURandomFloat() + 0.1) * bombSpreadVel bombSpreadVel 2.0) * ((GetURandomFloat() + 0.1) * bombVariation);
            
ang[1] = ((GetURandomFloat() + 0.1) * bombSpreadVel bombSpreadVel 2.0) * ((GetURandomFloat() + 0.1) * bombVariation);
            
ang[2] = ((GetURandomFloat() + 0.1) * bombVertVel) * ((GetURandomFloat() + 0.1) * bombVariation);

            new 
ent2 CreateEntityByName("prop_physics_override");

            if(
ent2 != -1)
            {                    
                
DispatchKeyValue(ent2"model"BOMBMODEL);
                
DispatchKeyValue(ent2"solid""6");
                
DispatchKeyValue(ent2"renderfx""0");
                
DispatchKeyValue(ent2"rendercolor""255 255 255");
                
DispatchKeyValue(ent2"renderamt""255");
                
SetEntPropEnt(ent2Prop_Data"m_hOwnerEntity"ent);
                
DispatchSpawn(ent2);
                
TeleportEntity(ent2posNULL_VECTORang);

                
CreateTimer((GetURandomFloat() + 0.1) / 1.75 0.5ExplodeBombletent2TIMER_FLAG_NO_MAPCHANGE);
            }            
        }
    }
}
public 
Action:ExplodeBomblet(Handle:timerany:ent)
{
    if (
IsValidEntity(ent))
    {
        
decl Float:pos[3];
        
GetEntPropVector(entProp_Data"m_vecOrigin"pos);
        
pos[2] += 32.0;

        new 
client GetEntPropEnt(entProp_Data"m_hOwnerEntity");
        new 
team GetEntProp(clientProp_Send"m_iTeamNum");

        
AcceptEntityInput(ent"Kill");
        new 
BombMagnitude 120;
        new 
explosion CreateEntityByName("env_explosion");
        if (
explosion != -1)
        {
            
decl String:tMag[8];
            
IntToString(BombMagnitudetMagsizeof(tMag));
            
DispatchKeyValue(explosion"iMagnitude"tMag);
            
DispatchKeyValue(explosion"spawnflags""0");
            
DispatchKeyValue(explosion"rendermode""5");
            
SetEntProp(explosionProp_Send"m_iTeamNum"team);
            
SetEntPropEnt(explosionProp_Data"m_hOwnerEntity"client);
            
DispatchSpawn(explosion);
            
ActivateEntity(explosion);

            
TeleportEntity(explosionposNULL_VECTORNULL_VECTOR);                
            
AcceptEntityInput(explosion"Explode");
            
AcceptEntityInput(explosion"Kill");
        }        
    }
}
public 
TimedParticle(client, const String:path[32], Float:FTime)
{
    new 
TParticle CreateEntityByName("info_particle_system");
    if (
IsValidEdict(TParticle))
    {
        new 
Float:pos[3];
        
GetEntPropVector(clientProp_Send"m_vecOrigin"pos);
        
        
TeleportEntity(TParticleposNULL_VECTORNULL_VECTOR);
        
        
DispatchKeyValue(TParticle"effect_name"path);
        
        
DispatchKeyValue(TParticle"targetname""particle");
        
        
SetVariantString("!activator");
        
AcceptEntityInput(TParticle"SetParent"clientTParticle0);
        
        
DispatchSpawn(TParticle);
        
ActivateEntity(TParticle);
        
AcceptEntityInput(TParticle"Start");
        
CreateTimer(FTimeKillTParticleTParticle);
        
    }
}
public 
Action:KillTParticle(Handle:timerany:index)
{
    if (
IsValidEntity(index))
    {
        
AcceptEntityInput(index"Kill");
    }

Gray team code:
PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>

new bool:isGray[MAXPLAYERS+1] = false;
new 
lastTeam[MAXPLAYERS+1] = 0;

#define PLUGIN_VERSION "0.2"

public Plugin:myinfo =
{
    
name "Gray Team",
    
author "Dachtone",
    
description "Changes player's team to gray",
    
version PLUGIN_VERSION,
    
url "http://sourcegames.ru/"
}

public 
OnPluginStart()
{
    
CreateConVar("gray_version"PLUGIN_VERSION"Gray Team Version"FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);

    
RegAdminCmd("sm_gray"AdmGrayADMFLAG_SLAY"Change player's team to gray");
    
    
HookEvent("player_spawn"PlayerSpawn);
    
HookEvent("player_death"PlayerDeathEventHookMode_Pre);
    
    
HookEvent("arena_round_start"RoundStart);
    
HookEvent("teamplay_round_start"PreRoundStart);
    
    
LoadTranslations("common.phrases");
}

public 
OnClientPostAdminCheck(client)
{
    
isGray[client] = false;
}

public 
OnClientDisconnect(client)
{
    
isGray[client] = false;
}

public 
Action:PlayerDeath(Handle:eventString:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"0));
    if (
IsValidClient(client) && isGray[client])
    {
        
ChangeClientTeam(clientlastTeam[client]);
        
isGray[client] = false;
    }
}

public 
Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    
isGray[client] = false;
}

public 
PreRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    for (new 
1<= 32i++)
    {
        if (
IsValidClient(i) && isGray[i])
        {
            
ChangeClientTeam(ilastTeam[i]);
            
TF2_RespawnPlayer(i);
            
isGray[i] = false;
        }
    }
}

public 
RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    for (new 
1<= 32i++)
    {
        if (
IsValidClient(i) && isGray[i])
        {
            
ChangeClientTeam(ilastTeam[i]);
            
TF2_RespawnPlayer(i);
            
isGray[i] = false;
        }
    }
}

public 
Action:AdmGray(clientargs)
{
    if (!
IsValidClient(client))
        return 
Plugin_Handled;
    
    new 
target;
    if (
args 1)
    {
        
target client;
    }
    else
    {
        new 
String:arg[32];
        
GetCmdArg(1argsizeof(arg));
        
target FindTarget(clientarg);
        if (
target == -1)
            return 
Plugin_Handled;
    }
    if (
IsValidClient(target))
    {
        if (!
isGray[target])
        {
            if (
IsPlayerAlive(target))
            {
                
lastTeam[target] = GetClientTeam(target);
                new 
Float:origin[3], Float:angles[3];
                
GetClientAbsOrigin(targetorigin);
                
GetClientAbsAngles(targetangles);
                
ChangeClientTeam(target0);
                
TF2_RespawnPlayer(target);
                
TeleportEntity(targetoriginanglesNULL_VECTOR);
                
isGray[target] = true;
                
                
PrintToChat(client"[SM] %N is in the Gray team now"target);
            }
            else
            {
                
ReplyToCommand(client"[SM] Player must be alive");
            }
        }
        else
        {
            if (
IsPlayerAlive(target))
            {
                new 
Float:origin[3], Float:angles[3];
                
GetClientAbsOrigin(targetorigin);
                
GetClientAbsAngles(targetangles);
                
ChangeClientTeam(targetlastTeam[target]);
                
TF2_RespawnPlayer(target);
                
TeleportEntity(targetoriginanglesNULL_VECTOR);
                
isGray[target] = false;
            }
            else
            {
                
ChangeClientTeam(targetlastTeam[target]);
                
isGray[target] = false;
            }
            
PrintToChat(client"[SM] %N is no longer in the Gray team"target);
        }
    }
    else
    {
        
ReplyToCommand(client"[SM] Player must be available");
    }
    return 
Plugin_Handled;
}

stock bool:IsValidClient(client)
{
    if(
client<=|| client>MaxClients)
    {
        return 
false;
    }

    if(!
IsClientConnected(client) || !IsClientInGame(client))
    {
        return 
false;
    }
    return 
true;

Any help would be appreciated.

Last edited by PC Gamer; 11-25-2018 at 11:21. Reason: Solved
PC Gamer is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-10-2018 , 15:43   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #2

*1 month later...

Do you still need help or you found the solution ?
__________________
Whai is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-12-2018 , 19:25   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #3

Whai... Still no luck finding a solution.
PC Gamer is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-13-2018 , 12:56   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #4

Try to test with
Code:
SetEntProp(client, "m_iTeamNum", 1);
Or

Code:
SetEntProp(client, "m_iTeam", 1);
Instead of using

Code:
ChangeClientTeam(client, 0);
Note : from tf2.inc
Quote:
enum TFTeam
{
TFTeam_Unassigned = 0,
TFTeam_Spectator = 1,
TFTeam_Red = 2,
TFTeam_Blue = 3
};
What you did was setting the player to unassigned team (it will set to the player random team (Blu or Red) so not in grey team)
__________________

Last edited by Whai; 11-13-2018 at 12:57.
Whai is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-13-2018 , 17:35   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #5

After some test of my plugin that I've created, my code should works :

Here is the code :

PHP Code:
#pragma semicolon 1

#define PLUGIN_VERSION "1.0.0"

#include <sourcemod>
#include <sdktools>
#include <tf2>
#include <tf2_stocks>

#pragma newdecls required

public Plugin myinfo 
{
    
name "[TEST] Grey Team",
    
author "Whai",
    
description "",
    
version PLUGIN_VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_grey"Command_GreyADMFLAG_ROOT"Set grey team");
    
RegAdminCmd("sm_resetteam"Command_ResetTeamADMFLAG_ROOT"Set default team");
    
RegAdminCmd("sm_getspeccount"Command_GetSpecCountADMFLAG_ROOT); //This is for looking if the number of spectators updated
    
    
HookEvent("player_team"PlayerChangeTeam);
    
HookEvent("player_death"PlayerDeath);
}

float fOrigin[MAXPLAYERS+1][3], fAngles[MAXPLAYERS+1][3];

int iLastClientTeam[MAXPLAYERS+1];

bool bIsGreyTeam[MAXPLAYERS+1];

public 
void OnClientPutInServer(int iClient)
{
    
bIsGreyTeam[iClient] = false;
}

public 
void OnClientDisconnect(int iClient)
{
    
bIsGreyTeam[iClient] = false;
}

public 
Action PlayerChangeTeam(Event hEvent, const char[] cNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    if(
bIsGreyTeam[iClient])
        
bIsGreyTeam[iClient] = false//Tell after changed team he is no longer in Grey Team
}

public 
Action PlayerDeath(Event hEvent, const char[] cNamebool bDontBroadcast)
{
    
int iClient GetClientOfUserId(hEvent.GetInt("userid"));
    
    if(
bIsGreyTeam[iClient])
    {
        
TF2_ChangeClientTeam(iClientview_as<TFTeam>(iLastClientTeam[iClient])); //After player died, change to him the team he was
        
bIsGreyTeam[iClient] = false//Tell after changed team he is no longer in Grey Team
    
}
}

public 
Action Command_Grey(int iClientint iArgs)
{
    if (!
iClient && !iArgs//!iClient = (iClient == 0); !iArgs = (iArgs == 0)
    
{
        
ReplyToCommand(iClient"[SM] Usage in console server: sm_grey <target>");
        return 
Plugin_Handled;
    }
    
    if(
iArgs 1)
    {
        
ReplyToCommand(iClient"[SM] Usage: sm_grey or sm_grey <target>");
        return 
Plugin_Handled;
    }
    
    if(!
iArgs)
    {
        if(!
bIsGreyTeam[iClient])    //We want to know if he is not already in grey team
        
{
            
iLastClientTeam[iClient] = GetEntProp(iClientProp_Send"m_iTeamNum"); //First we want to save his actual team

            
GetClientAbsOrigin(iClientfOrigin[iClient]);    //Get the actual location of him
            
GetClientEyeAngles(iClientfAngles[iClient]); //Get the actual angles of him
            
            
TF2_ChangeClientTeam(iClientTFTeam_Spectator); //Set to him Spectator team alias Grey Team
            
SetEntProp(iClientProp_Send"m_iTeamNum"0); //Set to him Unassigned team because it will choose random team, and because we want to make him respawning 
            
TF2_RespawnPlayer(iClient); //Respawn the player
            
TeleportEntity(iClientfOrigin[iClient], fAngles[iClient], NULL_VECTOR); //Teleport him where he was
            
SetEntProp(iClientProp_Send"m_iTeamNum"1); //Now set him to Spectator Team alias Grey Team
            
bIsGreyTeam[iClient] = true//Tell now he is on Grey Team

            //CreateTimer(0.1, ChangeTargetTeam, iClient);    //Removed because didn't know that doesn't need 0.1s
        
}
        else
        {
            
ReplyToCommand(iClient"[SM] You are already in grey team");
            return 
Plugin_Handled;
        }
    }
    
    if(
iArgs == 1)
    {
        
char arg1[MAX_NAME_LENGTH], target_name[MAX_TARGET_LENGTH];
        
int target_list[MAXPLAYERS], target_count;
        
bool tn_is_ml;

        
GetCmdArg(1arg1sizeof(arg1));

        if((
target_count ProcessTargetString(arg1iClienttarget_listMAXPLAYERSCOMMAND_FILTER_ALIVE COMMAND_FILTER_NO_MULTItarget_namesizeof(target_name), tn_is_ml)) <= 0)
        {
            
ReplyToTargetError(iClienttarget_count);
            return 
Plugin_Handled;
        }

        for(
int i 0target_counti++)
        {
            
int iTarget target_list[i];
            
            if(!
iTarget//if iTarget == 0
                
return Plugin_Handled;
                
            if(!
bIsGreyTeam[iTarget])
            {
                
iLastClientTeam[iTarget] = GetEntProp(iTargetProp_Send"m_iTeamNum");

                
GetClientAbsOrigin(iTargetfOrigin[iTarget]);
                
GetClientEyeAngles(iTargetfAngles[iTarget]);
                
TF2_ChangeClientTeam(iTargetTFTeam_Spectator);
                
SetEntProp(iTargetProp_Send"m_iTeamNum"0);
                
TF2_RespawnPlayer(iTarget);
                
TeleportEntity(iTargetfOrigin[iTarget], fAngles[iTarget], NULL_VECTOR);
                
SetEntProp(iTargetProp_Send"m_iTeamNum"1);
                
bIsGreyTeam[iTarget] = true;

                
//CreateTimer(0.1, ChangeTargetTeam, iTarget);
            
}
        }
    }
    return 
Plugin_Handled;
}

public 
Action Command_ResetTeam(int iClientint iArgs)
{
    if(!
iClient && !iArgs)
    {
        
ReplyToCommand(iClient"[SM] Usage in console server: sm_resetteam <target>");
        return 
Plugin_Handled;
    }
    
    if(
iArgs 1)
    {
        
ReplyToCommand(iClient"[SM] Usage: sm_resetteam or resetteam <target>");
        return 
Plugin_Handled;
    }
    
    if(!
iArgs)
    {
        if(
bIsGreyTeam[iClient])    //Check if he is atleast in Grey Team
        
{
            
GetClientAbsOrigin(iClientfOrigin[iClient]);    //get the current location of him
            
GetClientEyeAngles(iClientfAngles[iClient]);    //get the current location of him
            
            
TF2_ChangeClientTeam(iClientview_as<TFTeam>(iLastClientTeam[iClient])); //Change to him the team he was
            
TF2_RespawnPlayer(iClient); //Respawn him
            
TeleportEntity(iClientfOrigin[iClient], fAngles[iClient], NULL_VECTOR); //Teleport him where he was
            
bIsGreyTeam[iClient] = false//Tell that he is not in Grey Team
        
}
        else
        {
            
ReplyToCommand(iClient"[SM] You are already on your default team");
            return 
Plugin_Handled;
        }
    }
    
    if(
iArgs == 1)
    {
        
char arg1[MAX_NAME_LENGTH], target_name[MAX_TARGET_LENGTH];
        
int target_list[MAXPLAYERS], target_count;
        
bool tn_is_ml;

        
GetCmdArg(1arg1sizeof(arg1));

        if((
target_count ProcessTargetString(arg1iClienttarget_listMAXPLAYERSCOMMAND_FILTER_ALIVE COMMAND_FILTER_NO_MULTItarget_namesizeof(target_name), tn_is_ml)) <= 0)
        {
            
ReplyToTargetError(iClienttarget_count);
            return 
Plugin_Handled;
        }

        for(
int i 0target_counti++)
        {
            
int iTarget target_list[i];
            
            if(!
iTarget//if iTarget == 0
                
return Plugin_Handled;
                
            if(
bIsGreyTeam[iTarget])
            {
                
GetClientAbsOrigin(iTargetfOrigin[iTarget]);
                
GetClientEyeAngles(iTargetfAngles[iTarget]);

                
TF2_ChangeClientTeam(iTargetview_as<TFTeam>(iLastClientTeam[iTarget]));
                
TF2_RespawnPlayer(iTarget);
                
TeleportEntity(iTargetfOrigin[iTarget], fAngles[iTarget], NULL_VECTOR);
                
bIsGreyTeam[iTarget] = false;

            }
        }
    }
    
    return 
Plugin_Handled;
}

public 
Action Command_GetSpecCount(int iClientint iArgs)
{
    
int iHelp GetTeamPlayerCount(view_as<int>(TFTeam_Spectator));
    
    
PrintToChat(iClient"[SM] There is/are %i spectator(s)"iHelp);
    
    return 
Plugin_Handled;
}

stock int GetTeamPlayerCount(int iTeamNum = -1)
{
    
int iCounter;
    for(
int i 1<= MaxClientsi++)
        if(
IsValidClient(i) && !IsFakeClient(i) && (iTeamNum == -|| GetClientTeam(i) == iTeamNum))
            
iCounter++;
    return 
iCounter;
}

stock bool IsValidClient(int client)
{
    return (
<= client <= MaxClients) && IsClientInGame(client) && !IsFakeClient(client);
}

/*public Action ChangeTargetTeam(Handle timer, any target) ////Useless : no need a timer
{
    TF2_ChangeClientTeam(target, TFTeam_Spectator);
    SetEntProp(target, Prop_Send, "m_iTeamNum", 2);
    TF2_RespawnPlayer(target);
    TeleportEntity(target, fOrigin[target], fAngles[target], NULL_VECTOR);
    SetEntProp(target, Prop_Send, "m_iTeamNum", 1);
    bIsGreyTeam[target] = true;
}*/ 
or here is the .sp file

[EDIT]
I was wrong about unassinged team, it’s not the random team but a team when you didn’t choose any team (spec, blu or red)
Some info : while you are in unassigned team you have the red skin but you can still deal damage to everyone but in the scoreboard you will still be in your team (red or blu) so that’s better to choose spec instead of unassigned team

NOTE :

Add on "OnPluginStart()" :

Code:
	LoadTranslations("common.phrases");
Attached Files
File Type: sp Get Plugin or Get Source (NewScript.sp - 250 views - 7.4 KB)
__________________

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

Whai,

The gray plugin by Dachtone already worked great. That wasn't the issue.

The desired effect is achieved if the two plugins are used separately:
1. First, use the !gray command with the gray plugin written by Dachtone
2. Next, use the !bewizard command from the bewizard plugin

Goal: Somehow merge the two plugins so a single command of bewizard will achieve the desired effect.
PC Gamer is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-15-2018 , 18:11   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #7

Are you sure about the gray team that works for you ? Because for me it doesn’t work, maybe because I’*m playing in MvM.

Well for your code, I’ll post it when I finished to test and edit the plugin
__________________
Whai is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-16-2018 , 15:20   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #8

Here is the plugin you requested :

Tell me if it works


Also : BeWizard2 is for if the gray team code of Dachtone is not working.
Attached Files
File Type: sp Get Plugin or Get Source (BeWizard.sp - 89 views - 27.9 KB)
File Type: sp Get Plugin or Get Source (BeWizard2.sp - 107 views - 28.1 KB)
__________________
Whai is offline
Whai
Senior Member
Join Date: Jul 2018
Old 11-17-2018 , 12:40   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #9

Tested the plugin in non-MvM maps, and the "BeWizard" is working for non-MvM maps and the "BeWizard2" is for MvM maps.


Now I understand why we call "grey/gray team" because I can see on KillFeed that when you are in "Unassgined team", your name will display in grey/gray. But when you are on Spectator you name is in white.
__________________
Whai is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 11-18-2018 , 18:51   Re: [TF2] Put Merasmus on Gray Team
Reply With Quote #10

The bewizard2 works. Thanks!

I changed the attached code a bit to prevent Merasmus from taking damage from his bombs.

Known issues that I can't seem to solve:
1. If player has Fancy Spellbook equipped prior to becoming Merasmus, is made Merasmus, and casts Spell, Server will crash with no error. This does not occur if Spellbook Magazine is equipped, or nothing is equipped in Action Slot prior to becoming Merasmus.

2. When player dies they sometimes get stuck in Spectator and are unable to join the Red or Blue team. Admins can't move them to a team either. Player must disconnect and reconnect to join a team.

3. When a player who was Merasmus disconnects, there is a chance that the Server will crash with no error.

These don't appear to be related to your code.
Attached Files
File Type: sp Get Plugin or Get Source (bewizard.sp - 58 views - 24.9 KB)
PC Gamer 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 15:58.


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