Author Topic: Does anyone know the args that are used in GameConnection::SpawnPlayer()?  (Read 1544 times)

I've been making an auto-load items function and I want to know how to use GameConnection::SpawnPlayer.

But when I do, it either says that the function is unknown or I don't spawn, is it just a different function that I should use?  I just want to know the args used in GameConnection::SpawnPlayer and/or if I should use a different function for what I want to make.
« Last Edit: September 27, 2012, 02:50:36 AM by tkepahama »

Code: [Select]
package Blah
{
function gameConnection::spawnPlayer(%client)
{
parent::spawnPlayer(%client);

//Do stuff here
}
};
activatePackage(Blah);

I already made an auto load items mod and it's waiting RTB approval.

Instead of giving them the tools, modify the minigame to give them the tools automatically. This stops that loud beep when they spawn.
Code: [Select]
function gameConnection::setDefaultTools(%client)
{
if(isObject($DefaultMinigame))
{
%count = getWordCount(%client.toolsList);
for(%a = 0; %a < %count; %a++)
{
%tool = getWord(%client.toolsList, %a);
if(isobject(%tool))
$DefaultMinigame.StartEquip[%a] = nametoID(%tool);
else
$DefaultMinigame.StartEquip[%a] = 0;
}
}
}
Modify the above code to work with a client-specific list of tools and modify the code to work with the default minigame, whatever you want it to be.
Code: [Select]
package SpawnTools
{
function gameConnection::spawnPlayer(%client)
{
%client.setDefaultTools();
parent::SpawnPlayer(%client);
}
};
activatePackage(SpawnTools);

What if every player gets something different?

What if every player gets something different?
That's exactly what it's for.

Oh, right, I just skimmed over the code sorry about that

Or, you know


Code: (Yes, this is code.) [Select]
messageClient(%cl, 'MsgItemPickup', '', %slot, %item, %silent);

Or, you know


Code: (Yes, this is code.) [Select]
messageClient(%cl, 'MsgItemPickup', '', %slot, %item, %silent);
That works too.