easy teleporter.cs can someone fix it

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

easy teleporter.cs can someone fix it

Postby shanegru63624 » Fri Oct 17, 2014 8:32 am

am i doing something wrong? heres the error.. and the lines in error and the whole script.. it seems to me i gotta enter some regionnumber... x/y/z you know the gloc.. but im not sure any help would be great..


03:20:49,682 - [MAIN] - ERROR - DOL.GS.ScriptMgr - Script compilation failed because:
03:20:49,683 - [MAIN] - ERROR - DOL.GS.ScriptMgr - The name 'RegionNumber' does not exist in the current context
03:20:49,684 - [MAIN] - ERROR - DOL.GS.ScriptMgr - d:\dolserver\release\scripts\customnpc\Easy Teleporter.cs Line:63 Col:39
03:20:49,685 - [MAIN] - ERROR - DOL.GS.ScriptMgr - Script compilation failed because:
03:20:49,686 - [MAIN] - ERROR - DOL.GS.ScriptMgr - The name 'RegionNumber' does not exist in the current context
03:20:49,687 - [MAIN] - ERROR - DOL.GS.ScriptMgr - d:\dolserver\release\scripts\customnpc\Easy Teleporter.cs Line:70 Col:39


the 2 errors say the same thing.. im sure its an easy fix.. if someone can help

this is easyteleporter.cs




player.MoveTo(RegionNumber, X, Y, Z, Heading);



and heres the whole script...



// Created by Dread, To use just /mob create DOL.GS.Scripts.EasyTeleporter...
// Please Change RegionNumber, X, Y, Z, Heading to acual gloc!
// Easy to edit...
// Enjoy
using System;
using DOL;
using DOL.GS;
using DOL.Events;
using DOL.GS.PacketHandler;
using System.Collections;
using DOL.Database;

namespace DOL.GS.Scripts
{
public class EasyTeleporter : GameNPC
{

public override bool Interact(GamePlayer player)
{
if (!base.Interact(player)) return false;



player.Client.Out.SendMessage(
"[Setup] [Add More!]",
eChatType.CT_Say, eChatLoc.CL_PopupWindow);
return true;
}

public override bool AddToWorld()
{

base.AddToWorld();
return true;
}


private static void switchrealm(GamePlayer p, int realm)
{
p.Realm = (eRealm)realm;
p.Client.SavePlayer();
}


public override bool WhisperReceive(GameLiving source, string str)
{
if (!base.WhisperReceive(source, str)) return false;

if (!(source is GamePlayer)) return false;

GamePlayer player = (GamePlayer)source;

TurnTo(player.X, player.Y);

switch (str)
{




case "Setup":
{
player.MoveTo(RegionNumber, X, Y, Z, Heading);
break;
}
break;

case "Add More!":
{
player.MoveTo(RegionNumber, X, Y, Z, Heading);
break;
}
break;


}
return true;
}
}
}
shanegru63624
DOL Novice
 
Posts: 70
Joined: Tue Jan 28, 2014 10:31 am

Re: easy teleporter.cs can someone fix it

Postby HunabKu » Fri Oct 17, 2014 8:57 am

Please use
Code: Select all
to format code.
Also please post the script for we can test it directly on our computer.
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: easy teleporter.cs can someone fix it

Postby shanegru63624 » Fri Oct 17, 2014 9:12 am

ok it does tell me to enter the gloc lmao...let me if it will work now.. well it didnt crash this time.. but it still didnt work..
darn i need a simple teleporter script.. that is easy to understand.. if anyone has one .. this one looks easy
the easyteleporter.cs but it dont work with newest cource
shanegru63624
DOL Novice
 
Posts: 70
Joined: Tue Jan 28, 2014 10:31 am

Re: easy teleporter.cs can someone fix it

Postby shanegru63624 » Fri Oct 17, 2014 9:13 am

Code: Select all
// Created by Dread, To use just /mob create DOL.GS.Scripts.EasyTeleporter... // Please Change RegionNumber, X, Y, Z, Heading to acual gloc! // Easy to edit... // Enjoy using System; using DOL; using DOL.GS; using DOL.Events; using DOL.GS.PacketHandler; using System.Collections; using DOL.Database; namespace DOL.GS.Scripts { public class EasyTeleporter : GameNPC { public override bool Interact(GamePlayer player) { if (!base.Interact(player)) return false; player.Client.Out.SendMessage( "[Setup] [Add More!]", eChatType.CT_Say, eChatLoc.CL_PopupWindow); return true; } public override bool AddToWorld() { base.AddToWorld(); return true; } private static void switchrealm(GamePlayer p, int realm) { p.Realm = (eRealm)realm; p.Client.SavePlayer(); } public override bool WhisperReceive(GameLiving source, string str) { if (!base.WhisperReceive(source, str)) return false; if (!(source is GamePlayer)) return false; GamePlayer player = (GamePlayer)source; TurnTo(player.X, player.Y); switch (str) { case "bg30": { player.MoveTo(240, 554371, 583883, 6592, 2039); break; } break; case "bg35!": { player.MoveTo(240, 554371, 583883, 6592, 2039); break; } break; } return true; } } }
shanegru63624
DOL Novice
 
Posts: 70
Joined: Tue Jan 28, 2014 10:31 am

Re: easy teleporter.cs can someone fix it

Postby shanegru63624 » Fri Oct 17, 2014 9:15 am

no errors i seen just dont work lmao ya i changed the regionumber x/y/z/heading to where i wanted togo and just dont work.. it spawns.. shows setup and add more..
shanegru63624
DOL Novice
 
Posts: 70
Joined: Tue Jan 28, 2014 10:31 am

Re: easy teleporter.cs can someone fix it

Postby rdsandersjr » Fri Oct 17, 2014 1:16 pm

Moving to support forum...
Thanks,
RDSandersJR
User avatar
rdsandersjr
Support Team
 
Posts: 1089
Joined: Fri Aug 01, 2008 3:01 pm
Location: Cincinnati, Ohio


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 1 guest