Also
function serverCmdgiveGold(%client, %Gold, %name)
{
%Gold = mFloor(%Gold);
if(%Gold > 0)
{
if((%client.Roleplay["Gold"] - %Gold) >= 0)
{
if(isObject(%client.player))
{
if(%name != "")
{
%target = findclientbyname(%name);
}
else
{
%target = containerRayCast(%client.player.getEyePoint(), vectorAdd(vectorScale(vectorNormalize(%client.player.getEyeVector()), 5), %client.player.getEyePoint()), $typeMasks::playerObjectType,%client.player).client;
}
if(isObject(%target))
{
messageClient(%client, '', "\c6You give \c3$" @ %money SPC "\c6to \c3" @ %target.name @ "\c6.");
messageClient(%target, '', "\c3" @ %client.name SPC "\c6has given you \c3$" @ %money @ "\c6.");
%client.Roleplay["Gold"] -= %Gold;
%target.Roleplay["Gold"] += %Gold;
}
else
messageClient(%client, '', "\c6You must be looking at and be in a reasonable distance of the player in order to give them money. \nYou can also type in the person's name after the amount.");
}
else
messageClient(%client, '', "\c6Spawn first before you use this command.");
}
else
messageClient(%client, '', "\c6You don't have that much gold to give.");
}
else
messageClient(%client, '', "\c6You must enter a valid amount of gold to give.");
}
String evaluates to 0 on the line with
if(%name != "")