PDA

View Full Version : help, proof reading needed.


khortez
06-14-2013, 01:35 AM
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.level, temp.warped.x, temp.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.


function onActionServerSide() {
if (params[0] == "warp") {
temp.pl = player;
temp.warped = findplayer2(params[1]);
if (temp.warped != NULL) {
temp.pl.setlevel2(temp.warped.level, temp.warped.x, temp.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
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.

Kmv3WlKa6U8

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
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.
XaoM0FyLmGY
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
temp.pl = player;
temp.warped = findplayer2(params[1]);
if (temp.warped != NULL) {
temp.pl.setlevel2(temp.warped.level, temp.warped.x, temp.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.


temp.pl = findplayer2(params[1]);
if (temp.pl != NULL) {
player.setlevel2(temp.pl.level, temp.pl.x, temp.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
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
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.


function onActionServerSide() {
if (params[0] == "warp") {
temp.pl = player;
temp.warped = findplayer2(params[1]);
if (temp.warped != NULL) {
temp.pl.setlevel2(temp.warped.level, temp.warped.x, temp.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
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.


temp.pl = findplayer2(params[1]);
if (temp.pl != NULL) {
player.setlevel2(temp.pl.level, temp.pl.x, temp.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.


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
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.


temp.pl = findplayer2(params[1]);
if (temp.pl != NULL) {
player.setlevel2(temp.pl.level, temp.pl.x, temp.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
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.