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 - !

#1
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
$songs = [
'song1 complete link along with http/https',
'song2 complete link along with http/https',
'song3 complete link along with http/https'
];
In my case it is
$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
In my case it is
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
Aug 07, 2018, 05:22 PM
Spawn camera from Grand Theft Auto V created for Liberty Unleashed ported to Vice City Multiplayer
Source: Link


https://youtu.be/I8Im8rJtZho

[spoiler=Topic_from_LU]
QuoteI 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:
GTAVSpawn ( Player pPlayer , Vector pVector );

Anyway, here's the link to the source. Available on GitHub.
https://github.com/VortrexFTW/lu_gtavspawncam
[/spoiler]
#3
General Discussion / [Question] Radar Map
Mar 26, 2018, 05: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.
#4
Videos & Screenshots / This guy needs a medal
Feb 21, 2018, 02:19 PM
#5
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/
#6
Snippet Showroom / [SNIPPET]Lottery System
Dec 25, 2017, 12:18 PM
Lottery System
Credits: LucasRed


Globals 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( 60false );
}


Add it in onPlayerJoin( player ) event

/* <?php */
function 
onPlayerJoinplayer )
{
  
Lotteryplayer.ID ] = false;
  
TicketsPurchased.rawsetplayer.ID);
}


Add it in onPlayerPart( player, reason ) event

/* <?php */
function 
onPlayerPartplayerreason )
  {
  if ( 
Lotteryplayer.ID ] == true // If the player bought ticket...
  
{
    
local a TicketsPurchased.rawgetplayer.ID );
    
Tickets[a] = false;
    
TicketsPurchased.rawdeleteplayer.ID ); // Delete player ticket...
    
LotteryCount >= LotteryCount -- : ( LotteryCount --, _Lottery.Delete(), EndLottery() ); // decrease participants...
  
}
}


Add it in onPlayerCommand( player, cmd, text ) event

/* <?php */
function 
onPlayerCommandplayercmdtext )
{
  if ( 
cmd == "lotto" )
  {
    if ( !
text MessagePlayer"Error - Syntax: /lotto <number betwen 1 and 60>"player);
    else if ( !
IsNumtext ) ) MessagePlayer"Use numbers"player );
    else
    {
      if ( 
Lotteryplayer.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() > ) && ( text.tointeger() < 61 ) )
        {
          if ( 
player.Cash >= 1000 )
          {
            if ( !
LotteryCount )
            {
              
Message"lottery started." );
              
_Lottery <- NewTimer"StartLottery"2000);
            }
            
player.Cash -= 1000;
            
Lotteryplayer.ID ] = true;
            
Tickets[text.tointeger()] = true;
            
usedTickets.pushtext.tointeger() );
            
LotteryCount ++;
            
local value = ( ( rand() % ( 80000 50000 ) ) + 50000 );
            
LotteryPrize value.tointeger();
            
TicketsPurchased.rawsetplayer.IDtext.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<= GetMaxPlayers(); ++ )
    {
      
local player FindPlayer);
      if ( 
player )
      {
        
local t TicketsPurchased.rawgetplayer.ID );
        if ( 
", " player.Name "(" ")";
        else 
player.Name "(" ")";
      }
    }
    if ( 
Message"Tickets: " );
    else 
Message"No tickets" );
  }
}


functions goes at the end of script

/* <?php */
function 
StartLottery()
{
  if ( 
LotteryCount >= // Lottery starts from three tickets purchased. You chose this...
  
{
    
local ticket raffle();
    for ( 
local i 0<= GetMaxPlayers(); ++ )
    {
      
local player FindPlayer);
      if ( 
player )
      {
        if ( 
Lotteryplayer.ID ] == true )
        {
          if ( 
TicketsPurchased.rawgetplayer.ID ) == ticket )
          {
            
LotteryWon true;
            
Message"Lottery: The winner is..." );
            
Message"Lottery: " player.Name ". ( ticket " TicketsPurchased.rawgetplayer.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);
  }
}

