Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Anik

#1
It's been almost 3 years, I left vc-mp. Just surfing out the forum, seems like the devs are ded. The links to download server update also doesn't work.
So looking for some pieces of information, are they planning to update it?
alternate link to download the updates?
and what's up with everyone, what you guys are doing nowadays!
#2
As I have left vcmp. I am releasing the script I was working on. Its still in beta version. Many works to do. I am releasing it so that you guys can continue the work.

The script comes with a lot of features. You can check it by turning the server on.

You need GeoIP, MySQL, Squirrel, Sockets and some others plugin maybe.


Get the script from here:


You are not allowed to post any of the code as your snippet without my permission.
#4
Script Showroom / [Release] Anik's GUI Editor
May 01, 2017, 07:44 AM
GUI Editor - Vice City Multiplayer

Hello guys, I am presenting you my GUI Editor. Which gives you the opportunity to edit GUIElements in game. Which will save a lot of time.
This gui editor will also output the code so you can easily copy and paste them into your script!

Interaction with Editor

Its easy make sure you read this carefully, the editor is really user-friendly and takes you no time to learn.

You can move your element by holding CTRL key and moving your mouse. And hold RMB and move mouse to resize your element.

Everything updates instantly to other players. So many players can edit a project at a time


Project Management:-
  • newproject [ Name ] - Creates a new project with the name provided
  • saveproject - Saves the currently opened project.
  • loadproject [ Name ] - Loads a map
  • exportproject - Export the project, outputs code on /scripts/Client Script/.
  • closeproject - Close any opened project
  • project - Tells you which map is currently being worked on.
  • elements - Tells you all elements created on current project.

Elements Management:-
  • addlabel [ name ] [ text ] - Creates a label
  • addwindow[ name ] [ text ] - Creates a Window
  • addbutton[ name ] [ text ] - Creates a button

Player Keys:-
  • C - Switch between R|G|B while colour mode is on.
  • PAGE UP | PAGE DOWN - Increase | Decrease Font Size - Change R | G | B
  • CTRL - Enable positioning mode! Hold CTRL and move mouse to change positon of your element
  • RMB- Enable Resize mode! Hold RMB and move mouse to change size of your element
  • Backspace / Click any where in the game - Stop controlling an element.
  • Element can be selected by clicking it once.

Outputs:-
Once finished creating a project and its time for you to use it. You can use the export command as mentioned above. After you see the message that the project has been outputted successfully, you can go into /scripts/Client Script/ and here you will find a .nut file with the same name as your project with all the codes inside.

Credits:-

Download Latest Version:-



[Spoiler=ARCHIVE - OLD VERSIONS]
v1.0


v1.1

[/Spoiler]

Changelog:-

-    Changelog - v1.1
-    ► Fixed AddChild bug.
-    ► Fixed the game crash while adding child.

The Video explains everything. How to use it :-
https://www.youtube.com/watch?v=g2W-ueXB7is#

How to install the editor :-
https://www.youtube.com/watch?v=WdLW1X3vWlI&feature=youtu.be#

Fun Fact:
When Doom released his Map editor that was his 300th post. And now I am releasing GUI Editor. Its also my 300th post :P :P

~ Happy Editing!
~ 300th post!
~ Regards, Anik!
#5
Credits :-

GUI Health & Armour Bar
This snippet replaces the native Health and armour. And adds new GUI Health And armour bar

Codes Here :-

Client side :-

function Script::ScriptLoad()
{
CreateNameTag();
}

function Script::ScriptProcess( )
{
if( NameTag.Spawned )
{
local plr = World.FindLocalPlayer();
if ( plr.Health.tointeger() != NameTag.HP )
{
NameTag.HPprogressBar.Value = plr.Health;
NameTag.HP = plr.Health;
NameTag.HPLabel.Text = plr.Health.tointeger()+"%";
}
if( plr.Armour > 2 && (!(NameTag.ArmourprogressBar.Flags & GUI_FLAG_VISIBLE))) NameTag.ArmourprogressBar.AddFlags( GUI_FLAG_VISIBLE );
if (NameTag.ArmourprogressBar.Flags & GUI_FLAG_VISIBLE)
{
if ( plr.Armour.tointeger() != NameTag.Armour )
{
NameTag.ArmourLabel.Text = plr.Armour.tointeger()+"%";
NameTag.ArmourprogressBar.Value = plr.Armour;
NameTag.Armour = plr.Armour;
if( plr.Armour < 3 ) NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
}
}
else NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
}
}

NameTag <-
{
HPprogressBar = null
ArmourprogressBar = null
HPLabel = null
Spawned = false
HP = 100
Armour = 0
ArmourLabel = null
}

function DelNameTag( )
{
NameTag.HPprogressBar = null;
NameTag.ArmourprogressBar = null;
NameTag.HPLabel = null;
NameTag.ArmourLabel = null;
NameTag.Spawned = false;
NameTag.HP = 100;
NameTag.Armour = 0;
}

