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.


Topics - ysc123

Pages: [1]
1
General Discussion / VCMP 0.3 multiple instances?
« on: October 06, 2014, 11:22:43 pm »
VCMP 0.4 can start multiple game instances. How to do it in 0.3? :)

2
Script Discussion / Full document for Squirrel plugins
« on: October 01, 2014, 11:00:10 pm »
0.4 Sockets
Code: [Select]
Function:
NewSocket(pszDataFunc)

Class:
CSquirrelSockets
Connect(szHost,usPort)
Disconnect(ucConn)
Send(sz)
SendClient(sz,ucConn)
SetLostConnFunc(function)
SetNewConnFunc(function)
Start(usPort,usMaxConns)
Stop()

0.4 Hashing Algorithms
Code: [Select]
base64_encode(Input)
base64_decode(Input)
MD5(Input)
SHA1(Input)
SHA224(Input)
SHA256(Input)
SHA384(Input)
SHA512(Input)
RIPEMD128(Input)
RIPEMD160(Input)
RIPEMD256(Input)
RIPEMD320(Input)
WHIRLPOOL(Input)

0.4 SQLite
Code: [Select]
ConnectSQL(filename)
DisconnectSQL(database)
QuerySQL(database,sql)
GetSQLNextRow(query)
GetSQLColumnCount(query)
GetSQLColumnData(query,column)
FreeSQLQuery(query)
escapeSQLString(string)

0.4 INIParser
Code: [Select]
ReadIniString(pszFile,pszSection,pszVar)
ReadIniInteger(pszFile,pszSection,pszVar)
ReadIniNumber(pszFile,pszSection,pszVar)
ReadIniBool(pszFile,pszSection,pszVar)
WriteIniString(pszFile,pszSection,pszVar,pszVal)
WriteIniInteger(pszFile,pszSection,pszVar,pszVal)
WriteIniNumber(pszFile,pszSection,pszVar,pszVal)
WriteIniBool(pszFile,pszSection,pszVar,pszVal)
CountIniSection(pszFile,pszSection)
RemoveIniValue(pszFile,pszSection,pszVar)
DeleteIniSection(pszFile,pszSection)
ClearIni(pszFile)

0.4 MySQL
Code: [Select]
mysql_connect(szServer,szUser,szPass,szDatabase)
mysql_close(pConn)
mysql_query(pConn,szQuery)
mysql_num_rows(pConn)
mysql_num_fields(pConn)
mysql_fetch_row(pConn)
mysql_fetch_assoc(pConn)
mysql_fetch_lengths(pConn)
mysql_free_result(pConn)
mysql_errno(pConn)
mysql_error(pConn)
mysql_ping(pConn)
mysql_escape_string(pConn,szText)
mysql_select_db(pConn,szDatabase)
mysql_change_user(pConn,szUser,szPass)
mysql_warning_count(pConn)
mysql_affected_rows(pConn)
mysql_insert_id(pConn)
mysql_info(pConn)
Please reply me if it's any issue in this document! :)

3
General Discussion / HideMapObject Converter
« on: October 01, 2014, 05:52:46 am »
Old topic:http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=2691.0

Convert IPL code to HideMapObject.




Function description:
Add Comments: Add the object name comments.
Convert Vector: Convert the float vector to integer vector.(No difference)
(See the screenshot)

You can use MooMapper to determine the location of objects.
Example:
Double click the object, copy the code.

Paste the code in the program, then click "Convert", and add the result code to your script.

Effects in game:


Download: https://drive.google.com/file/d/0B2gm3UDLEKrRRS1ra0JoeElfWFk/edit
This program can support two languages, Chinese and English.

4
Script Releases / Death Messages (like SA:MP)
« on: October 01, 2014, 05:43:30 am »
Screenshot:


Code: [Select]
MaxLines <- 8;
LineGap <- 15;
PosX <- -400;
PosY <- 380;
function onServerStart()
{
TextInfo <- array( MaxLines );
}
function onPlayerDeath(player, reason)
{
local Text="";
if (reason==70)
{
Text="*> "+player.Name+" committed suicide. <*";
}
else if (reason==39)
{
Text="*> "+player.Name+" died in a car crash. <*";
}
else if (reason==31)
{
Text="*> "+player.Name+" burned to death. <*";
}
else if (reason==14)
{
Text="*> "+player.Name+" choked to death. <*";
}
else if (reason==43)
{
Text="*> "+player.Name+" drowned. <*";
}
else if (reason==41 || reason==51)
{
Text="*> "+player.Name+" exploded. <*";
}
else if (reason==44)
{
Text="*> "+player.Name+" fell to death. <*";
}
else
{
Text="*> "+player.Name+" died for some reason. <*";
}
DeathMessage(Text);
}
function onPlayerKill(player, killer, reason, bodypart)
{
DeathMessage(DeathText(player, killer, reason, bodypart));
}
function onPlayerTeamKill(player, killer, reason, bodypart)
{
DeathMessage(DeathText(player, killer, reason, bodypart));
}
function DeathText(player, killer, reason, bodypart)
{
local Text="";
if (reason == 14 || reason == 31 || reason == 39 || reason == 40 || reason == 41 || reason == 44 || reason == 51)
{
Text="*> "+killer.Name+" killed "+player.Name+" with "+GetWeaponName(reason)+". <*";
}
else
{
Text="*> "+killer.Name+" killed "+player.Name+" with "+GetWeaponName(reason)+" "+BodyPartText(bodypart)+". <*";
}
}
function Message(Text)
{
if (TextInfo[0])
{
TextInfo[0].Delete();
}
for (local i=0; i<MaxLines-1; i++)
{
if (TextInfo[i+1])
{
TextInfo[i] = TextInfo[i+1];
TextInfo[i].SetPosForAll(PosX, PosY+(i)*LineGap);
}
}
TextInfo[MaxLines-1] = CreateTextdraw(Text, PosX, PosY+(MaxLines-1)*LineGap, 0xFFB0B0B0);
TextInfo[MaxLines-1].ShowForAll();
}
function BodyPartText(bodypart)
{
switch( bodypart )
{
case 0:return "to body";
case 1:return "to torso";
case 2:return "to left arm";
case 3:return "to right arm";
case 4:return "to left leg";
case 5:return "to right leg";
case 6:return "to head";
case 7:return "hitting his car";
default:return "unknown";
}
}

