Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-20-2004, 09:37 PM
ZeroTrack ZeroTrack is offline
G2K1 Developer
ZeroTrack's Avatar
Join Date: Apr 2004
Location: LongIsland, NY
Posts: 402
ZeroTrack is on a distinguished road
Send a message via AIM to ZeroTrack
Question 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:

if(actionserverside){
if(strequals(#p(0),trade)){
tokenize #p(3);

//Start put in for testing
with(getplayer(#p(2))){
setplayerprop #c,#p(3);}
//End put in for testing

for(n = 0; n < tokenscount; n ++){
if(strtofloat(#s(clientr.amount_#t(n))) > 1){
this.remove = strtofloat(#s(clientr.amount_#t(n))) - strtofloat(1);
setstring clientr.amount_#t(n),#v(this.remove);
}else {
removeweapon #t(n);
setstring clientr.amount_#t(n),0;
}
}
with(getplayer(#p(2))){
for(a = 0; a < tokenscount; a ++){
if(hasweapon(#t(a))){
this.add = strtofloat(#s(clientr.amount_#t(a))) + strtofloat(1);
setstring clientr.amount_#t(a),#v(this.add);
}else{
addweapon #t(a);
setstring clientr.amount_#t(a),1;
}
}
sleep .5;
}
}
}

//#CLIENTSIDE
triggeraction 0,0,serverside,Items/Weapon Trader,trade,#a,#a(k),#s(this.trade),;


Last edited by ZeroTrack; 08-20-2004 at 11:16 PM..
Reply With Quote
 


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 02:15 PM.


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