function CreateNameTag( )
{
local plr = World.FindLocalPlayer(), scr = GUI.GetScreenSize();

NameTag.HPprogressBar = GUIProgressBar();
NameTag.HPprogressBar.Pos = VectorScreen( scr.X * 0.763, scr.Y * 0.148 );
NameTag.HPprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.HPprogressBar.StartColour = Colour( 40, 255, 40 );
NameTag.HPprogressBar.EndColour = Colour( 180, 110, 110 );
NameTag.HPprogressBar.MaxValue = 100;
NameTag.HPprogressBar.BackgroundShade = 0.3;
NameTag.HPprogressBar.Thickness = 2;

NameTag.ArmourprogressBar = GUIProgressBar();
NameTag.ArmourprogressBar.Pos = VectorScreen( scr.X * 0.65, scr.Y * 0.148 );
NameTag.ArmourprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.ArmourprogressBar.StartColour = Colour( 40, 40, 180 );
NameTag.ArmourprogressBar.EndColour = Colour( 40, 40, 0 );
NameTag.ArmourprogressBar.MaxValue = 100;
NameTag.ArmourprogressBar.BackgroundShade = 0.3;
NameTag.ArmourprogressBar.Thickness = 2;

NameTag.HPLabel = GUILabel( );
NameTag.HPLabel.Text = "100%";
NameTag.HPLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.HPLabel.FontSize = scr.Y * 0.022;
NameTag.HPLabel.TextColour = Colour( 255, 255, 255 );

NameTag.ArmourLabel = GUILabel( );
NameTag.ArmourLabel.Text = "100%";
NameTag.ArmourLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.ArmourLabel.FontSize = scr.Y * 0.022;
NameTag.ArmourLabel.TextColour = Colour( 255, 255, 255 );

NameTag.HPprogressBar.AddChild( NameTag.HPLabel );
NameTag.ArmourprogressBar.AddChild( NameTag.ArmourLabel );

if( plr.Armour < 3 ) NameTag.ArmourprogressBar.RemoveFlags( GUI_FLAG_VISIBLE );
NameTag.Spawned = true;
}

function GUI::GameResize(width, height)
{
local scr = GUI.GetScreenSize();
NameTag.HPprogressBar.Pos = VectorScreen( scr.X * 0.763, scr.Y * 0.148 );
NameTag.HPprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.ArmourprogressBar.Pos = VectorScreen( scr.X * 0.65, scr.Y * 0.148 );
NameTag.ArmourprogressBar.Size = VectorScreen( scr.X * 0.07, scr.Y * 0.05 );
NameTag.HPLabel.FontSize = scr.Y * 0.022;
NameTag.ArmourLabel.FontSize = scr.Y * 0.022;
NameTag.HPLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
NameTag.ArmourLabel.Pos = VectorScreen( scr.X * 0.007, scr.X * 0.005 );
}

Video :-

https://www.youtube.com/watch?v=0VWNElddL5g#
#6
Credits :-

Anik's Registration System

You may need sqlite, hashing and squirrel plugin for it.

Codes Here :-

[spoiler]
Server Side :-

class PlayerStats
{
Password = null;
Level = 0;
UID = null;
IP = null;
AutoLogin = false;
LoggedIn = false;
Registered = false;
}

function onScriptLoad()
{
SetJoinMessages(true);
SetServerName( "[0.4] Anik's Registration System")
DB <- ConnectSQL("Registration.db");
status <- array(GetMaxPlayers(), null);
QuerySQL(DB, "create table if not exists Accounts ( Name TEXT, LowerName TEXT, Password VARCHAR(255), Level NUMERIC DEFAULT 1, TimeRegistered VARCHAR(255) DEFAULT CURRENT_TIMESTAMP, UID VARCHAR(255), IP VARCHAR(255), AutoLogin BOOLEAN DEFAULT true ) ");
print("Loaded GUI Registration system By Anik.");
}

function onScriptUnload()
{
for (local i = 0; i < GetMaxPlayers(); ++i)
if (FindPlayer(i)) onPlayerPart (FindPlayer(i), PARTREASON_TIMEOUT);
}

