Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   help, proof reading needed. (https://forums.graalonline.com/forums/showthread.php?t=134268321)

khortez 06-14-2013 01:35 AM

help, proof reading needed.
 
PHP Code:

findplayer("khortez").addweapon(this.name);

function 
onActionServerSide(){

if(
params[0] == "warp"){
 
 
temp.pl player;
 
temp.warped findplayerbycommunityname(params[1]);
 
}

if(
temp.warped != NULL){
temp.pl temp.pl.setlevel2(temp.warped.leveltemp.warped.xtemp.warped.y);
 }
  
 
 else {
 
temp.pl.chat "Can't find"SPC params[1];
 }
  }
 
 
 
 
 
//#CLIENTSIDE
 
function onPlayerChats(){
 if(
player.chat.starts("/warp")){
 
  
triggerserver("gui"this.name"warp"player.chat.substring(5));
 }
  } 

I've been trying to get this to work, and for some reason it's not. can anyone tell me what i'm doing wrong?

any additional helpful comments on how to make my scripts better is appreciated. thanks

fowlplay4 06-14-2013 01:59 AM

Style your **** mother****er.

You have mother****ing spaces in front of //#CLIENTSIDE and spaces after the ****ing declaration jesus ****ing christ.

Also what the mother**** are you expecting setlevel2 to return? that doesnt return a mother****ing value at all.

Use findplayer2 instead mother****er, it works with both accounts and mother****ing community names.

PHP Code:

function onActionServerSide() {
  if (
params[0] == "warp") {
    
temp.pl player;
    
temp.warped findplayer2(params[1]);
    if (
temp.warped != NULL) {
      
temp.pl.setlevel2(temp.warped.leveltemp.warped.xtemp.warped.y);
    } else {
      
temp.pl.chat "Can't find" SPC params[1];
    }
  }
}

//#CLIENTSIDE

function onPlayerChats() {
  if (
player.chat.starts("/warp")) {
    
triggerserver("gui"this.name"warp"player.chat.substring(5));
  }


use my mother****ing website http://www.fp4.ca/gs2beautifier/

Fulg0reSama 06-14-2013 02:03 AM

Quote:

Originally Posted by fowlplay4 (Post 1719222)
Style your **** mother****er.

You have mother****ing spaces in front of //#CLIENTSIDE and spaces after the ****ing declaration jesus ****ing christ.

The mother****ing script is fine other than mother****ing detail. ****.

Use findplayer2 instead mother****er, it works with both accounts and mother****ing community names.

use my mother****ing website http://www.fp4.ca/gs2beautifier/

It's okay Jerret, just follow the anger management advice you were given.


khortez 06-14-2013 02:04 AM

lol, sorry. it's been awhile for me

fowlplay4 06-14-2013 02:17 AM

http://i.imgur.com/5b6xNrF.jpg

-- harsh perhaps, but u annoy me.

Fulg0reSama 06-14-2013 05:40 AM

Quote:

Originally Posted by fowlplay4 (Post 1719225)
Hilarious Outburst

You could've just said "Style your code, It would be better if you would use this instead of this and this isn't even returning a value, also you could use this tool to style your code for you."

Instead we get a Chris Farley/Matt Foley moment.

But alright, ignore away! You already had me on the list when you made that obnoxious image, so prove your immaturity.
I apologize to the OP for the stupid scene made here this evening.

cbk1994 06-14-2013 05:58 AM

Quote:

Originally Posted by fowlplay4 (Post 1719222)
PHP Code:

    temp.pl player;
    
temp.warped findplayer2(params[1]);
    if (
temp.warped != NULL) {
      
temp.pl.setlevel2(temp.warped.leveltemp.warped.xtemp.warped.y);
    } else {
      
temp.pl.chat "Can't find" SPC params[1];
    }
  } 


Also, there's no reason to store the player object in a temporary variable—it's just confusing to anybody reading the script (as are the variable names you (khortez) used). The current player will remain in scope.

PHP Code:

    temp.pl findplayer2(params[1]);
    if (
temp.pl != NULL) {
      
player.setlevel2(temp.pl.leveltemp.pl.xtemp.pl.y);
    } else {
      
player.chat "Can't find" SPC params[1];
    }
  } 


