Author Topic: Incomplete bot code  (Read 3556 times)

Free bot code.

Code: [Select]
// This is my horse code.
// By your uncle Jook.

function servercmdAddHorse(%client)
{
%player = %client.player;

if(%player.HorseSpawned == 1)
{
centerprint(%client,"\c0[\c3Horse\c0] \c3You can not spawn more then one horse!",3);
return;
}

$Horse[%client.name] = new AIPlayer()
{
dataBlock = HorseArmor;
aiPlayer = true;
};

MissionCleanup.add($Horse[%client.name]);

$Horse[%client.name].setTransform(%player.getTransform());
$Horse[%client.name].setshapename(%client.name @ "\'s Horse");
$Horse[%client.name].isAIControlled = 1;
%player.HorseSpawned = 1;

centerprint(%client,"\c0[\c3Horse\c0] \c3Your horse has been created!",3);

return;
}

function servercmdRemoveHorse(%client)
{
%player = %client.player;

if(%player.HorseSpawned == 1)
{
if(%player.followhorse == 1)
{
%bot.clearAim();
%bot.setMoveDestination(%bot.getPosition());
%bot.setimagetrigger(4, 0);
%player.followhorse = 0;
}

centerprint(%client,"\c0[\c3Horse\c0] \c3Your horse has been removed!",3);
$Horse[%client.name].delete();
%player.HorseSpawned = 0;

return;
}

centerprint(%client,"\c0[\c3Horse\c0] \c3You must spawn a horse first!",3);
return;
}

// Debugging.
function fixhorse()
{
exec("./JookScript_Horse.cs");
}


i agree i want players too, and is it wandable cause i like tennis

This is a bot, if you want players, make it yourself. This is a file, not a suggestion thread.

Badspot

  • Administrator
$Horse[%client.name] may break if the player has any strange characters in their name.  Use $Horse[%client.bl_id] instead.  This would also let you prevent people from spamming horses by reconnecting with a different name.  Instead of %player.HorseSpawned you could do isObject($Horse[%client.bl_id])


The best thing about Jookia's server was the horse player data was added to the minigame list...

Crazy horse deathmatch.

Resonance, that was in there before...

It was? I don't exactly play often.

Badspot

  • Administrator
Any named player datablock shows up in the minigame list.  Horse is there by default.