function 
EndLottery()
{
  for ( 
local i 0<= GetMaxPlayers(); ++ )
  {
    
local player FindPlayer);
    if ( 
player )
    {
      if ( 
Lotteryplayer.ID ] == true )
      {
        
TicketsPurchased.rawsetplayer.ID);
        
Lotteryplayer.ID ] = false;
        
LotteryWon false;
        
LotteryCount 0;
      }
    }
  }

  for ( 
local i 160++ )
  {
    
Tickets[i] = false;
    
usedTickets.clear();
  }
}

function 
raffle()
{
  
local rand rand() % usedTickets.len();
  return 
usedTickets[rand];
}
#7
Off-Topic General / Wow really
Dec 24, 2017, 02:27 PM
Temporary Removed For Confirmation
#8
Off-Topic General / VCMP Poll Must Vote
Oct 20, 2017, 07:15 AM
Lets wait for the results.
#9
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 
onPlayerEnterVehicleplayervehicledoor )
{
   if ( 
vehicle.Driver != null )
   {
      if ( 
vehicle.Driver.ID != player.ID player.SpectateTarget vehicle.Driver;
      else
      {
         
local MaxOccupants 8;
         for( 
local i 1<= MaxOccupantsi++ )
         {
          
local Occupant vehicle.GetOccupant);
            if ( 
Occupant != null && Occupant.SpectateTarget == null Occupant.SpectateTarget player;
         }
      }
   }
}
   
function 
onPlayerExitVehicleplayervehicle )
{
   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<= MaxOccupantsi++ )
      {
         
local Occupant vehicle.GetOccupant);
         if ( 
Occupant != null && Occupant.SpectateTarget != null Occupant.SpectateTarget null;
      }
   }
}

Video:
https://youtu.be/3SpyvfmOTMw

[more]
#11
General Discussion / Report
Oct 08, 2017, 02: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
#13
I've seen some users using this function
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
   local plr = FindPlayer( i );
   if ( plr ) print("found");
}
Suppose there are 10 player online while the max players is 100 so this function is using the memory for no work.
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 )

[spoiler=Installation]
This goes at the top of main.nut file
/* 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 ) function
/* Lets adds the ID of player to the online players list */
Players.Inc( player.ID );

This goes at the top of onPlayerPart( player, reason ) function
/* Remove the ID of player from the online players list */
Players.Dec( player.ID );

These functions can be pasted at any place in the script
/* 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 ) );
}
[/spoiler]

[spoiler=Usage]
foraceh( iPlrID in PlrsOnline )
{
   local plr = FindPlayer( iPlrID );
   if ( plr ) print("found");
}

[spoiler=Usage(healing_all)]
foraceh( iPlrID in PlrsOnline )
{
   local plr = FindPlayer( iPlrID );
   if ( plr ) plr.Health = -1;
}
[/spoiler]

[spoiler=Usage(getting_player_by_specific_data/stats)]
Lets suppose we want to get all players having hp less then 50%
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+"" );
}
[/spoiler]

[/spoiler]
#14
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
player.Immunity = 31;
But player is still not immune to weapons like mp5 & pyton. Even tried to use all the immune ids but still not working.
#15
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?
#17
General Discussion / Font Name?
Sep 18, 2017, 02:54 PM
Did anyone know the font name

or this one


P.s Link
#18
Update Reason: Used vcmp official hashing, unique id concept has been used and installation is made simple.

Commands:
   -> /commands
   -> /register <password>
   -> /login <password>
   -> /changepass <old-password> <new-password>

Installation: Download the file rlc.nut from the link and place it inside svr_dir and place the bellow functions in appropriate server events.

onScriptLoad()
/* onScriptLoad() */
dofile( "rlc.nut", true );
rlc_table.onScriptLoad( );

onPlayerJoin( player )
/* onPlayerJoin( player ) */
rlc_table.onPlayerJoin( player );

onPlayerPart( player, reason )
/* onPlayerPart( player, reason ) */
rlc_table.onPlayerPart( player );