Felix_Xenophobe 06-14-2013 06:55 AM

jerret is my hero

Draenin 06-14-2013 07:59 AM

Quote:

Originally Posted by fowlplay4 (Post 1719222)
Style your **** mother****er.

You have mother****ing spaces in front of //#CLIENTSIDE and spaces after the ****ing declaration jesus ****ing christ.

Also what the mother**** are you expecting setlevel2 to return? that doesnt return a mother****ing value at all.

Use findplayer2 instead mother****er, it works with both accounts and mother****ing community names.

use my mother****ing website http://www.fp4.ca/gs2beautifier/

http://replygif.net/i/770

Cubical 06-14-2013 11:00 AM

im glad i woke up to this

Tim_Rocks 06-14-2013 01:23 PM

Quote:

Originally Posted by fowlplay4 (Post 1719222)
Style your **** mother****er.

You have mother****ing spaces in front of //#CLIENTSIDE and spaces after the ****ing declaration jesus ****ing christ.

Also what the mother**** are you expecting setlevel2 to return? that doesnt return a mother****ing value at all.

Use findplayer2 instead mother****er, it works with both accounts and mother****ing community names.

PHP Code:

function onActionServerSide() {
  if (
params[0] == "warp") {
    
temp.pl player;
    
temp.warped findplayer2(params[1]);
    if (
temp.warped != NULL) {
      
temp.pl.setlevel2(temp.warped.leveltemp.warped.xtemp.warped.y);
    } else {
      
temp.pl.chat "Can't find" SPC params[1];
    }
  }
}

//#CLIENTSIDE

function onPlayerChats() {
  if (
player.chat.starts("/warp")) {
    
triggerserver("gui"this.name"warp"player.chat.substring(5));
  }


use my mother****ing website http://www.fp4.ca/gs2beautifier/

:)

fowlplay4 06-14-2013 01:59 PM

Quote:

Originally Posted by cbk1994 (Post 1719227)
Also, there's no reason to store the player object in a temporary variable—it's just confusing to anybody reading the script (as are the variable names you (khortez) used). The current player will remain in scope.

PHP Code:

    temp.pl findplayer2(params[1]);
    if (
temp.pl != NULL) {
      
player.setlevel2(temp.pl.leveltemp.pl.xtemp.pl.y);
    } else {
      
player.chat "Can't find" SPC params[1];
    }
  } 


The only reason I would do wat OP did (temp.pl = player;) is if you're messing with offline TServerPlayer objects, as they cause the player object to go NULL.

I.e.

PHP Code:

temp.pl player;
temp.acct player.account;
temp.op = new TServerPlayer(@temp.acct);
echo(
temp.op.account == player.account); // should echo "0"
temp.op.destroy(); 


khortez 06-14-2013 02:39 PM

Quote:

Originally Posted by cbk1994 (Post 1719227)
Also, there's no reason to store the player object in a temporary variable—it's just confusing to anybody reading the script (as are the variable names you (khortez) used). The current player will remain in scope.

PHP Code:

    temp.pl findplayer2(params[1]);
    if (
temp.pl != NULL) {
      
player.setlevel2(temp.pl.leveltemp.pl.xtemp.pl.y);
    } else {
      
player.chat "Can't find" SPC params[1];
    }
  } 


i'll try it that way instead then, thanks. i just always felt like i had to define
something like that in a variable

cbk1994 06-14-2013 07:06 PM

Quote:

Originally Posted by khortez (Post 1719242)
i'll try it that way instead then, thanks. i just always felt like i had to define
something like that in a variable

player is already a variable.


All times are GMT +2. The time now is 04:34 AM.

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