I'm working on a new set of commands for my server and may be releasing them them not sure yet but, I need a little help with a small problem.
This is what i got for my revive command:
/* fixed
Now this all works fine just that if i want to revive myself i have to put a space after "/revive", how would I go about making this command the same just not having to put a space after "/revive" to revive myself. fixed */ :p
sorry that was the wrong question to ask that problem was an easy fix and i feel like and idiot :p but i fixed my last problem and now when i use the command "/revive test[PM]" it goes through the first section of code and revives myself then i get a message that says "test is not dead" so it also goes through the second section of code -.- anyone wanna help
This is what i got for my revive command:
Code:
#region Revive
if (Cmd[0] == "/Revive" || Cmd[0] == "/revive")
{
if (GC.GM || GC.PM)
{
if (C == null)
{
if (!GC.MyChar.Alive)
{
GC.MyChar.Ghost = false;
GC.MyChar.BlueName = false;
GC.MyChar.CurHP = (ushort)GC.MyChar.MaxHP;
GC.MyChar.Alive = true;
GC.MyChar.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.Dead);
GC.MyChar.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.BlueName);
GC.MyChar.Body = GC.MyChar.Body;
GC.MyChar.Hair = GC.MyChar.Hair;
GC.MyChar.Equips.Send(GC, false);
}
else
GC.LocalMessage(2000, "Your not dead.");
}
Game.Character C = Game.World.CharacterFromName(Cmd[1]);
if (C != null)
{
if (!C.Alive)
{
C.Ghost = false;
C.BlueName = false;
C.CurHP = (ushort)GC.MyChar.MaxHP;
C.Alive = true;
C.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.Dead);
C.StatEff.Remove(NewestCOServer.Game.StatusEffectEn.BlueName);
C.Body = GC.MyChar.Body;
C.Hair = GC.MyChar.Hair;
C.Equips.Send(GC, false);
C.MyClient.LocalMessage(2000, GC.MyChar.Name + " has revived you.");
}
else
GC.LocalMessage(2000, C.Name + " is not dead.");
}
}
else
GC.LocalMessage(2000, "You not a [GM] or [PM].");
}
#endregion
Now this all works fine just that if i want to revive myself i have to put a space after "/revive", how would I go about making this command the same just not having to put a space after "/revive" to revive myself. fixed */ :p
sorry that was the wrong question to ask that problem was an easy fix and i feel like and idiot :p but i fixed my last problem and now when i use the command "/revive test[PM]" it goes through the first section of code and revives myself then i get a message that says "test is not dead" so it also goes through the second section of code -.- anyone wanna help