The online racing simulator
IS_CON
(2 posts, started )
#1 - Racon
Quote from donatas.s :

<?php 
$C 
$this->getClientByPLID($CON->PLID);
?>


PLID isn't a property of CON (the packet), it's a property of CON->A and CON->B (the two carContact structures inside the packet).

Quote from donatas.s :

<?php 
    
$this
->SoundMessageToAllPlayers("Car contact: ".$CON->A($C->PName)." and ".$CON->B($C->PName));
?>


If PRISM sets up the object as I would guess it does, you should be able to remove the '$C=...' line, and then replace the above line with the following:

<?php 
$playerA 
$this->getClientByPLID($CON->A->PLID);
$playerB $this->getClientByPLID($CON->B->PLID);
$this->SoundMessageToAllPlayers("Car contact: ".$playerA->PName." and ".$playerB->PName);
?>

-
(donatas.s) DELETED by donatas.s
-
(donatas.s) DELETED by Dygear : Double Post
-
(donatas.s) DELETED by donatas.s
#2 - Racon
Happy to help Smile

CON->spClose is the speed of the contact between the two cars, not the speed of the cars themselves (which are A->Speed and B->Speed).

Two cars could be driving side by side at 100mph for instance, and just lightly touch as they do so. In that case both car speeds would be 100mph, but the closing speed would be something tiny like 1mph - it would be the speed the cars were moving towards each other, regardless of the speed they're going forwards.

Or one car driving at 100mph rear-ends a car driving in the same direction at 80mph - the closing speed would be 20mph.

Or two cars driving head head-on into each other at 30mph each, spClose would be 60mph.

IS_CON
(2 posts, started )
FGED GREDG RDFGDR GSFDG