The online racing simulator
Searching in All forums
(37 results)
2
Megin
S2 licensed
So, i have this:


<?php 
php
require 'lfsworldsdk.php'
$SDK = new LFSWorldSDK('idkey goes here'); 
function 
triedicka($SDK$track$car$racers) { 
    
$chart $SDK->get_ch(array($track), array($car)); 
    
$ret   = array(); 
    foreach (
$chart[$track][$car] as $key => $item) { 
    if (
in_array($item['racername'], $racers)) { 
            
$ret[]  = $item
            
$sort[] = $item['time']; 
        } 
    } 
     
    
array_multisort($sortSORT_ASC$ret); 
    return 
$ret

$driversfxo = array(       
 
'Atti Honyi (SK)',          
 
'Megin'
);
$table1 triedicka($SDK'000''FXO'$driversfxo);

$driversrb4 = array(
              
'Sisolak',
              
'eraser_svk'
);
sleep(5);
$table2 triedicka($SDK'000''RB4'$driversrb4);
$driversxrt = array(
                
'Ghost_CZ',
                
'BIGMAN'
); 
sleep(5);
$table3 triedicka($SDK'000''XRT'$driversxrt);
$all array_merge($table1$table2$table3);
 
//--------------- how sort $all ?
 
echo "<BR>FXO:<br/>";
foreach (
$table1 as $p1 => $driver1) {
                echo (
$p 1), '. '$driver1['racername'],' - '$driver1['time'], '<br/>'PHP_EOL;
}
echo 
"<BR>RB4:<br/>";            
foreach (
$table2 as $p2 => $driver2) {
                echo (
$p 1), '. '$driver2['racername'],' - '$driver2['time'], '<br/>'PHP_EOL;
}
echo 
"<BR>XRT:<br/>";                
foreach (
$table3 as $p3 => $driver3) {
                echo (
$p 1), '. '$driver3['racername'],' - '$driver3['time'], '<br/>'PHP_EOL;
}
echo 
"<BR>ALL:<br/>";
foreach (
$all as $p => $driver) {
                echo (
$p 1), '. '$driver['racername'],' - '$driver['time'], '<br/>'PHP_EOL;
}
 
?>

U can see that $all is undorted. ($all is join array of arrays of drivers with xrt, rb4 and xrt) How to sort $all? Probably i have to create new function like function tiedicka. I try it but failed :-(

Dygear: sorry but your cleaned code in sort function din't work as well :-(
Last edited by Megin, .
Megin
S2 licensed
I try something like that but it didn't work, some modifing of my example will be useful
Megin
S2 licensed
Hello, i'm back with another problem. this is example:


<?php 
php
require 'lfsworldsdk.php'
$SDK = new LFSWorldSDK('idkey goes here'); 
function 
some_function_name($SDK$track$car$racers) { 
    
$chart $SDK->get_ch(array($track), array($car)); 
    
$ret   = array(); 
     
    foreach (
$chart[$track][$car] as $key => $item) { 
        if (
in_array($item['racername'], $racers)) { 
            
$ret[]  = $item
            
$sort[] = $item['time']; 
        } 
    } 
     
    
array_multisort($sortSORT_ASC$ret); 
    return 
$ret


$drivers = array('Megin'
                
'BIGMAN'
                
'eraser_svk'    
                
);
                 
               
$table some_function_name($SDK'000''RB4'$drivers);
foreach (
$table as $p => $driver
    echo (
$p 1), '. '$driver['racername'], '<br />'PHP_EOL;
  
 
?>

it make order by hotlaps, on BL1 with RB4 but i don't know how i can add for drivers specific car (TBO class)
Megin - FXO
BIGMAN - RB4
eraser_svk - RB4
and make order with this specific combos

Could u correct this example? Thanx a lot
Megin
S2 licensed
Stats works perfectly, thx for your work, but i have one question.
In LFS Stats before patch X (LFS stats! v1148), there was oportunity to add not only Lap by lap Graph and Race time progress but also Lap Times of drivers generated by Graph aplication.
So if u have some time, could u add this feature againt to the program? It will be great!

ThX a lot
Megin
S2 licensed
Quote from Gai-Luron :New version: 0.91

THX, works perfect now. SUPREME JOB
Megin
S2 licensed
Hello, i start use your program and i get nice statistics of one demo race , but when i try run a qualification it shows error like few post above. I try another division and happend the same. Race was OK, but quali didn't work and here is that error and one of mpr of quali too:

BTW - that error shows when thre first racer cross finish line in lap 3
Megin
S2 licensed
Thank u guys a lot , it finaly works .
Now i try modify that myself - add there time of drivers and divide them to division (when i pick up more drivers). So i hope it will be without big problems, if not.... i ask here, becouse PRO like U always know....
Megin
S2 licensed
Ok, i see.... i left in lfsworldsdk.php only this (from print part of script): print_r($SDK->get_ch(array('621'), array('XFR')));

http://www.komora.sk/lfs/lfsworldsdk.php

It print array with hotlaps from combo AS National Revision - XFR. I think that i need another php script to pick up certain racers from that list. Could u please explain me, or better give me an expample how i pick up for example me: Megin and another one: Ondrejko from that list of hotlaps?That will be wery useful for me
Megin
S2 licensed
I put your lfsworldsdk.php at another web: http://www.komora.sk/lfs/lfsworldsdk.php

Could u check it? I'm not sure if it works properly? I was thinking, that it pick up and show only hotlap from Dygear and filur, but it shows quite big list of... many parameters....
Megin
S2 licensed
Quote from Dygear :Download this one.. (Ver 1.5). If you need any more help just post here.

Thanx a lot for that, i place it on my website and i tried it, but i have some problems... i write u PM, because in errors it shows my IDK.
Megin
S2 licensed
Hello,
i don't know if i'm at the right place, but i ask u:

I want to make website for spliting racers into divisions by hotlaps from LFSWorld. I find Live for Speed Pubstats S2 v1.3 i can get chart of hotlaps for track and car.
But i don't know how to pick some racers and divide them to 2 or more divisions? I think that i have to use your php script, but i don't know how. Coud u give me some advices? Thank u very much for answers.

Edit: i read something about it and i know that i have to place on web LFSWorldSDK.php from post #1 and than i have to create another php file with that script what i want. Am i right?
Last edited by Megin, .
Megin
S2 licensed
XFG/XRG on BL/BL rev - becouse i'm still begginer
2
FGED GREDG RDFGDR GSFDG