Ragemp-roleplay-skript/Realnames.cs
2019-04-16 13:59:07 +02:00

55 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GrandTheftMultiplayer.Server.API;
using GrandTheftMultiplayer.Server.Elements;
using GrandTheftMultiplayer.Server.Managers;
namespace Roleplay
{
class Realnames : Script
{
public Realnames()
{
}
public static String getNameFromID(int id)
{
string name = "";
foreach(Client all in API.shared.getAllPlayers())
{
if(API.shared.getEntityData(all,"ID") == id)
{
name = all.name;
}
}
return name;
}
public static Client getClientFromID(int id)
{
string name = "";
foreach (Client all in API.shared.getAllPlayers())
{
if (API.shared.getEntityData(all, "ID") == id)
{
name = all.name;
}
}
return API.shared.getPlayerFromName(name);
}
public static int getPlayerID(Client player)
{
return Convert.ToInt32(API.shared.getEntityData(player, "ID"));
}
}
}