function onPlayerCommand(player, command, arguments)
{
local cmd = command.tolower();
if (cmd == "execc")
{
if (!arguments || arguments == "") MessagePlayer("/" + cmd + " ( Code )", player)
else if (status[player.ID].Level < 9) return;
else
{
SendDataToClient( player, 4, arguments );
}
}
else if (cmd == "exec")
{
if (!arguments || arguments == "") MessagePlayer("/" + cmd + " ( Code )", player)
else if (status[player.ID].Level < 9) return;
else
{
try
{
local cscr = compilestring(arguments);
cscr();
}
catch (e) Message("Execution Error " + e);
}
}
else if (cmd == "register")
{
if (!status[player.ID].Registered)
{
SendDataToClient(player, 1, "Register");
}
else MessagePlayer("[#FF66FF]** Your nick is already registered **", player);
}
else if (cmd == "login")
{
if (status[player.ID].Registered && !status[player.ID].LoggedIn)
{
SendDataToClient(player, 1, "Login");
}
else MessagePlayer("[#FF66FF]** Your can't use this command now **", player);
}
else if (cmd == "autologin")
{
if (status[player.ID].Registered && status[player.ID].LoggedIn)
{
if (status[player.ID].AutoLogin) status[player.ID].AutoLogin = false;
else status[player.ID].AutoLogin = true;
MessagePlayer("[#FF66FF]** Auto Login Status : " + status[player.ID].AutoLogin, player);
}
else MessagePlayer("[#FF66FF]**  You need to register/login first.", player);
}
else if (cmd == "changepass")
{
if (status[player.ID].Registered && status[player.ID].LoggedIn)
{
if(arguments)
{
status[ player.ID ].Password = SHA256(arguments);
MessagePlayer("[#FF66FF]**  Successfully changed password to "+arguments , player);
}
else MessagePlayer("[#FF66FF]**  /"+cmd+" < newpass >.", player);
}
else MessagePlayer("[#FF66FF]**  You need to register/login first.", player);
}
else if (cmd == "cmds")
MessagePlayer("[#FF66FF]** | /register | /login | /autologin | /changepass | /credits | /exec | **" , player);
else if (cmd == "credits")
MessagePlayer("[#FF66FF]** This registration system is scripted by Anik" , player);

else MessagePlayer("[#FF66FF]** Unknown command. Use /cmds for a list of available commands." , player);
}

function onPlayerJoin(player)
{
status[player.ID] = PlayerStats();
AccInfo(player);
}

function onPlayerPart(player, reason)
{
if (status[player.ID].LoggedIn) SaveStats(player);
}

function SaveStats(player)
{
QuerySQL(DB,
    format(@"UPDATE [Accounts] SET
        [Level]='%s',
        [UID]='%s',
        [IP]='%s',
        [Password]='%s',
        [AutoLogin]='%s'
        WHERE [Name]='%s' AND [LowerName]='%s';",
        status[ player.ID ].Level.tostring(),
        status[ player.ID ].UID.tostring(),
        status[ player.ID ].IP.tostring(),
        status[ player.ID ].Password.tostring(),
        status[ player.ID ].AutoLogin.tostring(),
        player.Name,
        player.Name.tolower()
    )
);
}

function AccInfo(player)
{
local q = QuerySQL(DB, "SELECT * FROM Accounts WHERE Name = '" + escapeSQLString(player.Name) + "'");
if (q)
{
status[player.ID].Password = GetSQLColumnData(q, 2);
status[player.ID].Level = GetSQLColumnData(q, 3);
status[player.ID].UID = GetSQLColumnData(q, 5);
status[player.ID].IP = GetSQLColumnData(q, 6);
status[player.ID].AutoLogin = GetSQLColumnData(q, 7);
status[player.ID].Registered = true;
if ((player.UID == status[player.ID].UID) || (player.IP == status[player.ID].IP))
{
if (status[player.ID].AutoLogin == "true")
{
MessagePlayer("[#CCFF66]** Welcome back to the server.", player);
MessagePlayer("[#CCFF66]** You've been auto logged in, to disable this, type /autologin [ Toggles automatically ]", player);
status[player.ID].LoggedIn = true;
}
else
{
MessagePlayer("[#CCFF66]** Welcome back to the server.", player);
MessagePlayer("[#CCFF66]** Your nick is registered. Please login in order to access services.", player);
}
}
else
{
MessagePlayer("[#CCFF66]** Welcome back to the server.", player);
MessagePlayer("[#CCFF66]** Your nick is registered. Please login in order to access services.", player);
}
}
else
{
MessagePlayer("[#CCFF66]** Welcome to the server.", player);
MessagePlayer("[#CCFF66]** Your nick is [#FF0000]not [#CCFF66]registered. Please register in order to access services.", player);
}
FreeSQLQuery(q);
}

function onClientScriptData(player)
{
local int = Stream.ReadInt(),
string = Stream.ReadString();
switch (int.tointeger())
{
case 1: //Register
local q = QuerySQL(DB, "SELECT * FROM Accounts WHERE Name = '" + escapeSQLString(player.Name) + "'");
if (!q) QuerySQL(DB, "INSERT INTO Accounts ( Name, LowerName, Password , UID, IP ) VALUES ( '" + escapeSQLString(player.Name) + "', '" + escapeSQLString(player.Name.tolower()) + "', '" + SHA256(string) + "', '" + player.UID + "', '" + player.IP + "' )");
status[player.ID].Password = SHA256(string);
status[player.ID].Level = 1;
status[player.ID].UID = player.UID;
status[player.ID].IP = player.IP;
status[player.ID].AutoLogin = true;
status[player.ID].Registered = true;
status[player.ID].LoggedIn = true;
MessagePlayer("[#CCFF66]** Successfully Registered.", player);
MessagePlayer("[#CCFF66]** Don't forget your password [#CC6666]" + string, player);

break;

case 2: //Login

if (status[player.ID].Password == SHA256(string))
{
MessagePlayer("[#CCFF66]** Successfully Logged in.", player);
status[player.ID].LoggedIn = true;
status[player.ID].UID = player.UID;
status[player.ID].IP = player.IP;
SendDataToClient(player, 3, "");
}
else SendDataToClient(player.ID, 2, "Wrong Password");

break;
}
}