onPlayerCommand( player, command, arguments )
/* onPlayerCommand( player, command, arguments ) */
switch( command ) {
 case "register":
 case "login":
 case "changepass":
    rlc_table.onPlayerCommand( player, command, arguments );
 break;
 case "commands":
    MessagePlayer( "[#7bb215][RLC] [#15a26f]RLC Commands: [/] register, login, changepass.", player );
 break;
 default:
    MessagePlayer( "[#7bb215][RLC] [#cc3510](ERROR) Invalid command, use /commands to check for availble commands.", player );
}


Github: Link
#19
Credits: Elite Killerz | Estate City Server for give me an idea. ;D

Features
>Syncronised with scroll bar.
>Multiple pages which allow us to write many words.
>Everything is done in clientside.
>Different background pictures.

Installation
1.Copy and paste everything from replaceable snippte in correct place in Svr_Dir/store/script/main.nut file.
2.Copy & paste everything from copy & pasteable snippet at the beginning of Svr_Dir/store/script/main.nut file.
3.Create a file in Svr_Dir/store/script/ with name messages.nut or simply copy and paste the messages.nut file from this topic to script directory.

Pictures
Link
[spoiler=Pics]



[/spoiler]

Downloadable Stuff
1.Sample file for messages.nut


2.Sample Pictures(copy and paste them in Svr_Dir/store/sprites)


Snippets
[spoiler=Replaceable-Snippet]
Replace every thing in the correct place in Svr_Dir/store/script/main.nut file
[noae][noae][noae]/* <?php */
keyBIND_F1 <- KeyBind0x70 );
COLOR_BLUE   <- Colour00255 );

function 
Script::ScriptLoad( )
{
dofile"messages.nut" );  //This is the file from which we are going to read memobox data.
}

function 
GUI::ScrollbarScrollscrollbarpositionchange )
{
GUI_ServerLogs.ScrollbarScrollscrollbarposition );
}

function 
GUI::ElementClick(elementmousexmousey)
{
GUI_ServerLogs.ElementClickelement );
}

function 
KeyBind::OnDownkeyBind )
{
if ( 
keyBind == keyBIND_F1 GUI_ServerLogs.Decide( );
}

function 
GUI::ElementRelease(elementmouseXmouseY)
{
GUI_ServerLogs.ElementReleaseelement );
}

function 
GUI::GameResizewidthheight )
{
GUI_ServerLogs.GameResize( );
}
[/noae][/noae][/noae]
[/spoiler]

[spoiler=Copy&Pasteable-Snippet]
Copy & paste this snippet at the beginning of Svr_Dir/store/script/main.nut file
[noae][noae][noae]/* <?php */
GUI_ServerLogs <- {
LogsW null,   //Logs Window (leve it as it is)
LogsB null,   //Logs Board (leve it as it is)
LogsS null,   //Logs Scroll (leve it as it is)
LogsE null,   //Logs Exit (leve it as it is)
LogsN null,   //Logs Next (leve it as it is)
LogsP null,   //Logs Previous (leve it as it is)
PageID 1,   //Current Page (leve it as it is)

MaxPages 3,   //Max NO. Of Pages (set it according to your need)
Pics 3,   //Background Pictures (set it according to your need)

ShowGUI 0,   //Showing GUI  (leve it as it is)

function 
Create( )
{
//Credits: EK.IceFlake for sample script + idea
local cScreenSize GUI.GetScreenSize();
local Pic_No rand()%Pics;

//Set the bellow pics names starting with car_...
if ( Pic_No == LogsW = ::GUISprite"car_1.jpg"VectorScreen0) );
if ( Pic_No == LogsW = ::GUISprite"car_2.jpg"VectorScreen0) );
if ( Pic_No == LogsW = ::GUISprite"car_3.jpg"VectorScreen0) );

LogsW.Size cScreenSize;
LogsB = ::GUIMemoboxVectorScreen3232 ), VectorScreencScreenSize.80cScreenSize.64 ), Colour255255255128 ), GUI_FLAG_TEXT_TAGS );
LogsB.HistorySize 255;
LogsS = ::GUIScrollbarVectorScreencScreenSize.4832 ), VectorScreen16cScreenSize.64 ) );
LogsE = ::GUILabel(VectorScreencScreenSize.28cScreenSize.10 ), Colour1790), "Exit" );
DecidePage( );
LogsE.TextAlignment GUI_ALIGN_LEFT;
LogsE.FontName "Corbel";
LogsE.FontSize 13;
LogsE.AddFlagsGUI_FLAG_MOUSECTRL );
::GUI.SetMouseEnabled( );
}

