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?
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.
Function:
NewSocket(pszDataFunc)
Class:
CSquirrelSockets
Connect(szHost,usPort)
Disconnect(ucConn)
Send(sz)
SendClient(sz,ucConn)
SetLostConnFunc(function)
SetNewConnFunc(function)
Start(usPort,usMaxConns)
Stop()
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)
ConnectSQL(filename)
DisconnectSQL(database)
QuerySQL(database,sql)
GetSQLNextRow(query)
GetSQLColumnCount(query)
GetSQLColumnData(query,column)
FreeSQLQuery(query)
escapeSQLString(string)
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)
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!
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";
}
}
<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 team="" skin="" x="" y="" z="" angle="" weapon1="" ammo1="" weapon2="" ammo2="" weapon3="" ammo3="" r="" g="" b="" a="" />
Example<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 model="" x="" y="" z="" rotx="" roty="" rotz="" col1="" col2="" world="" />
Note: world id starts from 1.<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 model="" x="" y="" z="" world="" />