
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.

1
Tutorials / Setting Radio Station For VCMP Using PHP ( v-0.2 )
« on August 20th, 2018, 07:30 PM »
Since the topic has been started by some users so there it is a small guide which I think is a solution.
Snippet is taken from
https://stackoverflow.com/questions/14952157/streaming-mp3-file-through-php/24227722#24227722
What is happening inside php file? :edit:
The links to audio files are stored inside an array( songs ) by user manually and than each audio file in that variable is streamed, an infinite loop has been started in it so that the streaming never ends it repeats every time it reaches to the end of final song in the list.
Steps To Set It Up :edit:
>> Copy the snippet (Recommended Snippet v-0.2) from bellow link in a php file lets suppose the file is named as audio_stream.php
>> Don't forget to edit this array in it
Code: [Select] In my case it is
Code: [Select]
>> Time to upload this audio_stream.php file to any host in which php is available after uploading the streaming link will be as follow
Code: [Select] In my case it is
Code: [Select]
>>Time to use the link of php file in vcmp
Code: [Select]
Snippets(Recommended Snippet v-0.2) :edit:
Code: [Select]
Live Version
Code: [Select]
Note
Better to upload the audio files to the same host where streaming file is upload rather using random links of audio files from other mp3 sites.
Snippet is taken from
https://stackoverflow.com/questions/14952157/streaming-mp3-file-through-php/24227722#24227722
What is happening inside php file? :edit:
The links to audio files are stored inside an array( songs ) by user manually and than each audio file in that variable is streamed, an infinite loop has been started in it so that the streaming never ends it repeats every time it reaches to the end of final song in the list.
Steps To Set It Up :edit:
>> Copy the snippet (Recommended Snippet v-0.2) from bellow link in a php file lets suppose the file is named as audio_stream.php
>> Don't forget to edit this array in it
$songs = [
'song1 complete link along with http/https',
'song2 complete link along with http/https',
'song3 complete link along with http/https'
];
$songs = [
'http://asian-city.tk/songs/Waqqaberry.mp3',
'http://asian-city.tk/songs/Fly_Project__Get_Wet.mp3'
];
>> Time to upload this audio_stream.php file to any host in which php is available after uploading the streaming link will be as follow
http://my_domain.com/audio_stream.php
http://asian-city.tk/audio_stream.php
>>Time to use the link of php file in vcmp
CreateRadioStream( Any_ID, "Custom Radio", "http://my_domain.com/audio_stream.php", true );
Snippets(Recommended Snippet v-0.2) :edit:
v-0.2 >> https://pastebin.com/78EuuZCf
v-0.1 >> https://pastebin.com/ksgQxtiK
Live Version
/* Link To streaming file */
/* http://asian-city.tk/vcmp_stream.php */
/* Create radio statement */
CreateRadioStream( 20, "AC Radio", "http://asian-city.tk/vcmp_stream.php", true );
Note
Better to upload the audio files to the same host where streaming file is upload rather using random links of audio files from other mp3 sites.
2
Snippet Showroom / GTA V Spawn Camera
« on August 7th, 2018, 06:22 PM »
Spawn camera from Grand Theft Auto V created for Liberty Unleashed ported to Vice City Multiplayer
Source: Link
https://youtu.be/I8Im8rJtZho
(click to show/hide)
Source: Link
https://youtu.be/I8Im8rJtZho
Quote I got bored and decided to make a spawn camera like the one in Grand Theft Auto V.
You know ... the one where it goes into birds-eye view like the old GTA, then changes a couple of times, each getting closer to the player until finally showing the player and restoring control.
Usually a little dialog in there too, but I didn't recreate that lol.
So behold, the same spawn camera for Liberty Unleashed!
Just plug and play, pretty much. Script folder into server, add to content.xml, and so on.
A couple of things though:
The draw distance sucks for GTA III, so I had to bring the camera view way down. In GTA V they usually start with the whole city or an entire region of the rural area, before making their way down to the smaller area where the player is. This spawn camera I made starts in the small area, and works down from there. Not exactly the same but it's pretty neat though.
Second, normal spawn with the control key is blocked. Use the following snippet of code to use the new spawn camera:Code: [Select] GTAVSpawn ( Player pPlayer , Vector pVector );
Anyway, here's the link to the source. Available on GitHub.
https://github.com/VortrexFTW/lu_gtavspawncam
3
General Discussion / [Question] Radar Map
« on March 26th, 2018, 06:16 PM »
How to change the radar I know to make png with 128x128 from 00 to 63 files but my question is
How to find out the correct place of each section?
Is there any software used something like moo mapper or any other to put the radar section in their correct place and leave the rest of sections as empty or water texture.
How to find out the correct place of each section?
Is there any software used something like moo mapper or any other to put the radar section in their correct place and leave the rest of sections as empty or water texture.
5
Script and Content Requests / Vehicle conversion
« on December 27th, 2017, 03:07 PM »
Anyone convert this vehicle for vcmp never done the conversion stuff if anyone can do it....
http://www.gtainside.com/en/gta3/cars/1429-mg-midget/
http://www.gtainside.com/en/gta3/cars/1429-mg-midget/
6
Snippet Showroom / [SNIPPET] Lottery System
« on December 25th, 2017, 12:18 PM »Lottery System
Credits: LucasRedGlobals goes at the top of script
/* <?php */
LotteryWon <- false;
TicketsPurchased <- {};
usedTickets <- [];
LotteryCount <- 0;
LotteryPrize <- 0;
Add it in onScriptLoad() event
/* <?php */
function onScriptLoad()
{
Lottery <- array( GetMaxPlayers(), false );
Tickets <- array( 60, false );
}
Add it in onPlayerJoin( player ) event
/* <?php */
function onPlayerJoin( player )
{
Lottery[ player.ID ] = false;
TicketsPurchased.rawset( player.ID, 0 );
}
Add it in onPlayerPart( player, reason ) event
/* <?php */
function onPlayerPart( player, reason )
{
if ( Lottery[ player.ID ] == true ) // If the player bought ticket...
{
local a = TicketsPurchased.rawget( player.ID );
Tickets[a] = false;
TicketsPurchased.rawdelete( player.ID ); // Delete player ticket...
LotteryCount >= 1 ? LotteryCount -- : ( LotteryCount --, _Lottery.Delete(), EndLottery() ); // decrease participants...
}
}
Add it in onPlayerCommand( player, cmd, text ) event
/* <?php */
function onPlayerCommand( player, cmd, text )
{
if ( cmd == "lotto" )
{
if ( !text ) MessagePlayer( "Error - Syntax: /lotto <number betwen 1 and 60>", player);
else if ( !IsNum( text ) ) MessagePlayer( "Use numbers", player );
else
{
if ( Lottery[ player.ID ] == true ) MessagePlayer( "Wait for the result. You already have ticket", player );
else
{
if ( Tickets[text.tointeger()] == true ) MessagePlayer( "ticket already bought", player );
else if ( ( text.tointeger() > 0 ) && ( text.tointeger() < 61 ) )
{
if ( player.Cash >= 1000 )
{
if ( !LotteryCount )
{
Message( "lottery started." );
_Lottery <- NewTimer( "StartLottery", 2000, 1 );
}
player.Cash -= 1000;
Lottery[ player.ID ] = true;
Tickets[text.tointeger()] = true;
usedTickets.push( text.tointeger() );
LotteryCount ++;
local value = ( ( rand() % ( 80000 - 50000 ) ) + 50000 );
LotteryPrize = value.tointeger();
TicketsPurchased.rawset( player.ID, text.tointeger() ); // Set ticket ID for player...
MessagePlayer( "You have paid $1000 for ticket", player );
}
else MessagePlayer( "You need $1000 to buy ticket", player );
}
else
{
MessagePlayer( "You need $1000 to buy ticket.", player );
MessagePlayer("Select number betwen 1 and 60", player );
}
}
}
}
else if ( cmd == "lotstats" )
{
local a;
for ( local i = 0; i <= GetMaxPlayers(); i ++ )
{
local player = FindPlayer( i );
if ( player )
{
local t = TicketsPurchased.rawget( player.ID );
if ( a ) a = a + ", " + player.Name + "(" + t + ")";
else a = player.Name + "(" + t + ")";
}
}
if ( a ) Message( "Tickets: " + a );
else Message( "No tickets" );
}
}
functions goes at the end of script
/* <?php */
function StartLottery()
{
if ( LotteryCount >= 3 ) // Lottery starts from three tickets purchased. You chose this...
{
local ticket = raffle();
for ( local i = 0; i <= GetMaxPlayers(); i ++ )
{
local player = FindPlayer( i );
if ( player )
{
if ( Lottery[ player.ID ] == true )
{
if ( TicketsPurchased.rawget( player.ID ) == ticket )
{
LotteryWon = true;
Message( "Lottery: The winner is..." );
Message( "Lottery: " + player.Name + ". ( ticket " + TicketsPurchased.rawget( player.ID ) + " )" );
player.Cash += LotteryPrize;
}
}
}
}
LotteryWon ? ( Message( "Closed lottery." ), EndLottery() ) : Message( "Lottery: No winners this time, the prize is now " + LotteryPrize );
}
else
{
Message( "Lottery delayed for lack of tickets." );
_Lottery <- NewTimer( "StartLottery", 60000, 1 );
}
}
function EndLottery()
{
for ( local i = 0; i <= GetMaxPlayers(); i ++ )
{
local player = FindPlayer( i );
if ( player )
{
if ( Lottery[ player.ID ] == true )
{
TicketsPurchased.rawset( player.ID, 0 );
Lottery[ player.ID ] = false;
LotteryWon = false;
LotteryCount = 0;
}
}
}
for ( local i = 1; i < 60; i ++ )
{
Tickets[i] = false;
usedTickets.clear();
}
}
function raffle()
{
local rand = rand() % usedTickets.len();
return usedTickets[rand];
}
7
Off-Topic General / Wow really
« on December 24th, 2017, 02:27 PM »
Temporary Removed For Confirmation
8
Off-Topic General / VCMP Poll Must Vote
« on October 20th, 2017, 08:15 AM »
Lets wait for the results.
9
Snippet Showroom / [SNIPPET] Basic Vehicle Passengers Freeview
« on October 10th, 2017, 08:23 AM »Basic Vehicle Passengers Freeview
Note:
- This system only works for the vehicle passengers not for the vehicle driver & will work only if there is a driver present in vehicle otherwise it will revoke for all passengers.
- Change the 'MaxOccupants' if required cause I am not much sure about max occupants for vehicles like bus but I think 9 is max for vcmp vehicles since some of the users will ask why you have set 'MaxOccupants' to 8 instead of 9 so for their kind information the vehicle.GetOccupant(_integer) starts from 0 in vcmp.
Events Used:
onPlayerEnterVehicle( player, vehicle, door )
onPlayerExitVehicle( player, vehicle )
Functions Used:
player.SpectateTarget
vehicle.GetOccupant(_integer[max-8])
Snippet:
/* <?php */
function onPlayerEnterVehicle( player, vehicle, door )
{
if ( vehicle.Driver != null )
{
if ( vehicle.Driver.ID != player.ID ) player.SpectateTarget = vehicle.Driver;
else
{
local MaxOccupants = 8;
for( local i = 1; i <= MaxOccupants; i++ )
{
local Occupant = vehicle.GetOccupant( i );
if ( Occupant != null && Occupant.SpectateTarget == null ) Occupant.SpectateTarget = player;
}
}
}
}
function onPlayerExitVehicle( player, vehicle )
{
if ( player.SpectateTarget != null ) player.SpectateTarget = null; /* Its not necessary to use this line */
if ( vehicle.Driver == null )
{
local MaxOccupants = 8;
for( local i = 1; i <= MaxOccupants; i++ )
{
local Occupant = vehicle.GetOccupant( i );
if ( Occupant != null && Occupant.SpectateTarget != null ) Occupant.SpectateTarget = null;
}
}
}
Video:
https://youtu.be/3SpyvfmOTMw
(6 more chars)
10
General Discussion / Need Fixed Link From Old Forum Topic
« on October 10th, 2017, 04:54 AM »
Did anyone have the fixed link to this file?
http://stormeus.vicelegends.com/SqHTTP.7z
Topic:
http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=614.0
:D
http://stormeus.vicelegends.com/SqHTTP.7z
Topic:
http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=614.0
:D
11
General Discussion / Report
« on October 8th, 2017, 03:16 PM »
Is there any board to report or a topic caues this noob named Vattan I don't even know weather its the real one or a fake user used his nick but all I need is to ban this f**king noob >:( server IP from the masterlist.
Remember Grand Theft Auto Asian City was first started by me and now some noobs are trying to steal the name f**k all of em >:(.
If you guys need any evidence I'll post it even most of the users know that the name was first used by me.
Server IP/Port: 178.32.100.87:50597
Evidence:

Is there any possiblity to do it or any one can use anyone's server name except for the official one
Remember Grand Theft Auto Asian City was first started by me and now some noobs are trying to steal the name f**k all of em >:(.
If you guys need any evidence I'll post it even most of the users know that the name was first used by me.
Server IP/Port: 178.32.100.87:50597
Evidence:

Is there any possiblity to do it or any one can use anyone's server name except for the official one
12
Videos & Screenshots / GUI Stats Panel | V-0.3
« on October 4th, 2017, 06:00 PM »13
Snippet Showroom / A Function Improvement Snippet
« on October 2nd, 2017, 09:30 AM »
I've seen some users using this function
Code: [Select] Suppose there are 10 player online while the max players is 100 so this function is using the memory for no work.
Code: [Select]
This simple snippet helps to remove those useless calling.This snippet is very usefull for those who are using global timers for players eg. antibank killing( almost everyone uses a timer for it but looking at published scripts GetMaxPlayers() has been used in it which according to me is a bad idea )
(click to show/hide)
(click to show/hide)
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
local plr = FindPlayer( i );
if ( plr ) print("found");
}
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
local plr = FindPlayer( i );
if ( plr ) print("found");
else print("wasting :P");
}
This simple snippet helps to remove those useless calling.This snippet is very usefull for those who are using global timers for players eg. antibank killing( almost everyone uses a timer for it but looking at published scripts GetMaxPlayers() has been used in it which according to me is a bad idea )
This goes at the top of main.nut fileCode: [Select] /* A global constant/array which stores IDs of online players */
PlrsOnline <- [ ];
/* A global constant/array which handels the functions */
Players <- { };
This goes at the top of onPlayerJoin( player ) functionCode: [Select] /* Lets adds the ID of player to the online players list */
Players.Inc( player.ID );
This goes at the top of onPlayerPart( player, reason ) functionCode: [Select] /* Remove the ID of player from the online players list */
Players.Dec( player.ID );
These functions can be pasted at any place in the scriptCode: [Select] /* This functions push the ID to the array */
Players.Inc <- function( Plr_ID ) {
/* Check is id already available in array, return if it's available */
if ( PlrsOnline.find( Plr_ID ) != null ) return 0; // Just for precautionary measurement if not removed due to any reason
/* If it's not available push the ID to the array */
PlrsOnline.push( Plr_ID );
}
/* This functions removes the ID from the array */
Players.Dec <- function( Plr_ID ) {
/* Check is id already available in array, return if it's available */
if ( PlrsOnline.find( Plr_ID ) == null ) return 0; // once again it's for precautionary measurement
/* If it's available remove the ID from array */
PlrsOnline.remove( PlrsOnline.find( Plr_ID ) );
}
Code: [Select] foraceh( iPlrID in PlrsOnline )
{
local plr = FindPlayer( iPlrID );
if ( plr ) print("found");
}(click to show/hide) Code: [Select] foraceh( iPlrID in PlrsOnline )
{
local plr = FindPlayer( iPlrID );
if ( plr ) plr.Health = -1;
}(click to show/hide) Lets suppose we want to get all players having hp less then 50%Code: [Select] foraceh( iPlrID in PlrsOnline )
{
local plr = FindPlayer( iPlrID );
if ( plr && plr.Health <= 50 ) print( "Found player "+plr.Name+" with ID: "+plr.ID+" having HP: "+plr.Health+"" );
}
14
General Discussion / Setting Immunity To Specific Player
« on September 24th, 2017, 12:29 PM »
How to set two players immunity which works only for both of them while otheres can kill them?
How to do it when both players have different teams?
P.S: I've used this
Code: [Select] But player is still not immune to weapons like mp5 & pyton. Even tried to use all the immune ids but still not working.
How to do it when both players have different teams?
P.S: I've used this
player.Immunity = 31;
15
General Discussion / What is the difference & features?
« on September 23rd, 2017, 03:08 PM »
BanPlayer( player );
player.Ban();
And what are their features
I mean protection level etc or how the server heck players banned by these two functions?
player.Ban();
And what are their features
I mean protection level etc or how the server heck players banned by these two functions?