Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using GTANetworkAPI;
- using System.IO;
- namespace vbzone.Utility
- {
- public class CheckClientSide : Script
- {
- string error_message_ro = "RO: Nu aveti fisierul 'enable-clientside-cs.txt', iar conexiunea a fost revocata!|Intrati in fisierul unde aveti instalat RAGEMP-ul si adaugati ca fisier .txt `enable-clientside-cs`!";
- string error_message_en = "EN: You don't have the file 'enable-clientside-cs.txt', and the connection has been revoked! | Enter in the root folder of RAGEMP and add as .txt `enable-clientside-cs`!";
- bool activ = false;
- [ServerEvent(Event.PlayerConnected)]
- public void CheckClientSide_OnPlayerConnected(Player player)
- {
- if (HavePlayerClientSideEnabled(player) == false && activ == true)
- {
- string[] msg;
- msg = error_message_ro.Split('|');
- foreach (string txt in msg) Globals.Functions.SendClientMessage(player, Globals.Variables.COLOR_RED, txt);
- msg = error_message_en.Split('|');
- foreach (string txt in msg) Globals.Functions.SendClientMessage(player, Globals.Variables.COLOR_RED, txt);
- player.Kick();
- }
- }
- public bool HavePlayerClientSideEnabled(Player player)
- {
- string path = @"c:\RAGEMP\enable-clientside-cs.txt";
- if (File.Exists(path)) { }
- else
- {
- path = @"d:\RAGEMP\enable-clientside-cs.txt";
- if (File.Exists(path)) { }
- else
- {
- path = @"e:\RAGEMP\enable-clientside-cs.txt";
- if (File.Exists(path)) { }
- else return false;
- }
- }
- return true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement