Author Topic: Can someone convert these console commands into scripts for me?  (Read 2858 times)

Hey,
so all I want is for someone to make these console commands into scripts where you can do /commandhere

Code: [Select]
$Pref::Server::MMDumpsterLoc = findclientbyname("Setro").getcontrolobject().getposition();^ this should be /setdumpster
Code: [Select]
$Pref::Server::MMArenaLoc = findclientbyname("Setro").getcontrolobject().getposition();^ this should be /setarena
Code: [Select]
$Pref::Server::MMAfterlifeLoc = findclientbyname("Setro").getcontrolobject().getposition(); ^ and this should be /setafterlife

Yes, this is for ease of mafia madness hosting. Thanks.
« Last Edit: June 09, 2014, 05:48:28 PM by xSetrox »

you literally only have to do this once for your server

for the first one
Code: [Select]
function serverCmdsetdumpster(%client)
{
$Pref::Server::MMDumpsterLoc = findclientbyname("Setro").getcontrolobject().getposition();
}
you should be able to figure out the rest from that
might be better to add a check if you're the one calling the command and/or if you even exist when the command is being called
%client is the client calling the command

I think that BL saves all $Pref::Server stuff, so you
you literally only have to do this once for your server
But anyways,


function serverCmdsetMMStuff(%client)
{
    %obj = findClientbyName("Setro").getControlObject().getPosition();
    $Pref::Server::MMDumpsterLoc = %obj;
    $Pref::Server::MMArenaLoc = %obj;
    $Pref::Server::AfterLifeLoc = %obj;
}

But if you wanted to set each of them separately, you would want to do it phflack's way.



how would i add a check
is this correct:
Code: [Select]
function serverCmdsetdumpster(%client)
{
if %client.BL_ID = 43991
$Pref::Server::MMDumpsterLoc = findclientbyname("Setro").getcontrolobject().getposition();

}

how would i add a check
is this correct:
Code: [Select]
function serverCmdsetdumpster(%client)
{
if %client.BL_ID = 43991
$Pref::Server::MMDumpsterLoc = findclientbyname("Setro").getcontrolobject().getposition();

}

Very close :D

if(%client.getBLID() $= 43991)


%client.bl_id works too.


Didn't know that!
/sarcasm
I was only saying that for setro considering he used it in his code originally, then you switched it to some longer .getBLID() crap. There's honestly no reason to be a jerk about it.

I was only saying that for setro considering he used it in his code originally, then you switched it to some longer .getBLID() crap. There's honestly no reason to be a jerk about it.
%client.bl_id is just a field that you can change with torkscript. %client.getblid() is an engine method and guaranteed to always return the blid.

some longer .getBLID() crap.
How is it longer
and how is it crap?

How is it longer
and how is it crap?
I think he means longer because of the number of characters.

%client.bl_id is just a field that you can change with torkscript. %client.getblid() is an engine method and guaranteed to always return the blid.

Can't actually change the .bl_id field on a GameConnection object. Or on a Player object, if I remember correctly. You can change it on an AIPlayer object, though.

Can't actually change the .bl_id field on a GameConnection object. Or on a Player object, if I remember correctly. You can change it on an AIPlayer object, though.
Hmm, seems you can't change it, yeah.