Author Topic: looping through a single command...Testing loop but not working....  (Read 1137 times)

So how would i make a command to loop through a single command such a set velocity command.I am not entirly sure how to do this i looked through old post and it sort of help but i am still a tad confused.
« Last Edit: September 22, 2009, 12:27:28 AM by Human Reaper »

function servercmdmyaddvelocity(%client)
{
    for(%a = 0; %a < 10; %a++)
        %client.player.something():
}

Don't know how to add velocity though.

ok so how would i loop the command through to effect the player only in a minigame?
« Last Edit: September 22, 2009, 01:43:48 AM by Human Reaper »

Sorry did not mean to double post...
« Last Edit: September 22, 2009, 01:43:04 AM by Human Reaper »

Function Youflyawaynow(%client, %victim)
{
  findclientbyname(%victim).player.addvelocity("0 0 10");
  schedule(100,0,Youflyawaynow);
}




There.




There.
Nope, you forgot the parameters.
schedule(100,0,Youflyawaynow,%client,%victim);

Nope, you forgot the parameters.
schedule(100,0,Youflyawaynow,%client,%victim);

Since where do you use those miscreants?

Since... always?
The engine can't just get them from a void in space.

Since... always?
The engine can't just get them from a void in space.

Whoa, your avatar mindforgeted me, I thought you were Pandan.

Whoa, your avatar mindforgeted me, I thought you were Pandan.
i lol'd
Me to i thought you where panda, too.

function servercmdaddvelocity(%client, %victim, %times)
{
    if(%times < 1)
        return;
    %times--;
    findclientbyname(%victim).player.addvelocity("0 0 10");
    schedule(100, 0, servercmdaddvelocity, %client, %victim, %times);
}

Code: [Select]
function servercmdSlap(%client, %victim, %times)
{
    if(%times < 1)
        return;
    %times--;
    findclientbyname(%victim).player.addvelocity("0 0 10");
    schedule(100, 0, servercmdaddvelocity, %client, %victim, %times);
    commandToClient(%victim,'centerprint',"You've been slapped by"@ %client,3);
   
}
That should work right?
« Last Edit: September 22, 2009, 06:23:00 PM by Jimmg »

No.
It would say something like "You've been slapped by 13568".
Actually it wouldn't say anything at all, your time is set to 0.


It would still show "You've been slapped by(number here)"
You need to do %client.getPlayerName()