The online racing simulator
Searching in All forums
(28 results)
1
geekas
S3 licensed
There are already a lot of documentation, like https://github.com/alexmcbride/insimdotnet/wiki/InSim or http://www.nudoq.org/#!/Projects/InSimDotNet . If you really know programming in C#, you will understand new library, because all code examples are explained.
geekas
S3 licensed
Quote from Sasho99 :yeah you need programming , and C+,C++,C# too

Not just C++, C#. People also created InSim library in PHP, Java, NodeJS and more...
geekas
S3 licensed
First, learn programming, then try to create insim.
geekas
S3 licensed
Quote from kepp1313 :I need because I want

So create it. Why do you need for you this system? You will play alone in server with register and login? Nice try. LFS devs do not support crackers.
geekas
S3 licensed
Why do you need register system?
geekas
S3 licensed
Quote from zazcoisa1998 :I tried to change the ClickID to a random number, as well as ReqI, but not working.

The problem is that there is no more code to show .. everything is working correctly and without any errors, but when I try to add a button in any place (I tried to put it when NCN, NPL, CON, MSO and few others are received) it doesn't work too!!
I want to say that there is something wrong in the library (which I downloaded from insimdotnet.codeplex.com) but i don't think so, since many users use it too .. so I really don't know what's wrong :|

You have downloaded an old library from CodePlex. New library is developed in GitHub ( https://github.com/alexmcbride/insimdotnet )
geekas
S3 licensed
Quote from Audi A3 :Don't help for him, he is another Lithuania cracker which is creating LFS cruise server in crack! ! !

I agree. He is a cracker. His other account https://www.lfs.net/profile/1307248 . Moderators should ban this account too.
geekas
S3 licensed
Usage: http://www.lfsworld.net/hoststatus/?h={your server name} .
Example: http://www.lfsworld.net/hoststatus/?h=[TC]%20CityDriving%20One . You can get it in PHP file with this code:

<?php
function GetInformation($name, $output)
{
if ($name == "Players")
{
$output = explode('<div id="Users" class="DataCont"><div class="Field3">', $output);
$output = str_replace('</a>', '', $output[1]);
$output = preg_replace('/<a class="User" href="(.*?)" target="_blank">/i', '$2', $output);
}
else
{
$output = explode('<div id="'.$name.'" class="DataCont">', $output);
$output = explode('</div>', $output[1]);
$output = str_replace('<div class="Field2">', '', $output[1]);
}
return $output;
}

//Variables
$info = array("Track" => "", "Cars" => "", "Version" => "", "Conns" => "", "Players" => "");
$hostname = "[TC]%20CityDriving%20One"; //Change to your server hostname
$time_start = microtime(true);
// Get contents from website url
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.lfsworld.net/hoststatus/?h=".$hostname);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
// Set contents into array
foreach ($info as $name => &$value)
{
$info[$name] = GetInformation($name, $output);
}
// Show information from array
echo "<pre>";
print_r($info);
echo "</pre>";

//Script execution time
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "Script executed in ".$time." seconds";
?>

geekas
S3 licensed
It's hard to explain to beginner. Can you attach your cruise mod in this thread, or send to me via PM? I will put delete button code with code explainings.
geekas
S3 licensed

var delete = new List<IS_BFN>
{
new IS_BFN
{
UCID = C.UCID,
ClickID = 2,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 3,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 4,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 5,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 6,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 7,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 8,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 9,
SubT = ButtonFunction.BFN_DEL_BTN,
},
new IS_BFN
{
UCID = C.UCID,
ClickID = 10,
SubT = ButtonFunction.BFN_DEL_BTN,
},
}
insim.Send(delete);

geekas
S3 licensed
Thanks Bose321.
geekas
S3 licensed
No no, I need grades of hit code, like 7.0, 2.5. When car hits other car, I need to get grades of hit from 0 to 10 points.
IS_CON contact grade
geekas
S3 licensed
Hello. How to detect the grade of contact between 2 cars, like in cargames.nl server?
Example: "Player A hits Player B in 9.5 grades", "Player C hits Player D in 7.0 grades"
geekas
S3 licensed
new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },

copy/paste this code for more buttons. But don't forget, to change ReqI, and ClickID.
And code for deleting buttons:

public static void DeleteButton(InSim insim, byte UCID, byte ClickID)
{
insim.Send(new IS_BFN
{
UCID = UCID,
ClickID = ClickID,
SubT = ButtonFunction.BFN_DEL_BTN,
});
}

Usage:

DeleteButton(insim, C.UCID, 8);

geekas
S3 licensed

