Skip to content

Instantly share code, notes, and snippets.

//BEFORE================================================================================
//-- IN EXTENSIONS.CS:
public static int CurrentLine { get; private set; }
public static bool ContinueConversation { get; set; } = true;
public static bool EndOfConversation { get; private set; }
public static void TalkingFunction(List<Tuple<Ped, List<string>>> convoList, string otherPedName, List<string> firstThingTheySay = null)
{
GameFiber.StartNew(delegate
{
public static void DisplayConversation(string[] lines, string playerName, int playerCol, string pedName, int pedCol)
{
for(int i = 0; i < lines.Lenght; i++)
{
if(i % 2 == 0) DialogueLine(pedCol, pedName, lines[i]);
else DialogueLine(playerCol, playerName, lines[i]);
while(!Game.IsKeyPressed(key)) GameFiber.Yield();
}
}
@LtFlash
LtFlash / XmlModification.cs
Last active April 12, 2017 14:05
for khorio
static void AddOrReplaceObject<T>(string file, T obj, Predicate<T> find)
{
if (File.Exists(file))
{
Serializer.ModifyItemInXML<List<T>>(file, d => AddOrReplace(d, obj, find));
}
else
{
Serializer.SaveToXML(new List<T>{ obj }, file);
}
static bool IsHeadingOppositeInRange(float h1, float h2, float range)
{
float op = NormalizeHeading(h1 + 180f);
float b1 = op + range / 2;
float b2 = op - range / 2;
return Math.Abs(b1 - h2) <= range && Math.Abs(b2 - h2) <= range;
}
static float NormalizeHeading(float angle)