Author Topic: How did you learn coding?  (Read 3655 times)

Yeah that's what I mean, the whole thing is read and played instantly.

How would you Time the deaths though? Like it progressively kills one person after another every 3 seconds?

Code: [Select]
function killEverybody(%start){
%start = %start ? %start : 0; // if %start isn't defined, use 0
%player = ClientGroup.getObject(%start).player; // get the player at position %start in ClientGroup
if(isObject(%player)) // if the player exists (is spawned)
%player.kill(); // kill them
%start++; // increment start
if(ClientGroup.getCount() > %start) // if there are more people left
schedule(3000, 0, "killEverybody", %start); // schedule this function to be called again in 3 seconds with the new %start value
}

Why are we using Kill scripts to show we can read code?

Not only that, that code is open to code overlap...

Code: [Select]
function killEverybody(%start){
%start = %start ? %start : 0; // if %start isn't defined, use 0
%player = ClientGroup.getObject(%start).player; // get the player at position %start in ClientGroup
if(isObject(%player)) // if the player exists (is spawned)
%player.kill(); // kill them
%start++; // increment start
if(ClientGroup.getCount() > %start) // if there are more people left
schedule(3000, 0, "killEverybody", %start); // schedule this function to be called again in 3 seconds with the new %start value
}
Ah ok, I think I understand most of the bits, although I'm not sure about the 0 in schedule(3000, 0, ...);

The Arguments always confuse me, especially in weapon scripts where they get %this,%obj,%slot,%otherstuff,...

Not only that, that code is open to code overlap...
So it doesn't work? I think that might have been intentional

It works, but it can be done a bunch of times, maybe by accident, and be annoying. Even if they're still dead, I think it'd be annoying, but I'd say...

I give this script 1 thumb up

In my mind, if I see the code:
Code: [Select]
for(%i=0;%i<clientgroup.getcount();%i++) {
clientgroup.getobject(%i).player.kill();
}
I see:
Code: [Select]
%i is 0, while %i is less than the full clientcount continue, each cycle add 1 to %i.
Kill client in place of object by number.

Of course, it's much less then all that, but to say it exactly as my mind puts it would be confusing to you...

Code: [Select]
%i equals 0. %i less than count. add 1 %1
kill all

Lol
you read it like english too? God me, nixill you. Who else can read it like reading a book?
I can.
Code: [Select]
//Stuff -This stuff is like invisible to me.
function serverCmdHelp(%client,%word)  -We've created or overwritten a function called serverCmdHelp, which can be accessed through a client sided code to simply type /help %word.
{  -One open
switch$ (%word)  -Picking an option of what to do with a variable. Kind of like a whole bunch of else ifs
{   -Two Open
case "RPG":    -If %word is RPG. Which would be /help RPG
messageclient(%client,'',"-Generic help stuff here i dont feel like writing out."); -This is like the server telling one client something, the var %client can either be set by the server, or the client can call this command and have %client set to themself.
default: -If %word is anything else.
messageclient(%client,'',"Help topics: RPG\nTry /help Keyword"); -As above.
} -One open.
} -Function closed.

I don't read it like that, I read it as sentence fragments. I don't read everything either.

i bet if you were a girl you could whore yourself to a scripter and learn from then after

I bet if you would stfu I wouldn't have to call you a bitch for saying girls can't script