Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 08-12-2010, 08:36 PM
xMane xMane is offline
NPC-Server (Server)
xMane's Avatar
Join Date: May 2010
Posts: 59
xMane is on a distinguished road
Quote:
Originally Posted by Deas_Voice View Post
ever heard of code styling? (if you haven't, google it!)

i doubt anyone would help you without you putting some effort in learning how to style your code.

PHP Code:
function exampleOfStyling() {
  if (
value == foo) {
    
doFoo();
  }
  else if (
value == bar) {
    if (
bar == 5) {
      
doBar();
    } else 
doBarTwo();
  }

it will also make your code much easier to read for others.
ahh! fine...
PHP Code:
function onPlayerChats(){
  if(
player.guild.starts("Events")){
    if(
player.chat="/setteams"){
      
players.remove(player.account);
      
playerscount-1;
      
player.chat=int((playerscount-1)/4)@"/"@playerscount-1;
      for (
i=0;i<playerscount-1;i++){
        if(!(
players[int(i)].guild.starts("Events"))){
          
players[int(i/12)].setlevel2("event_ttw-lobby.nw",23.5,30);
          
players[int(i/12)].guild "TTW Team 1";
          
players[int(i/8)].setlevel2("event_ttw-lobby.nw",44,30);
          
players[int(i/8)].guild "TTW Team 2";
          
players[int(i/4)].setlevel2("event_ttw-lobby.nw",23.5,44.5);
          
players[int(i/4)].guild "TTW Team 3";
          
players[int(i)].setlevel2("event_ttw-lobby.nw",44,44.5);
          
players[int(i)].guild "TTW Team 4";
        }
      }
    }
  }

Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:42 AM.


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