Set DeathMessages to false in server.conf.
And you can use "Message" function to show any text you want.

5
Script Discussion / Full document for server.conf
« on: September 27, 2014, 10:25:30 am »
I saw the source code and wrote this documents.

Settings
Code: [Select]
<Settings>
<ServerName>Your Server Name</ServerName>
<MaxPlayers>100</MaxPlayers><!-- You also can define maxplayers in server.cfg -->
<!--Password>Server Password</Password-->
<FriendlyFire>true</FriendlyFire>
<ShowOnRadar>true</ShowOnRadar>
<WeatherDefault>1</WeatherDefault>
<HourDefault>12</HourDefault>
<MinuteDefault>0</MinuteDefault>
<TimeRate>1000</TimeRate>
<GameModeName>Your Game Mode Name</GameModeName><!-- You also can define gamemode in server.cfg -->

<PlayerPos x="-232.0314" y="-442.6181" z="32.7944"/>
<CamPos x="-231.4" y="-440.0" z="32.1"/>
<CamLook x="-232.0314" y="-442.6181" z="33.1"/>
<WorldBoundaries MaxX="5000.0" MinX="-5000.0" MaxY="5000.0" MinY="-5000.0"/>

<!-- R2 Features -->
<SyncFrameLimiter>true</SyncFrameLimiter>
<FrameLimiter>false</FrameLimiter>
<TaxiBoostJump>true</TaxiBoostJump>
<DriveOnWater>true</DriveOnWater>
<FastSwitch>false</FastSwitch>
<DisableDriveBy>false</DisableDriveBy>
<PerfectHandling>false</PerfectHandling>
<FlyingCars>false</FlyingCars>
<JumpSwitch>true</JumpSwitch>
<DeathMessages>false</DeathMessages>

<Gravity>0.008</Gravity>
<GameSpeed>1.0</GameSpeed>
<WaterLevel>6.0</WaterLevel>

<!-- 04 Settings -->
<ShootInAir>false</ShootInAir>
<JoinMessages>true</JoinMessages>
<ShowNametags>true</ShowNametags>
<StuntBike>true</StuntBike>
</Settings>

Class
Code: [Select]
<Class team="" skin="" x="" y="" z="" angle="" weapon1="" ammo1="" weapon2="" ammo2="" weapon3="" ammo3="" r="" g="" b="" a="" />Example
Code: [Select]
<Class team="1" skin="5" x="335.570099" y="-233.904694" z="29.646601" angle="164.184799" weapon1="0" ammo1="0" weapon2="17" ammo2="500" weapon3="21" ammo3="500" r="255" g="255" b="255" a="255" />
Vehicle
Code: [Select]
<Vehicle model="" x="" y="" z="" rotx="" roty="" rotz="" col1="" col2="" world="" />Note: world id starts from 1.
Example
Code: [Select]
<Vehicle model="177" x="404.6970" y="-166.4923" z="6.6427" rotx="0" roty="0" rotz="0" col1="13" col2="1" world="1" />
Pickup
Code: [Select]
<Pickup model="" x="" y="" z="" world="" />

6
Script Discussion / Admin Commands
« on: September 13, 2014, 07:45:13 pm »
Does 0.4 have admin commands? Like 0.3 /kick, /ban, etc. :)

7
General Discussion / Problem with the forum
« on: August 30, 2014, 07:16:44 pm »
I can't zoom the webpage on my iPhone.
Screenshot:
Is it something wrong with the webpage? Please fix it!

8
Resolved Bug Reports / [NOBUG] GetPlayerIP empty
« on: August 30, 2014, 08:15:27 am »
Description
GetPlayerIP return empty string.

Reproducible
Always

What you were doing when the bug happened
using GetPlayerIP function

What you think caused the bug
I don't know.

Not a bug. It's my code issue.

9
General Discussion / [SUGGESTION]Please add screenshot support!
« on: August 30, 2014, 01:30:14 am »
Old topic: http://vcmp.liberty-unleashed.co.uk/forum/index.php?topic=2684.0
In 0.3 press F8 can take a screenshot, but why 0.4 can't?

10
Vice City / Can I help for 0.4?
« on: December 16, 2013, 05:15:31 pm »
I'm a student from China. Now every weekends I have some free time. Can I do something help for VCMP 0.4?

Pages: [1]