Well I ran into a problem.
First off, when I use /smoke it does toggle between the messages
Problem #1: It shows %name SPC you are now smoking.
Not
Yola you are now smoking.
Problem #2: Smoking never happens.
I'm off to bed for now, maybe you'll leave me some helpful info in the morning.
Script as of now:
function serverCmdSmoke(%client)
{
switch($smoketoggle)
{
case true:
$smoketoggle = false;
SmokeLoop(1);
%name = $Pref::Player::NetName;
messageClient(%client,'',"\c6%name SPC you are now smoking");
case false:
$smoketoggle = true;
SmokeLoop(0);
%name = $Pref::Player::NetName;
messageClient(%client,'',"\c6%name SPC you are done smoking");
}
}
function Smoke(%client)
{
serverplay3d(Smokingsound,%client.player.getHackPosition() SPC "0 0 1 0");
echo(%client.name @ " smoke");
%client.player.setWhiteout(0.5);
%client.player.emote(DrugsmokeImage);
}
function SmokeLoop(%on)
{
cancel($SmokeSchedule);
if(!%on)
return;
Smoke(1);
%time = getrandom(1000,2000);
$SmokeSchedule = schedule(%time, 0, SmokeLoop, 1);
}