![]() |
Client to Server string
see my problem is in clientside the string this.trade shows all the items selected , the thing is when its transfered to serverside the string automaticly trims itself ? :\ and only the first string in the set is seen.... now there are ways around this which i've already done . but why does this happen??
~Sern NPC Code: |
//#SERVERSIDE doesn't exist.
|
I'm not the best at scriting, but try putting your serverside scripting before the "//#CLIENTSIDE", considering "//#SERVERSIDE" doesn't exsist, as I use it for organization.
|
i put those there so you'd know which script is where .... lol please have alittle common sense guys
~Sern |
Quote:
|
wow your all way too litteral, and stupid for that matter. Is there a problem should i edit my post , is it that big of a deal where your gonna cry about it or explain to me why that happens. i've been scripting on graal for over 5 years im not stupid and im deff no new at this. if your really gonna keep going on about it i'll edit it so you can stop whinning about it.
HAPPY..?? gosh |
If this.string uses commas to separate indecies, you probably want to put #s(this.trade) in quotes.
|
every string uses commas to separate indecies, i added setplayerprop #c,#s(this.trade) in the clientside before the triggeraction to see if the full string would show. and it did the problem happens when it sends the string to serverside it seems to automaticly trims it and only use the first string in the list or it can only see the first string in the list for some reason... so for example:
if, this.trade = gun,sword,bombs in clientside it'll see all 3 but in serverside it only sees gun |
setplayprop is serverside?
|
yes its is
|
Quote:
To address your original problem: place quotation marks in your triggeraction around the comma-containing string. Quote:
|
i know i already fixed what was going on, i just wanted to know why it was doing that... the logic behind it hence
Quote:
|
Serer strings trim themselves for no apparent reason. Probably the fact that the character initiated in the gserver has a limited length, so it truncates anything beyond that. Try using DB-NPCs, their strings seem much longer.
For example, replace this: NPC Code:setstring serverr.asdf,1234567890; with this: NPC Code: Don't forget to read up on this. and thiso. strings/variables, as they play a role in DB-NPC interation. |
Wow, Sern is back. He used to be my personal god of scripters until i left my **** stage.
|
Quote:
------------------------------------------------------------------------ Hmm very weird why it does that.... then again tis true that graal script goes against all other scripting languages in the world lol |
Oh BTW all , putting #s(this.trade) in quotes will return just the 1 begining quote to serverside, so my probelm still stands as to this should not be happening
|
I should update this so people know how i fixed it...
all i did was in serverside put a loop for (p=3; strlen(#p(p)) > 3; p++){ addstring this.prams,#p(p); } tokenize #s(this.prams); cause what happens is when you set a string as a pram it breaks up the string into unused prams , so each unused pram becomes a part of the string |
Quote:
PHP Code:
|
LoL cause it didnt for my for some reason ... read the other posts ;) it helps
|
Quote:
|
lol whatever you say lance xoxox
|
When passing a string array as a parameter in a triggeraction to serverside (without quotes) it treats all the elements as separate parameters.
|
hence, saying
PHP Code:
PHP Code:
|
na guy that would hold over so well with the rest of the script, in other places more than likely but not in mine
|
| All times are GMT +2. The time now is 08:43 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.