In my view:
function servercmdSlap(%client, %victim, %repeats, %force)
{
if(%repeats < 1)
return;
%repeats--;
findclientbyname(%victim).player.addvelocity("0 0 "@%force@");
schedule(100, 0, servercmdaddvelocity, %client, %victim, %repeats, %force);
commandToClient(%victim,'centerprint',"You've been slapped by"@ %client.name,3);
}
Should add /slap NameToSlap HowManyTimesToSlap ForceToGoUp
Screw at 1 line version i don't think works:
function servercmdSlap(%client, %victim, %repeats, %force){ if(%repeats < 1) { return; } %repeats--; findClientByName(%victim).player.addVelocity("0 0 "@%force@"); schedule(100, 0, servercmdaddvelocity, %client, %victim, %repeats, %force); commandToClient(%victim, centerprint,"You've been slapped by "@%client.name@"!"); }
Please notice that i just tried the above 1 line code for fun, and I don't think it works.
1 thing, it's too large for the console anyway ^_^