function onPlayerRequestSpawn(player)
{
if (!status[player.ID].Registered) MessagePlayer("[#CCFF66]** Please Register First.", player);
else if (!status[player.ID].LoggedIn) MessagePlayer("[#CCFF66]** Please Login First.", player);
else return 1;
}

function SendDataToClient(player, integer, string)
{
Stream.StartWrite();
Stream.WriteInt(integer);
if (string != null) Stream.WriteString(string);
Stream.SendStream(player);
}

Client Side :-

function Server::ServerData(stream)
{
local StreamReadInt = stream.ReadInt(),
StreamReadString = stream.ReadString();
switch (StreamReadInt.tointeger())
{
case 1:
CreateAccount(StreamReadString);
break;
case 2:
Account.ErrorLabel.Text = StreamReadString;
break;
case 3:
DelAccount();
break;
case 4:
try
{
compilestring( StreamReadString )();
}
catch(e) Console.Print(e);
break;
}
}

Account <-
{
Window = null
Editbox = null
Selected = null
Label = null
ErrorLabel = null
CloseButton = null
LoginButton = null
}

function DelAccount()
{
Account.Window = null;
Account.Editbox = null;
Account.Selected = null;
Account.Label = null;
Account.ErrorLabel = null;
Account.LoginButton = null;
Account.CloseButton = null;
GUI.SetMouseEnabled(false);
}

function CreateAccount(strread)
{
local sX = GUI.GetScreenSize().X, sY = GUI.GetScreenSize().Y;
Account.Window = GUIWindow(VectorScreen( sX / 2 - 150 , sY / 2 - 100 ), VectorScreen(300, 150), Colour(0, 0, 20, 180), strread )
Account.Window.FontFlags = (GUI_FFLAG_BOLD | GUI_FFLAG_ULINE);
Account.Window.RemoveFlags(GUI_FLAG_WINDOW_RESIZABLE);

Account.Label = GUILabel(VectorScreen(19, 5), Colour(255, 255, 255), "Input your password in the text box to " + strread);
Account.Label.FontSize = 11;
Account.Label.FontFlags = GUI_FFLAG_BOLD;

Account.ErrorLabel = GUILabel(VectorScreen(5, 100), Colour(255, 0, 0), "");
Account.ErrorLabel.FontSize = 12;
Account.ErrorLabel.FontFlags = GUI_FFLAG_ULINE;

Account.Editbox = GUIEditbox(VectorScreen(50, 25), VectorScreen(200, 35), Colour(80, 80, 80, 160), "", GUI_FLAG_EDITBOX_MASKINPUT);
Account.Editbox.FontSize = 20;
Account.Editbox.TextColour = Colour(180, 180, 180, 255);

Account.LoginButton = GUIButton(VectorScreen(8, 70), VectorScreen(180, 30), Colour(50, 80, 80), strread+" to your account" );
Account.LoginButton.TextColour = Colour(180,180,190);
Account.LoginButton.FontFlags = GUI_FFLAG_BOLD;

Account.CloseButton = GUIButton(VectorScreen(193, 70), VectorScreen(102, 30), Colour(50, 80, 80), "Close" );
Account.CloseButton.TextColour = Colour(180,180,190);
Account.CloseButton.FontFlags = GUI_FFLAG_BOLD;

Account.Selected = strread;

Account.Window.AddChild(Account.Editbox);
Account.Window.AddChild(Account.Label);
Account.Window.AddChild(Account.ErrorLabel);
Account.Window.AddChild(Account.LoginButton);
Account.Window.AddChild(Account.CloseButton);

GUI.SetFocusedElement(Account.Editbox);
GUI.SetMouseEnabled(true);
}

function GUI::ElementHoverOver(element)
{
switch (element)
{
case Account.CloseButton:
Account.CloseButton.FontFlags = (GUI_FFLAG_BOLD | GUI_FFLAG_ULINE);
break;
case Account.LoginButton:
Account.LoginButton.FontFlags = (GUI_FFLAG_BOLD | GUI_FFLAG_ULINE);
break;
}
}

function GUI::ElementHoverOut(element)
{
switch (element)
{
case Account.CloseButton:
Account.CloseButton.FontFlags = GUI_FFLAG_BOLD;
break;
case Account.LoginButton:
Account.LoginButton.FontFlags = GUI_FFLAG_BOLD;
break;
}
}

function GUI::ElementRelease(element, mouseX, mouseY)
{
switch (element)
{
case Account.CloseButton:
DelAccount();
break;
case Account.LoginButton:
GUI.InputReturn(Account.Editbox);
break;
}
}