function 
DecidePageButtons( )
{
if ( ShowGUI == ) return;

if ( ( LogsS.BarPosition != && LogsP != null ) || ( LogsS.BarPosition != && LogsN != null ) ) RemovePageButtons( );

if ( LogsS.BarPosition != && LogsS.BarPosition != ) return;

if ( LogsS.BarPosition == && LogsP == null && PageID != )
{
RemovePageButtons( );
local cScreenSize GUI.GetScreenSize();
LogsP GUIButtonVectorScreencScreenSize.130), VectorScreen8520 ), Colour140140140 ), "Previous Page", ( GUI_FFLAG_BOLD GUI_FFLAG_ULINE ) );
LogsP.TextColour  COLOR_BLUE;
return;
}

if ( LogsS.BarPosition == && LogsN == null && PageID != MaxPages )
{
RemovePageButtons( );
local cScreenSize GUI.GetScreenSize();
LogsN GUIButtonVectorScreencScreenSize.130cScreenSize.27 ), VectorScreen6520 ), Colour140140140 ), "Next Page", ( GUI_FFLAG_BOLD GUI_FFLAG_ULINE ) );
LogsN.Alpha 200;
LogsN.TextColour  COLOR_BLUE;
return;
}
}

function 
ScrollbarScrollscrollbarposition )
{
if ( !ShowGUI ) return;

switch( scrollbar )
{
case LogsS:
GUI_ServerLogs.DecidePageButtons( );
GUI_ServerLogs.LogsB.DisplayPos position;
break;
}
}

function 
ElementClickelement )
{
if ( !ShowGUI ) return;

switch( element )
{
case LogsE:
Close( );
break;
}
}

function 
ElementReleaseelement )
{
if ( !ShowGUI ) return;

switch( element )
{
case LogsN:
PageID++;
DecidePage( );
break;
case LogsP:
PageID--;
DecidePage( );
break;
}
}

function 
GameResize( )
{
if ( !ShowGUI ) return;

Close( );
}

function 
RemovePageButtons( )
{
if ( !ShowGUI ) return;

if ( LogsN != null LogsN null;
if ( LogsP != null LogsP null;
}

function 
DecidePage( )
{
if ( !ShowGUI ) return;

local NPageID PageID 1;
RemovePageButtons( );
LogsB.Clear();
LogsB.AddLine""Colour646464 ) );
LogsB.AddLine"Grand Theft Auto Asian City ChangeLogs Page: "+PageIDColour150050 ) );
if ( PageID == ) foreach ( lr in ::splitSvrLogs3"\n" ) ) LogsB.AddLinelrColour646464 ) );
else if ( PageID == ) foreach ( lr in ::splitSvrLogs2"\n" ) ) LogsB.AddLinelrColour646464 ) );
else if ( PageID == ) foreach ( lr in ::splitSvrLogs1"\n" ) ) LogsB.AddLinelrColour646464 ) );

if ( PageID == MaxPages LogsB.AddLine"End of server changelogs."Colour150050 ) );
else LogsB.AddLine"Click on next page button for page: "+NPageIDColour150050 ) );

LogsS.BarPosition 0;
LogsB.DisplayPos 1;
}

function 
Close( )
{
if ( !ShowGUI ) return;

LogsW null;
LogsB null;
LogsS null;
LogsE null;
LogsN null;
LogsP null;
::GUI.SetMouseEnabled(false);

ShowGUI 0;
}

function 
Show( )
{
if ( ShowGUI ) return;
ShowGUI 1;
Create( );
}

function 
Decide( )
{
if ( ShowGUI Close( );
else Show( );
}
}
[/noae][/noae][/noae]
[/spoiler]

Note:
Press F1 key to open and close the memobox.

[spoiler=Sample_Store_File]

[/spoiler]
#20
Is it possible to get a random location ( for example inside airport or all downtown. ) instead of saving some coordinates and getting random from them.