var buttons = new List<IS_BTN> {
new IS_BTN { ReqI = 3, UCID = MSO.UCID, ClickID = 3, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
new IS_BTN { ReqI = 4, UCID = MSO.UCID, ClickID = 4, BStyle = ButtonStyles.ISB_DARK | ButtonStyles.ISB_CLICK, T = 30, L = 45, W = 100, H = 120, Text = "", },
// Etc...
};

// Send list in one go.
insim.Send(buttons);

geekas
S3 licensed
Yes, now it works. Thank you.
geekas
S3 licensed

<?php 
PHP NOTICE
:
    
Undefined offset3 in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
    2 
:: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
    4 
:: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
    5 
:: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
    6 
:: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
PHP NOTICE
:
    
Object of class PlayerHandler could not be converted to int in D:\MATAS\testukas\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in D:\MATAS\testukas\modules\prism_statehandler.php:81
    2 
:: onClientPacket in D:\MATAS\testukas\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in D:\MATAS\testukas\modules\prism_hosts.php:576
    4 
:: inspectPacket in D:\MATAS\testukas\modules\prism_hosts.php:487
    5 
:: handlePacket in D:\MATAS\testukas\modules\prism_hosts.php:353
    6 
:: checkTraffic in D:\MATAS\testukas\PHPInSimMod.php:228
object
(IS_TOC)#11 (8) {
  
["Size"[:p]rotected]=>
  
int(8)
  [
"Type"[:p]rotected]=>
  &
int(31)
  [
"ReqI"[:p]rotected]=>
  
int(0)
  [
"PLID"]=>
  
int(3)
  [
"OldUCID"]=>
  
int(2)
  [
"NewUCID"]=>
  
int(1)
  [
"Sp2"[:p]rotected]=>
  
int(0)
  [
"Sp3"[:p]rotected]=>
  
int(0)
}
?>

Still same...
IS_TOC error
geekas
S3 licensed
Error with TOC, when I take over car with other player, I will get an error:

<?php 
IS_TOC Packet from server.
PHP NOTICE:
    
Undefined offset21 in xxxx\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
    2 
:: onClientPacket in xxxx\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in xxxx\modules\prism_hosts.php:576
    4 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    5 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    6 
:: checkTraffic in xxxx\PHPInSimMod.php:228
PHP NOTICE
:
    
Object of class PlayerHandler could not be converted to int in xxxx\modules\prism_statehandler.php on line 416
    1 
:: onTakeOverCar in xxxx\modules\prism_statehandler.php:81
    2 
:: onClientPacket in xxxx\modules\prism_statehandler.php:58
    3 
:: dispatchPacket in xxxx\modules\prism_hosts.php:576
    4 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    5 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    6 
:: checkTraffic in xxxx\PHPInSimMod.php:228
UNKNOWN
:
    
Argument 1 passed to welcome::onTest() must be an instance of ISP_TOCinstance of IS_TOC givencalled in xxxx\modules\prism_plugins.php on line 156 and defined in xxxx\plugins\welcome.php on line 54
    1 
:: onTest in xxxx\modules\prism_plugins.php:156
    2 
:: dispatchPacket in xxxx\modules\prism_hosts.php:577
    3 
:: inspectPacket in xxxx\modules\prism_hosts.php:487
    4 
:: handlePacket in xxxx\modules\prism_hosts.php:353
    5 
:: checkTraffic in xxxx\PHPInSimMod.php:228
object
(IS_TOC)#11 (8) {
  
["Size"[:p]rotected]=>
  
int(8)
  [
"Type"[:p]rotected]=>
  &
int(31)
  [
"ReqI"[:p]rotected]=>
  
int(0)
  [
"PLID"]=>
  
int(21)
  [
"OldUCID"]=>
  
int(20)
  [
"NewUCID"]=>
  
int(19)
  [
"Sp2"[:p]rotected]=>
  
int(0)
  [
"Sp3"[:p]rotected]=>
  
int(0)
}
?>

Code I am using:

<?php 
public function onTakeOverCar(ISP_TOC $TOC)
    {
        
var_dump($TOC);
    }
?>

Is this a PRISM bug?
geekas
S3 licensed
Thank you cargame.nl, that was I exactly needed.
geekas
S3 licensed
No, i mean not that. Lithuanian letters working perfectly in buttons and in MSO text. I mean, how write caption text in button?
In InSim.txt, I found this

// Text : 65-66-67-0 would display button text "ABC" and no caption

// Text : 0-65-66-67-0-68-69-70-71-0-0-0 would display button text "DEFG" and caption "ABC"

But I don't know how to convert text to bytes, and add button caption text. So, will it be on next PRISM release?
geekas
S3 licensed
Thank you Dygear, now Lithuanian letters is working. By the way, file encoding must be ASCII. But, how about button caption text? Can I write caption text, like example above?
Lithuanian letters and button with text
geekas
S3 licensed
Hello. So, I have some questions. First question, how to make Lithuanian letters work. Lithuanian letters is "ąčęėįšųūž", and in insim button I will get unknown symbols like "ąĨęėÄÆÅųūž" . Another question, how to write caption text in button, example: http://www10.zippyshare.com/v/56169448/file.html
Last edited by geekas, .
geekas
S3 licensed
Oops, I didn't seen different between

foreach ($this->getHostState($hostID)->[B][U]players[/U][/B] as [B][U]$plid[/U][/B] => $player)
console($player->PName);

and

foreach ($this->getHostState()->[B][U]clients[/U][/B] as [B][U]$ucid[/U][/B] => $client)
console($client->UName);

Thank you Dygear, now it is all working.
1
FGED GREDG RDFGDR GSFDG