|
You last visited: Today at 04:38
Advertisement
[?]So I have this code in my sr.cs ( to make it so you auto ride a hosre in map 1940
Discussion on [?]So I have this code in my sr.cs ( to make it so you auto ride a hosre in map 1940 within the CO2 Private Server forum part of the Conquer Online 2 category.
03/14/2010, 18:02
|
#1
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
[?]So I have this code in my sr.cs ( to make it so you auto ride a hosre in map 1940
Ok so I need abit of help I have tryed really hard on this code so when you enter the map 1940 ( steed race map ) you will automaticaly ride a horse and before you say you need to add stuff in character.cs this code wont just work for ur info I have done that just finishing of adding the command ive done the smjoin varibles and stuff also done the npc etc etc used tdm as a base anyway here is my code
Code:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using NewestCOServer.Game;
namespace NewestCOServer.Features
{
public class se
{
public static DateTime LastScores;
public static void SendScores()
{
foreach (Character C in World.H_Chars.Values)
{
if (C.Loc.Map == 1950)
{
GC.MyChar.Effect = NewestCOServer.Game.Item.RebornEffect.Horsie;
}
}
}
}
But I get error on "MyChar and Effect I need help PLEASE!
|
|
|
03/14/2010, 18:05
|
#2
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Paralyzer[GM]
Ok so I need abit of help I have tryed really hard on this code so when you enter the map 1940 ( steed race map ) you will automaticaly ride a horse and before you say you need to add stuff in character.cs this code wont just work for ur info I have done that just finishing of adding the command ive done the smjoin varibles and stuff also done the npc etc etc used tdm as a base anyway here is my code
Code:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading;
using System.IO;
using NewestCOServer.Game;
namespace NewestCOServer.Features
{
public class se
{
public static DateTime LastScores;
public static void SendScores()
{
foreach (Character C in World.H_Chars.Values)
{
if (C.Loc.Map == 1950)
{
GC.MyChar.Effect = NewestCOServer.Game.Item.RebornEffect.Horsie;
}
}
}
}
But I get error on "MyChar and Effect I need help PLEASE!
|
You're doing a foreach statement, meaning you are defining each char a 'C'
What is this supposed to be doing anyway?
|
|
|
03/14/2010, 18:15
|
#3
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
it is suppost to make it so everybody who goes into that map will appear to be riding a horse
EDIT: I dont want to release my whole code for the entire thing but its a bass of tdm but completly modified.
|
|
|
03/14/2010, 18:22
|
#4
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Paralyzer[GM]
it is suppost to make it so everybody who goes into that map will appear to be riding a horse
EDIT: I dont want to release my whole code for the entire thing but its a bass of tdm but completly modified.
|
Wow taking my idea you ****, I told you that over my chatbox.
Oh well I'd love to see you try it.
Oh btw, why don't you just do C.StaEff.Add(StatusEffect.Ride)?
Then before they get in, have the npc check if C.Equips.Steed.ID != 0
|
|
|
03/14/2010, 18:26
|
#5
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
Hey if this was ur idea then I PROMISE you I didnt know that...honestly
EDIT: the C.StaEff.Add(StatusEffect.Ride) gives error in "StaEff and on Ride"
|
|
|
03/14/2010, 18:28
|
#6
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Paralyzer[GM]
Hey if this was ur idea then I PROMISE you I didnt know that...honestly
|
I TOLD YOU IN MY FREAKING CHATBOX LMAO.
Anyways, if you need help with it add me on msn.
|
|
|
03/14/2010, 19:06
|
#7
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
Ok, anybody else I decided to just add it in the command the command is
Code:
if (Cmd[0] == "/start sr")
{
Game.World.sr = true;
Game.World.SendMsgToAll("Server", "Steed Race start in 2 min!go TwinCity at 424 361 for join to tornament!", 2011, 0);
new Thread(new ThreadStart(delegate()
{
Console.WriteLine("Steed Race Activated (via Console).");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race will start in 1 minutes and 30 Seconds! go TwinCity at 424 361 for join to tornament!", 2011, 0);
Console.WriteLine("1 Minutes 30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race will start in 1 minutes! go TwinCity at 424 361 for join to tornament!", 2011, 0);
Console.WriteLine("1 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race will start in 30 Seconds! go TwinCity at 424 361 for join to tornament!", 2011, 0);
Console.WriteLine("30 seconds Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race will start ", 2011, 0);
Console.WriteLine("Steed Race will start ");
foreach (DictionaryEntry DE in Game.World.H_Chars)
{
Game.Character Chaar = (Game.Character)DE.Value;
if (Chaar.srjoin == 1)
{
if (Chaar.srjoin == 1)
{
C.StaEff.Add(StatusEffect.Ride);
Chaar.Teleport(1950, 049, 148);
}
}
}
Game.World.sr = false;
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 9 minutes", 2011, 0);
Console.WriteLine("9 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 8 minutes", 2011, 0);
Console.WriteLine("8 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 7 minutes", 2011, 0);
Console.WriteLine("7 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 6 minutes", 2011, 0);
Console.WriteLine("6 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 5 minutes", 2011, 0);
Console.WriteLine("5 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 4 minutes", 2011, 0);
Console.WriteLine("4 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 3 minutes", 2011, 0);
Console.WriteLine("3 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 2 minutes", 2011, 0);
Console.WriteLine("2 Minutes Left");
Thread.Sleep(60000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 1 minutes", 2011, 0);
Console.WriteLine("1 Minutes Left");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race will finish in 30 seconds! ", 2011, 0);
Console.WriteLine("Steed Race will finish in 30 seconds!");
Thread.Sleep(30000);
Game.World.SendMsgToAll("Server", "Steed Race has finished! ", 2011, 0);
Console.WriteLine("Steed Race whas finished");
}
)).Start();
}
I get error in line
Code:
[COLOR=Red]C[/COLOR].StaEff.Add([COLOR=Red]StatusEffect[/COLOR].Ride)
errors marked in red
and both of the errors are C and StatusEffect does not exist in the current context
|
|
|
03/14/2010, 19:12
|
#8
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Cause now you changed the definition from C to Chaar.
|
|
|
03/14/2010, 19:18
|
#9
|
elite*gold: 20
Join Date: Apr 2006
Posts: 1,341
Received Thanks: 886
|
Alright. First, obviously, you can't just call to a variable 'c' that does not exist.
When you do your foreach loop, you call each entry "Chaar", not "C".
So, you need to change "C.StaEff.Add(StatusEffect.Ride)" to "Chaar.StaEff.Add(StatusEffect.Ride)"
However, the namespace or class "StatusEffect" is obviously not referenced in that file, so, hit CTRL+F and type "StatusEffect", look at what file that is in, and what namespace it's under. You'll need to use that namespace, or use the namespace.class, since the error is saying it can't find anything called "StatusEffect".
|
|
|
03/14/2010, 19:19
|
#10
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
Ok I changed
Code:
C.StaEff.Add(StatusEffect.Ride);
to
Code:
Chaar.StaEff.Add(StatusEffect.Ride);
but I get error
Code:
Chaar.[COLOR=Red]StaEff[/COLOR].Add([COLOR=Red]StatusEffect[/COLOR].Ride);
lol
Thanks
|
|
|
03/14/2010, 19:22
|
#11
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Then switch those two around.
That should work.
|
|
|
03/14/2010, 19:25
|
#12
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
Ok So I changed it to
Code:
Chaar.StatusEffect.Add(StaEff.Ride);
but get error
Code:
Chaar.[COLOR=Red]StatusEffect[/COLOR].Add([COLOR=Red]StaEff[/COLOR].Ride);
so all it has done is give same error
UPDATE: I have fixed this the code should of been
Code:
Chaar.StatEff.Add(NewestCOServer.Game.StatusEffectEn.Ride);
|
|
|
03/14/2010, 19:27
|
#13
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
|
Quote:
Originally Posted by Paralyzer[GM]
Ok So I changed it to
Code:
Chaar.StatusEffect.Add(StaEff.Ride);
but get error
Code:
Chaar.[COLOR=Red]StatusEffect[/COLOR].Add([COLOR=Red]StaEff[/COLOR].Ride);
so all it has done is give same error
|
Chaar.StatEff.Add(StatusEffectEn.Ride)
|
|
|
03/14/2010, 20:01
|
#14
|
elite*gold: 0
Join Date: Feb 2010
Posts: 492
Received Thanks: 222
|
ok all working ^ wasnt the fix just look at my other post UP! so now if you have a horse it all works fine but if you dont have a horse you will still tele there and you wont be on a horse you will "Glide" so you cannot see the horse you are on but your on a horse so basicily the horse does not have any texture on it HELP!
|
|
|
03/14/2010, 22:07
|
#15
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
Can't you make a check to see if the player has a horse equipped before teleporting?
|
|
|
All times are GMT +2. The time now is 04:38.
|
|