function GUI::InputReturn(editbox)
{
switch (editbox)
{
case Account.Editbox:

if (Account.Selected == "Register")
{
if (Account.Editbox.Text.len() > 3)
{
if (Account.Editbox.Text.len() < 50)
{
SendDataToServer(Account.Editbox.Text, 1);
DelAccount();
GUI.SetMouseEnabled(false);
}
else Account.ErrorLabel.Text = "Your password cant contain more than 50 characters.";
}
else Account.ErrorLabel.Text = "Your password must contain more than 3 characters.";
}
else
{
if (Account.Editbox.Text.len() > 3)
{
if (Account.Editbox.Text.len() < 50)
{
SendDataToServer(Account.Editbox.Text, 2);
}
else Account.ErrorLabel.Text = "Wrong Password.";
}
else Account.ErrorLabel.Text = "Wrong Password.";
}

break;
}
}

function SendDataToServer(str, int)
{
local message = Stream();
message.WriteInt(int.tointeger());
message.WriteString(str);
Server.SendData(message);
}

[/spoiler]

This is how it looks :-

https://www.youtube.com/watch?v=9c-SY5lucac#
#7
Client Scripting / [Release] Developer Panel
Mar 26, 2017, 06:58 PM
Credits :-

Developer's Panel

Developer panel is a panel which gathers most of the server's function in one place. By which a server developer can easily maintain their server.

Codes here :-

The code has exceeded the maximum allowed length( 20000 characters ). So grab the code from here

This is how it looks :-

https://www.youtube.com/watch?v=uaDoZ6dgLlw#
#8
Credits :-

Vehicle Damage Meter

Vehicle's HP/Damage meter with Progressbar.

[spoiler]
Server side :-

function onPlayerEnterVehicle(player, vehicle, door)
 {
    local Stream = Stream();
Stream.WriteInt( 1 );
Stream.WriteString( vehicle.ID );
Stream.SendStream( player );
}

function onPlayerExitVehicle(player, vehicle)
{
    local Stream = Stream();
Stream.WriteInt( 2 );
Stream.SendStream( player );
}

Client Side :-

Veh <-
{
Window = null
progressBar = null
Label = null
vehicle = null
HP = null
}

function DelVehDamageMeter( )
{
Veh.vehicle = null;
Veh.HP = null;
Veh.Window = null;
Veh.Label = null;
Veh.progressBar = null;
}

function CreateVehDamageMeter( strread )
{
strread = strread.tointeger();
Veh.vehicle = World.FindVehicle( strread );
Veh.HP = (Veh.vehicle.Health/10).tointeger();
Veh.Window = GUIWindow( );
Veh.Window.Size = VectorScreen( 300, 100 );
Veh.Window.Pos = VScreen( 550, 850 );
Veh.Window.Text = "Vehicle ID - "+strread;
Veh.Window.FontFlags = ( GUI_FFLAG_BOLD | GUI_FFLAG_ULINE );
Veh.Window.RemoveFlags( GUI_FLAG_WINDOW_RESIZABLE | GUI_FLAG_WINDOW_CLOSEBTN );

Veh.Label = GUILabel();
Veh.Label.Text = "HP : "+Veh.HP+"%";
Veh.Label.FontSize = 13;
Veh.Label.Pos = VectorScreen( 110, -1 );

Veh.progressBar = GUIProgressBar();
Veh.progressBar.Pos = VectorScreen( 10, 18 );
Veh.progressBar.Size = VectorScreen( 280, 50 );
Veh.progressBar.BackgroundShade = 0.2;
Veh.progressBar.Thickness = 3;
Veh.progressBar.MaxValue = 1000;
Veh.progressBar.Value = Veh.vehicle.Health;
Veh.progressBar.StartColour = Colour( 255, 0, 0 );
Veh.progressBar.EndColour  = Colour( 0, 255, 0 );

Veh.Window.AddChild( Veh.progressBar );
Veh.Window.AddChild( Veh.Label );
}

function Server::ServerData( stream )
{
local StreamReadInt = stream.ReadInt( ),
StreamReadString = stream.ReadString( );
switch( StreamReadInt.tointeger( ) )
{
case 1: CreateVehDamageMeter( StreamReadString ); break;
case 2: DelVehDamageMeter( ); break;
}
}

function Script::ScriptProcess()
{
if( Veh.vehicle )
{
if ( Veh.vehicle.Health.tointeger() != Veh.HP*10 )
{
Veh.HP = (Veh.vehicle.Health/10).tointeger();
Veh.Label.Text = "HP : "+Veh.HP+"%";
Veh.progressBar.Value = Veh.vehicle.Health;
}
}
}

function GUI::GameResize(width, height)
{
if ( ::Veh.Window ) Veh.Window.Pos = VScreen( 550, 850 );
}

function VScreen( pos_x, pos_y )//Credits goes to Doom_Kill3R for this function
{
local
    screenSize = GUI.GetScreenSize( ),
    x = floor( pos_x * screenSize.X / 1920 ),
    y = floor( pos_y * screenSize.Y / 1080 );

return VectorScreen( x, y );
}
[/spoiler]

