Hello! Please help me find the SAMP API for C# ![]()
Thank.
Hello! Please help me find the SAMP API for C# ![]()
Thank.
It's not work.
API.cs
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;
API.cs
API.cs
namespace SAMP_API
{
public class API
{
API.cs
API.cs
[DllImport("API.dll", EntryPoint = "API_IsChatOpen", CallingConvention = CallingConvention.Cdecl)]
public static extern Boolean IsChatOpen();
API.cs
API.cs
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetForegroundWindow();
API.cs
API.cs
public static string ToHexValueRGB(Color color)
{
return "" + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
}
public static string ToHexValueARGB(Color color)
{
return "" + color.A.ToString("X2") + color.R.ToString("X2") + color.G.ToString("X2") + color.B.ToString("X2");
}
public static Boolean IsGTARunning(String gtaprocname)
{
Process[] list = Process.GetProcessesByName(gtaprocname);
foreach (Process p in list)
{
if (p.MainWindowHandle == GetForegroundWindow())
return true;
}
return false;
}
}
}
Form1.cs
using SAMP_API;
Form1.cs
Form1.cs
namespace UniBinder
{
public partial class Form1 : Form
{
public void event()
{
if ( SAMP_API.API.IsChatOpen() )
MessageBox.Show("Open");
}
}
}
And when event() started - my program has been crashed ![]()
GTA API is crap.
I've found the shadowAPI2 and updated it partly to fulfill my personal needs. The good thing about this API is that it's completly in C#
Try it out.
Some functions do not work, some crashing my application or i noob ![]()
Show us your new code :b
Form1.cs
using shadowAPI2;
Form1.cs
Form1.cs
namespace Project
{
public partial class Form1 : Form
{
public void event()
{
// For example
MessageBox.Show(shadowAPI2.Game.GetFPS().ToString()); // all time return 0
}
}
}
What functions work?
The most important ones. Especially the ones in the Chat, Player and Vehicle class. The RemotePlayer class doesn't work either yet.
Tomorrow I will try to change some functions for the new version.