Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   player's string problem (https://forums.graalonline.com/forums/showthread.php?t=71082)

xXziroXx 12-29-2006 03:01 AM

player's string problem
 
Ok, so, im trying to set another player's string to a value, but it wont work.


PHP Code:

with (findPlayer(this.target[1])) client.tradereq playero.id

this.target[1] equals the targets account name, so theres no problem there. What happens with this is that instead of setting the targets client.tradereq, it sets it on the current player.

PHP Code:

with (findPlayer(this.target[1])) player.chat "Trying to set your chat!"

That works perfectly fine, so theres no problem in accessing the player.. Ive had -alot- of player-to-player communication errors on Mythic, stuff that works on other servers wont work on there..

Any ideas about whats wrong?

Yen 12-29-2006 03:08 AM

findPlayer(this.target[1]).client.tradereq = player.id;

Skyld 12-29-2006 01:50 PM

Normally also it is best to specify the object you are working with, i.e.
PHP Code:

with (findPlayer("Skyld"))
{
  
player.clientr.foo "bar";



xXziroXx 12-29-2006 04:17 PM

Quote:

Originally Posted by Yen (Post 1258283)
findPlayer(this.target[1]).client.tradereq = player.id;

Didnt work.

Quote:

Originally Posted by Skyld (Post 1258380)
Normally also it is best to specify the object you are working with, i.e.
PHP Code:

with (findPlayer("Skyld"))
{
  
player.clientr.foo "bar";



Didnt work.


I keep saying it, theres something wrong with the server.

Skyld 12-29-2006 05:37 PM

Quote:

Originally Posted by xXziroXx (Post 1258412)
Didnt work.


I keep saying it, theres something wrong with the server.

How about using this.?
PHP Code:

with (findPlayer(foo))
{
  
this.clientr.bar baz;



Twinny 12-29-2006 05:52 PM

I tried setting client flags on players remotely on his server. I've never tried this clientside but apparently it would work.

I did
PHP Code:

//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "test")
  {
    
temp.findplayer("xXziroXx");
    
player.chat temp.e.client.testflag SPC temp.e.chat;
    
sleep(2);
    
temp.e.client.testflag "RawrTest";
    
player.chat temp.e.client.testflag SPC temp.e.chat;
  }


First time round my chat showed his chat then after 2 seconds i saw 'RawrTest' followed by his chat. When repeated, it showed 'RawrTest' in both phases.

Ziro couldn't read this clientflag that was set on him and when he reconnected it was gone. Kinda wierd x_x

When i used serverside to set player.attr[5] though i could not read a client flag that was set through RC on him. I normally do this thing serverside but if it if supposed to work clientside that would be cool.

Gambet 12-29-2006 06:39 PM

What? You're supposed to be able to work with client flags clientside.

contiga 12-29-2006 06:40 PM

You can't edit other players clientside, no matter if it are "client." flags.

Gambet 12-29-2006 06:52 PM

Quote:

Originally Posted by contiga (Post 1258462)
You can't edit other players clientside, no matter if it are "client." flags.


I was talking about working with your own clientside. I would think it would be obvious that you can't edit other players clientside.

xXziroXx 12-29-2006 07:59 PM

Quote:

Originally Posted by Gambet (Post 1258470)
I was talking about working with your own clientside. I would think it would be obvious that you can't edit other players clientside.


Im pretty sure I have been able to set other clients cleitn. VARIABLE's clientsided in the past?

Gambet 12-29-2006 10:21 PM

Quote:

Originally Posted by xXziroXx (Post 1258504)
Im pretty sure I have been able to set other clients cleitn. VARIABLE's clientsided in the past?



You can try it and it wont work. Something like:

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
 if (
player.chat.starts("/test")) {
  
tokens player.chat.tokenize();
  
findplayer(tokens[1]).client.testvar tokens[2];
 }




It will only work if you set it to yourself, not anyone else.

Twinny 12-30-2006 03:49 AM

This was the odd part Gambet. It saved my client string to the players object. I verified it was the same object as It showed the players chat as well. It may not have been stored as a client in the end but it was still there.

Gambet 12-30-2006 08:59 AM

Quote:

Originally Posted by Twinny (Post 1258681)
This was the odd part Gambet. It saved my client string to the players object. I verified it was the same object as It showed the players chat as well. It may not have been stored as a client in the end but it was still there.


Most likely just temporarily storing information for you to handle. None of it would be saved unless you sent the temporary information in a trigger over to the serverside to be set.

xXziroXx 12-30-2006 02:53 PM

Quote:

Originally Posted by Gambet (Post 1258770)
Most likely just temporarily storing information for you to handle. None of it would be saved unless you sent the temporary information in a trigger over to the serverside to be set.

Come to think about it, I never have been able to SET data for other clients clientsided, only ACCESS player attributes. Those temporary stored information strings blah blah must have confused me.

godofwarares 01-08-2007 10:07 PM

Quote:

Originally Posted by xXziroXx (Post 1258281)
Ok, so, im trying to set another player's string to a value, but it wont work.


PHP Code:

with (findPlayer(this.target[1])) client.tradereq playero.id

this.target[1] equals the targets account name, so theres no problem there. What happens with this is that instead of setting the targets client.tradereq, it sets it on the current player.

PHP Code:

with (findPlayer(this.target[1])) player.chat "Trying to set your chat!"

That works perfectly fine, so theres no problem in accessing the player.. Ive had -alot- of player-to-player communication errors on Mythic, stuff that works on other servers wont work on there..

Any ideas about whats wrong?

Bah. Just run it serverside.

PHP Code:

function onActionServerSide(cmd)
{

  switch(
cmd)
  {

    case 
"setchat":
    {
      
      
with(getplayer(params[1])) player.chat "Trying to set your chat!";

    break;
    
    }

  }

}

//#CLIENTSIDE
function onPlayerChats()
{

  if (
player.chat.starts("/find"))
  {

    
triggeraction(00"serverside"namesetchatplayer.chat.substring(6,-1));

  }



That should work :)

Chompy 01-08-2007 10:17 PM

Quote:

Originally Posted by godofwarares (Post 1262671)
Bah. Just run it serverside.

PHP Code:

function onActionServerSide(cmd)
{

  switch(
cmd)
  {

    case 
"setchat":
    {
      
      
with(getplayer(params[1])) player.chat "Trying to set your chat!";

    break;
    
    }

  }

}

//#CLIENTSIDE
function onPlayerChats()
{

  if (
player.chat.starts("/find"))
  {

    
triggeraction(00"serverside"namesetchatplayer.chat.substring(6,-1));

  }



That should work :)

bah, 2 things

1) findplayer( params[ 1]).chat = "Trying to set your chat!";
2) triggerserver( "gui", this.name, "setchat", player.chat.substring( 6));

getplayer isn't gs2, its gs1


All times are GMT +2. The time now is 08:15 AM.

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