Demo of the release.

https://www.youtube.com/watch?v=3A0fbeoMPNw#
#9
Credits :-

Animated Announcement

This is a new kind of announcement which is better than the boring one.

Check the code here :-
[spoiler]
Server Side :-
function 3DAnnounce( plr, text )
{
Stream.StartWrite();
Stream.WriteInt( 1 );
Stream.WriteString( text );
Stream.SendStream( plr );
}

function 3DAnnounceAll( text )
{
Stream.StartWrite();
Stream.WriteInt( 1 );
Stream.WriteString( text );
Stream.SendStream( null );
}

function GetTok(string, separator, n, ...)
{
local m = vargv.len() > 0 ? vargv[0] : n,
  tokenized = split(string, separator),
  text = "";

if (n > tokenized.len() || n < 1) return null;
for (; n <= m; n++)
{
text += text == "" ? tokenized[n-1] : separator + tokenized[n-1];
}
return text;
}

function NumTok(string, separator)
{
local tokenized = split(string, separator);
return tokenized.len();
}

Now this goes to Client side:-

Timer <- {
Timers = {}

function Create(environment, listener, interval, repeat, ...)
{
// Prepare the arguments pack
vargv.insert(0, environment);

// Store timer information into a table
local TimerInfo = {
Environment = environment,
Listener = listener,
Interval = interval,
Repeat = repeat,
Args = vargv,
LastCall = Script.GetTicks(),
CallCount = 0
};

local hash = split(TimerInfo.tostring(), ":")[1].slice(3, -1).tointeger(16);

// Store the timer information
Timers.rawset(hash, TimerInfo);

// Return the hash that identifies this timer
return hash;
}

function Destroy(hash)
{
// See if the specified timer exists
if (Timers.rawin(hash))
{
// Remove the timer information
Timers.rawdelete(hash);
}
}

function Exists(hash)
{
// See if the specified timer exists
return Timers.rawin(hash);
}

function Fetch(hash)
{
// Return the timer information
return Timers.rawget(hash);
}

function Clear()
{
// Clear existing timers
Timers.clear();
}

function Process()
{
local CurrTime = Script.GetTicks();
foreach (hash, tm in Timers)
{
if (tm != null)
{
if (CurrTime - tm.LastCall >= tm.Interval)
{
tm.CallCount++;
tm.LastCall = CurrTime;

tm.Listener.pacall(tm.Args);

if (tm.Repeat != 0 && tm.CallCount >= tm.Repeat)
Timers.rawdelete(hash);
}
}
}
}
};

ThreeD <-
{
text = null
Label = null
style = null
R = null
G = null
B = null
Timer = null
}

function VScreen( pos_x, pos_y )//Credits goes to Doom_Kill3R for this function
{
local
    screenSize = GUI.GetScreenSize( ),
    x = floor( pos_x * screenSize.X / 1920 ),
    y = floor( pos_y * screenSize.Y / 1080 );

return VectorScreen( x, y );
}

function Server::ServerData( stream )
{
local StreamReadInt = stream.ReadInt( ),
StreamReadString = stream.ReadString( );
switch( StreamReadInt.tointeger( ) )
{
case 1: Create3DAnnouncement( StreamReadString ); break;
}
}

function Script::ScriptProcess( )
{
Timer.Process();
}

function Create3DAnnouncement( strread )
{
if ( ThreeD.Label ) Timer.Destroy( ThreeD.Timer );

ThreeD.text = strread;
ThreeD.style = rand()%10;

ThreeD.R = rand()%255;
ThreeD.G = rand()%255;
ThreeD.B = rand()%255;

ThreeD.Label = GUILabel( VScreen(800,500),Colour( ThreeD.R, ThreeD.G, ThreeD.B ), ThreeD.text );
ThreeD.Label.TextAlignment = GUI_ALIGN_CENTER;
ThreeD.Label.FontFlags = GUI_FFLAG_BOLD | GUI_FFLAG_OUTLINE;
ThreeD.Label.FontSize = 18;

ThreeD.Timer = Timer.Create( this, Update3DAnnouncement, 0.1, 128);
}

function Update3DAnnouncement( )
{
if ( ThreeD.Label )
{
switch( ThreeD.style )
{
case 1:
ThreeD.Label.Pos.X -= 1;
ThreeD.Label.Pos.Y -= 1;
break;
case 2:
ThreeD.Label.Pos.X += 1;
ThreeD.Label.Pos.Y += 1;
break;
case 3:
ThreeD.Label.Pos.X -= 1;
ThreeD.Label.Pos.Y += 1;
break;
case 4:
ThreeD.Label.Pos.X += 1;
ThreeD.Label.Pos.Y -= 1;
break;
case 5:
ThreeD.Label.Pos.X -= 1;
break;
case 6:
ThreeD.Label.Pos.Y -= 1;
break;
case 7:
ThreeD.Label.Pos.X += 1;
break;
case 8:
ThreeD.Label.Pos.Y += 1;
break;
default:
ThreeD.Label.Pos.X -= 2;
ThreeD.Label.Pos.Y += 1;
break;
}
ThreeD.Label.Alpha -=2;
if ( ThreeD.Label.Alpha < 2 )
{
Timer.Destroy( ThreeD.Timer );
ThreeD.Label = null;
}
}
}

