Author Topic: Weapon Name  (Read 1214 times)

What console command can I use to figure out what weapon a player has in their inventory.
Findclientbyname("Air").___________________

Why not just listClients(); then just use the object number then objectnumberhere.dump(); then just finding what you can see that might work?

Why not just listClients(); then just use the object number then objectnumberhere.dump(); then just finding what you can see that might work?
I'm looking for more of a quick Console Command so I can finnish a script...

Why not just listClients(); then just use the object number then objectnumberhere.dump(); then just finding what you can see that might work?
that sounds like the most inefficient way possible

%client.player.tool[slot]

%client.player.currTool

Code: [Select]
function serverCmdWhatchugot(%client, %name)
{
%target = findClientByName(%name);

if(!isObject(%target))
{
messageClient(%client, '', "Specified client does not exist.");
return;
}

%obj = %target.player;

if(!isObject(%obj))
{
messageClient(%client, '', "\c3" @ %target.name @ "\c0 has not spawned.");
return;
}

%tool = %obj.tool[%obj.currTool];

if(!isObject(%tool))
{
messageClient(%client, '', "\c3" @ %target.name @ "\c0 is not holding anything.");
return;
}

messageClient(%client, '', "\c3" @ %target.name @ "\c6 is wielding a \c3" @ %tool.uiName @ "\c6!");
}

If you want a specific slot:
Code: [Select]
%Client.player.tool[slot].uiNameor replace tool[slot] with currtool to get the tool their holding.

Why do people always do this?:
Code: [Select]
%obj = %target.player;

if ( !isObject( %obj ) )
{
    // do stuff
}

Why not just do this instead?:
Code: [Select]
if ( !isObject( %obj = %target.player ) )
{
     // do stuff
}

Because I'm not a neanderthal and I like my code to be legible.

Why do people always do this?:
Why does it matter? Also, what Kalphiter said.

Why does it matter? Also, what Kalphiter said.
did you just call me kalphiter

did you just call me kalphiter

Congratulations Iban, you are the new Kalphiter.



Says the one putting ugly spaces inbetween his parenthesis.
Agree. Hate when people do that.