Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Old Scripting Engine (GS1) (https://forums.graalonline.com/forums/forumdisplay.php?f=154)
-   -   Teams? (https://forums.graalonline.com/forums/showthread.php?t=72900)

theHAWKER 03-18-2007 01:46 AM

Teams?
 
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:
PHP Code:

if (playerchats){
if (
startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}


could somone get me started plz?

cbk1994 03-18-2007 02:02 AM

Quote:

Originally Posted by theHAWKER (Post 1289804)
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:
PHP Code:

if (playerchats){
if (
startswith(#g,Events Team)){
if (strequals(#c,/teams)){
}
}


could somone get me started plz?

Sure.
PHP Code:

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


There you go :)

godofwarares 03-18-2007 02:09 AM

Quote:

Originally Posted by cbkbud (Post 1289814)
Sure.
PHP Code:

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:
PHP Code:

for (0playerscounti++)
{
     
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

Quote:

Originally Posted by theHAWKER (Post 1289804)
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:
PHP Code:

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

PHP Code:

for (0playerscounti++) {
  
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

Quote:

Originally Posted by killerogue (Post 1289818)
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
PHP Code:

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

vs.

GS2
PHP Code:

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

Quote:

Originally Posted by godofwarares (Post 1289823)
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

Quote:

Originally Posted by godofwarares (Post 1289823)
-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

Quote:

Originally Posted by cbkbud (Post 1289829)
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

Quote:

Originally Posted by cbkbud (Post 1289822)
GS1
PHP Code:

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


PHP Code:

setstring serverr.blah,#v(strtofloat(#s(serverr.blah))+strtofloat(#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

Quote:

Originally Posted by cbkbud (Post 1289966)
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?


All times are GMT +2. The time now is 12:33 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.