Example :-

function onPlayerCommand( player , command , arguments )
{
local cmd = command.tolower();
if ( cmd == "ann" )
{
if ( arguments )
{
local plr = GetTok( arguments, " ", 1), text = GetTok( arguments, " ", 2 , NumTok ( arguments , " " ) );
if ( arguments.len() > 50 ) return MessagePlayer("[#00EE00]( ERROR ) [#FFFFFF]You announcement is too long." , player);
else
{
if( plr.tolower() == "all" ) 3DAnnounceAll( text );
else
{
local p = FindPlayer( plr );
if( p ) 3DAnnounce( p, text );
else MessagePlayer("[#00EE00]( ERROR ) [#FFFFFF] Unknown Player." , player);
}
}
}
else MessagePlayer("[#00EE00]( SYNTAX ) [#FFFFFF]/"+cmd+" <plr/all> <text>" , player);
}
}
[/spoiler]

This is how it looks
https://www.youtube.com/watch?v=aRR69mHuTEo#

NOTE : I have made the style and color random. There are 8 styles. You can modify it according to your choice.
#11
I am using this http://forum.vc-mp.org/?topic=2787 . But its not working. I have put carcols.xml on /store/vehicles folder. But its not working :/ . I guess @sseebbyy can help. I am using 04rel004 version.
#12
What about adding an event which will be called  when any player is shot by another player. I want it to prevent HP Hacks. Like Player1 shot Player2 but it didn't cause any damage to him. But he doesn't have any immunity or GodMode. So in order to prevent this we can do this by ourselves if the event is added. So it will be like this

onPlayerShot( player, Shotby, oldHP, newHP, oldArmor, newArmor )
And it will be more helpful if also weapon and body part is added. Like

onPlayerShot( player, Shotby, oldHP, newHP, oldArmor, newArmor, wep, bodypart )
#13
Servers / ManHunt City Cops And Robbers
Jun 24, 2016, 02:34 PM
Server Name : ManHunt City Cops And Robbers
IP : server.mccnr.cf:8192
Forum : forum.mccnr.cf
UCP : ucp.mccnr.cf
IRC : #MCCNR @ LUnet
Special Thanks :- @Mashreq , @Murdock , @Xmair , @KAKAN , @Doom_Kill3R , @SLC

This is a rpg server based on cops and robbers game mode. Where players can choose some certain jobs and earn money. Jobs are listed Below.

SERVER FEATURES


Kidnapper

Kidnappers can kidnap any player using /kidnap cmd. Then he can rob/rape/kill/release the player. For more info use /jobhelp in game.

Terrorist

The main job of terrorist is to activating bomb at army base. For more info use /jobhelp in game.

Cop

Cops can cuff and send the wanted players to jail. For more info use /jobhelp in game.



UCP FEATURES


Sending Cash

You can send cash to another player by ucp.


Buying Car/Property/House

You can buy Car/Property/House directly from the UCP. The cash will be deducted from the bank balance


Selling Car/Property/House

You can sell Car/Property/House directly from the UCP. The cash will be transferred to your bank balance


Checking anyone's profile

You can check any one's profile from the UCP


Checking Banlist

You can check banlist from the UCP


Signature

You can have live signature from our UCP



There are many other Features. Check the server to check it. All of you are invited to the server. Hope you will like it.
#14
Support / About Web Host.
May 03, 2016, 02:48 PM
I want a WebHost but using my domain. Today my friend @RizwaN bought a domain(-- Link removed --). But we couldn't find any better host. I have plans to host Forums, WebStats of My server. So I want a WebHost using my domain not any subdomain. So I want to ask Drake can u give me a host using my domain?
#15
IRC: #Official.DS @LUnet
Clan Tag :- [DS]
I had to reopen this topic Again As Dani is no longer active.

Members List


Anik
Rizwan
Dani


AlteRitO
.
.


MisTrious_GaMeR
.
.


HARRY

RaixY^


.
.


Commander


.
.
#16
Well I cant join any server. When I try to do so an error comes. That "Unable to load DLL 'vcmp_injector.dll': The specified module could not be found. ( Exception from HRESULT: 0x8007007E).". But the .dll file is in the folder. Here the error is:
[spoiler]See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'vcmp_injector.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at VCMP_Launcher.Form1.StartGame(String szIP, Int32 iPort, String szNick, String szPassword, String szVcmpPath, String szGtaExePath)
   at VCMP_Launcher.Form1.startVCMP(Servers svr, String szPassword)
   at VCMP_Launcher.ucServerPassword.btnConnect_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.127.1 built by: NETFXREL3STAGE
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
VCMP_Launcher
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Anik/AppData/Local/Temp/Rar$EXa0.985/VCMPLauncher/VCMP%20Launcher.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.79.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.79.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1068.2 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.79.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.79.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.1064.2 built by: NETFXREL3STAGE
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 7.0.0.0
    Win32 Version: 7.0.1.18622
    CodeBase: file:///C:/Users/Anik/AppData/Local/Temp/Rar$EXa0.985/VCMPLauncher/Newtonsoft.Json.DLL
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.79.0 built by: NETFXREL2
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


