PDA

View Full Version : Teams?


theHAWKER
03-18-2007, 01:46 AM
In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
if (playerchats){
if (startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}
}

could somone get me started plz?

cbk1994
03-18-2007, 02:02 AM
In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
if (playerchats){
if (startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}
}

could somone get me started plz?

Sure.

function onPlayerChats()
{
if ( player.guild.starts( "Events Team" )
{
if ( player.chat == "/teams" )
{
sortPlayersIntoTeams();
}
}
}


There you go :)

godofwarares
03-18-2007, 02:09 AM
Sure.

function onPlayerChats()
{
if ( player.guild.starts( "Events Team" )
{
if ( player.chat == "/teams" )
{
sortPlayersIntoTeams();
}
}
}


There you go :)

Thats not what he meant, Nor did he want it in GS2.


I'd suggest you use a loop through all the players in the level, similar to:

for (i = 0; i < playerscount; i++)
{
with (players[i])
{
if (!(i%2)) // Team 1
{
setstring this.team,"Red";
} else { // Team 2
setstring this.team,"Blue";
}
}
}

killerogue
03-18-2007, 02:14 AM
In an event i want to sort people into teams, but i don't even know how to start the script x.x this is how far i got:
if (playerchats){
if (startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}
}

could somone get me started plz?


EEW GS1!!! Dude, Gs2 is better than GS1, on top of that it's easier to use and is object based making things 1 thousand times easier in my opinion. :o

cbk1994
03-18-2007, 02:14 AM
I'll make one for you, is GS2 okay? There's no way I'm going to script in GS1

Crow
03-18-2007, 02:16 AM
Well I would set a guild tag right away ;o

for (i = 0; i < playerscount; i++) {
with (players[i]) {
if (!(i%2)) // Team 1
player.guild = "Team Red";
else // Team 2
player.guild = "Team Blue";
}
}
}

cbk1994
03-18-2007, 02:19 AM
EEW GS1!!! Dude, Gs2 is better than GS1, on top of that it's easier to use and is object based making things 1 thousand times easier in my opinion. :o

I second that.

As I've always said, compare these ...

GS1

setstring serverr.blah,strtofloat(#s(serverr.blah))+strtoflo at(#t(1));


vs.

GS2

serverr.blah += tokens[1];


You decide

godofwarares
03-18-2007, 02:22 AM
Who cares if its GS1!
Apparently he's making it in GraalEditor (I'm not sure though), so cut him some slack. He may just be learning -_-


But I agree -- GS2 > GS1.


-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".

cbk1994
03-18-2007, 02:34 AM
Who cares if its GS1!
Apparently he's making it in GraalEditor (I'm not sure though), so cut him some slack. He may just be learning -_-


But I agree -- GS2 > GS1.


-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".

No one is yelling at him. I'm simply refusing to script in GS1. I hate it. It gives me headaches ;)

killerogue
03-18-2007, 02:38 AM
-Edit: Stan, I believe the phrase you're looking for is "Object Oriented Programming".

It's really all the same meaning. ;)

Crow
03-18-2007, 02:59 AM
No one is yelling at him. I'm simply refusing to script in GS1. I hate it. It gives me headaches ;)

Which is proving that you dont really understand it. Pwnt.

napo_p2p
03-18-2007, 03:27 AM
GS1

setstring serverr.blah,strtofloat(#s(serverr.blah))+strtoflo at(#t(1));



setstring serverr.blah,#v(strtofloat(#s(serverr.blah))+strto float(#t(1)));


:asleep:

cbk1994
03-18-2007, 02:16 PM
Okay, I can't see any reason why you would make this on the editor, since you are the only player, and as far as I remember 'with' functions require an NPC-Server. If you are making it online, there's no reason why GS2 shouldn't work.

godofwarares
03-18-2007, 02:59 PM
Okay, I can't see any reason why you would make this on the editor, since you are the only player, and as far as I remember 'with' functions require an NPC-Server. If you are making it online, there's no reason why GS2 shouldn't work.

Could be Unholy Nation :p

theHAWKER
03-19-2007, 04:19 AM
T.T im using this for a server, i dont know how to know GS2 cause theres no tutorial or anything.... and i just want a team sorter plz?

godofwarares
03-19-2007, 12:27 PM
Yes there's a tutorial on GS2 . . .
Go to WiKi
http://wiki.graal.net

P.S: You wouldn't happen to be working for Horizon, Would you?

Chompy
03-19-2007, 04:13 PM
T.T im using this for a server, i dont know how to know GS2 cause theres no tutorial or anything.... and i just want a team sorter plz?

Use the wiki, and also, it's against the rules to ask for scripts, it's ok asking for guidance, but it's not ok to ask for complete scripts, in that way you'll never learn..

theHAWKER
03-19-2007, 10:30 PM
P.S: You wouldn't happen to be working for Horizon, Would you?

umm no im not, and thx for the link :D

godofwarares
03-19-2007, 10:44 PM
umm no im not, and thx for the link :D

No problem.

Angel_Light
03-19-2007, 11:35 PM
that way you'll never learn..

I disagree with this, the way I pretty much learned GS1 was by playing around wiih some of these really complex scripts by messing around with vars, changing number, etc...

Chompy
03-20-2007, 03:39 PM
I disagree with this, the way I pretty much learned GS1 was by playing around wiih some of these really complex scripts by messing around with vars, changing number, etc...

depends on how complicated the code is I would say..

Skyld
03-20-2007, 03:41 PM
I disagree with this, the way I pretty much learned GS1 was by playing around wiih some of these really complex scripts by messing around with vars, changing number, etc...
And in doing so, you will pick up the bad habits of the scripters who wrote the scripts you are editing. It's better to be helped but also left to think for yourself, rather than just being given complete scripts and being told to figure it out. That's the practice we try to work on in these forums.