111 lines
3.8 KiB
C#
111 lines
3.8 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.Shared.Math;
|
|
using GrandTheftMultiplayer.Server.Constant;
|
|
using GrandTheftMultiplayer.Server.Managers;
|
|
|
|
namespace Roleplay
|
|
{
|
|
class ClientAPI : Script
|
|
{
|
|
|
|
// Git test
|
|
|
|
public static void playScreenEffect(Client player, string effectName, int duration, bool looped)
|
|
{
|
|
if(player != null && effectName != "" && duration != 0)
|
|
{
|
|
API.shared.triggerClientEvent(player, "ClientAPI-PlayScreenEffect", effectName, duration, looped);
|
|
}
|
|
|
|
}
|
|
|
|
public static void loadingScreen(Client player, int seconds)
|
|
{
|
|
API.shared.triggerClientEvent(player,"loadingscreen",seconds);
|
|
}
|
|
|
|
public static void playMP3(Client player, string path, bool looped)
|
|
{
|
|
if(player != null && path != "")
|
|
{
|
|
API.shared.triggerClientEvent(player,"playMP3onPath",path,looped);
|
|
API.shared.setEntityData(player,"mp3playing",true);
|
|
}
|
|
}
|
|
|
|
public static void stopMp3(Client player)
|
|
{
|
|
if(API.shared.hasEntityData(player,"mp3playing") == true){
|
|
API.shared.triggerClientEvent(player,"stopMP3");
|
|
API.shared.resetEntityData(player,"mp3playing");
|
|
}
|
|
}
|
|
|
|
public static void playSound(Client player, String sound, String sound2)
|
|
{
|
|
//API.shared.triggerClientEvent(player,"callSoundNative",sound,sound2); // ADD TO NEXT UPDATE!!!
|
|
}
|
|
|
|
public static void ShowColorShard(Client player, string title, string description, int bgColor, int titleColor, int timout)
|
|
{
|
|
API.shared.triggerClientEvent(player, "ShowColorShard",title,description,bgColor,titleColor,timout);
|
|
}
|
|
|
|
public static void createClientMarker(Client player, int markertype,Vector3 position, int size, int r, int g, int b, int a)
|
|
{
|
|
API.shared.triggerClientEvent(player,"ClientAPICreateMarker",markertype,position.X,position.Y,position.Z,size,r,g,b,a);
|
|
}
|
|
|
|
public static void deleteClientMarker(Client player)
|
|
{
|
|
API.shared.triggerClientEvent(player,"ClientAPIDeleteMarker");
|
|
}
|
|
|
|
public static void disableControls(Client player, bool state){
|
|
if(state == false){
|
|
API.shared.triggerClientEvent(player,"fesseln");
|
|
} else if(state == true){
|
|
API.shared.triggerClientEvent(player,"unfesseln");
|
|
}
|
|
}
|
|
|
|
public static void setWayPoint(Client player, Vector3 vec)
|
|
{
|
|
API.shared.triggerClientEvent(player,"createWayPoint",vec.X,vec.Y);
|
|
}
|
|
|
|
|
|
|
|
public static void createClientBlipTime(Client player, Vector3 vec, int sprite, int color, int time)
|
|
{
|
|
API.shared.triggerClientEvent(player,"createClientSideBlipTime", vec.X,vec.Y,vec.Z,sprite,color,time);
|
|
}
|
|
public static void createClientBlip(Client player, Vector3 vec, int sprite, int color)
|
|
{
|
|
API.shared.triggerClientEvent(player,"createClientBlip",vec.X,vec.Y,vec.Z,sprite,color);
|
|
}
|
|
|
|
public static void deleteClientBlip(Client player)
|
|
{
|
|
API.shared.triggerClientEvent(player,"deleteClientBlip");
|
|
}
|
|
|
|
public static void displaySubtitle(Client player, string text, double duration)
|
|
{
|
|
API.shared.triggerClientEvent(player,"display_subtitle", text,duration);
|
|
}
|
|
|
|
public static void setClientBlipRouteEnabled(Client player, bool state)
|
|
{
|
|
API.shared.triggerClientEvent(player,"displayroute", state);
|
|
}
|
|
|
|
|
|
}
|
|
}
|