Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-14-2013, 01:35 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
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
Reply With Quote
  #2  
Old 06-14-2013, 01:59 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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/
__________________
Quote:
Reply With Quote
  #3  
Old 06-14-2013, 02:03 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by fowlplay4 View Post
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.

__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #4  
Old 06-14-2013, 02:04 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
lol, sorry. it's been awhile for me
Reply With Quote
  #5  
Old 06-14-2013, 02:17 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute


-- harsh perhaps, but u annoy me.
__________________
Quote:

Last edited by fowlplay4; 06-14-2013 at 02:00 PM..
Reply With Quote
  #6  
Old 06-14-2013, 05:40 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by fowlplay4 View Post
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.
__________________

Careful, thoughts and opinions here scare people.

Last edited by Fulg0reSama; 06-14-2013 at 08:10 AM..
Reply With Quote
  #7  
Old 06-14-2013, 05:58 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by fowlplay4 View Post
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];
    }
  } 
__________________

Last edited by cbk1994; 06-14-2013 at 07:42 AM..
Reply With Quote
  #8  
Old 06-14-2013, 06:55 AM
Felix_Xenophobe Felix_Xenophobe is offline
iphone era sad litle mads
Felix_Xenophobe's Avatar
Join Date: May 2005
Location: punchin yer nuts iphone era
Posts: 1,810
Felix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to beholdFelix_Xenophobe is a splendid one to behold
Send a message via MSN to Felix_Xenophobe
jerret is my hero
__________________
KARTRACE
REIGNING CHAMPION
Quote:
Originally Posted by Tashkin
I have done 10x the amount any previous EA has done.
Quote:
Originally Posted by Ravenblade1979 View Post
What you need is Zone Police again.
Reply With Quote
  #9  
Old 06-14-2013, 07:59 AM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
Quote:
Originally Posted by fowlplay4 View Post
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/
Reply With Quote
  #10  
Old 06-14-2013, 11:00 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
im glad i woke up to this
Reply With Quote
  #11  
Old 06-14-2013, 01:23 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Quote:
Originally Posted by fowlplay4 View Post
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/
__________________
Reply With Quote
  #12  
Old 06-14-2013, 01:59 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by cbk1994 View Post
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(); 
__________________
Quote:
Reply With Quote
  #13  
Old 06-14-2013, 02:39 PM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
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
Reply With Quote
  #14  
Old 06-14-2013, 07:06 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by khortez View Post
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.
__________________
Reply With Quote
Reply


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 10:29 AM.


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