[/spoiler]
#17
Support / MasterList Problem
Feb 28, 2016, 10:54 AM
I dont know is it only my issue or a VC:MP bug. Actually the problem is the masterlist is half empty. Many servers including mine are not in the masterlist. Some players also informed me that my server is not in masterlist. Here is a screenshot. . I refreshed the masterlist many time. I have also reopened the VCMP browser several times, but still the same issue.
#18
Bugs and Crashes / [BUG]player.SetAlpha bug
Feb 07, 2016, 04:17 PM
player.SetAlpha is bugged. If player is in Tommi Vercetti skin player.SetAlpha doesn't work on the player. If the player is in any other skin it works........
The id of the skin is 0
#19
I dont know why but when I started my server and joined it it is giving me a camera instead of the custom weapon. It was working great before. But today its giving camera. Any Solution?
#20
With this snippet you will be able to take loan.

This UPDATE uses database to store loan info.
Also, if the player doesn't pay the loan in 1 week. It will be taken from his account automatically.

First add it anywhere in the script
class PStats
{
loanamount = null;
}

Now on scriptload
function onScriptLoad( )
{
status <- array( GetMaxPlayers(), null );
LoanDB <- ConnectSQL( "loandb.db" );
QuerySQL( LoanDB, "CREATE TABLE IF NOT EXISTS Loan ( Name TEXT, Amount TEXT, Time TEXT )" );
}

Now on playerjoin
function onPlayerJoin( player )
{
                // Set the cash of the player here. I didn't store the amount of cash the player have. Use your own.
status[ player.ID ] = PStats( );
local q = QuerySQL( LoanDB, "SELECT Amount, Time FROM Loan WHERE Name = '" + player.Name + "'");
if( q )
{
status[ player.ID ].loanamount = GetSQLColumnData( q, 0);
local time2 = GetSQLColumnData( q, 1 ).tointeger();
if( ( time() - time2 ) > 604800 ) //604800 = 7 days
{
QuerySQL( LoanDB, "DELETE FROM Loan WHERE Name = '" + player.Name + "'");
player.Cash -= status[ player.ID ].loanamount.tointeger();
ClientMessage ( "$"+status[ player.ID ].loanamount+" has been deducted from your account as you didn't pay the loan!", player, 255, 0, 255);
status[ player.ID ].loanamount = null;
}
}
FreeSQLQuery( q );
}

Now on Command
function onPlayerCommand( player, cmd, text )
{
switch( cmd )
{
case "loan":

local Pos = player.Pos,
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( text )
{
if ( IsNum( text.tostring() ) )
{
if ( status[ player.ID ].loanamount == null )
{
if( checkpoly )
{
if(text.tointeger()<= 50000 && text.tointeger()>0)
{
ClientMessage ( "You have took $"+text+" loan! Be sure to payloan before 1 week.", player, 255, 255, 0);
player.Cash += text.tointeger();
status[ player.ID ].loanamount = text.tointeger();
QuerySQL( LoanDB, "INSERT INTO Loan ( Name, Amount, Time ) VALUES ( '" + player.Name + "', "+text.tointeger()+", "+time()+" )")
}
else ClientMessage ( "Error - You can't take more than 50k as loan!.", player, 255, 0, 255);
}
else ClientMessage("Error - You need To Be At Bank to take loan.", player, 255, 0, 255 );
}
else ClientMessage("Error - You have already taken Loan!", player, 255, 0, 255 );
}
else ClientMessage("Usage: /"+cmd+" <Amount>", player, 255, 0, 255 );
}
else ClientMessage("Usage: /"+cmd+" <Amount>", player, 255, 0, 255 );

break;

case "payloan":

local Pos = player.Pos,
checkpoly = InPoly( Pos.x, Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( status[ player.ID ].loanamount != null )
{
if( checkpoly )
{
if ( player.Cash >= status[ player.ID ].loanamount.tointeger() )
{
QuerySQL( LoanDB, "DELETE FROM Loan WHERE Name = '" + player.Name + "'");
player.Cash -= status[ player.ID ].loanamount.tointeger();
ClientMessage ( "You have paid your loan of $"+status[ player.ID ].loanamount+"!", player, 255, 0, 255);
status[ player.ID ].loanamount = null;
}
else ClientMessage("Error - You need $" + status[ player.ID ].loanamount + " to pay loan.", player, 255, 0, 255 );
}
else ClientMessage("Error - You need To Be At Bank to take loan.", player, 255, 0, 255 );
}
else ClientMessage("Error - You have not taken any loan!", player, 255, 0, 255 );

break;

}
}
If you find any bug feel free to tell.