The online racing simulator
#1 - Racon
JustBots - prevent human players from joining track, allow AI
Quick & dirty script to prevent all human players from joining the track to help manage with AI-only events - it will also spectate any human players already on track when the script starts up.

Just add host IP, port and password to the settings and you're good to go.


<?php

function PIE_settings()
{
return array('host' => '',
'port' => '',
'adminpass' => '',
'flags' => ISF_REQ_JOIN,
'insimname' => 'JustBots');
}

function PIE_NPL($data)
{
// is it a bot?
$ai = $data['PType'] & 2;

// join request?
if ($data['NumP'] == 0)
{
// JRR reply
$jrr = array( 'Type' => ISP_JRR,
'PLID' => 0, // reply
'UCID' => $data['UCID'],
'JRRAction' => $ai ? JRR_SPAWN : JRR_REJECT);
PIE_sendpacket($jrr);
return;
}

// actual joins:
if ($ai)
return;

// cleans current non-bots on startup
PIE_say('/spec '.$data['PName']);
}


Attached files
justbots.zip - 551 B - 3 views
Skynet takes over LFS

FGED GREDG RDFGDR GSFDG