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 04-15-2006, 02:24 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Remove a string from player attributes?

What command do I use to remove a string (clientr.body or w/e) from the attributes?

I tried deletestring but i have no idea how to use it.
__________________
Reply With Quote
  #2  
Old 04-15-2006, 05:38 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by wild8900
What command do I use to remove a string (clientr.body or w/e) from the attributes?

I tried deletestring but i have no idea how to use it.
Just setting it to nothing

NPC Code:

setstring clientr.body,;



Should remove it
Reply With Quote
  #3  
Old 04-15-2006, 05:43 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
oh ok thanks, Ill try that.
EDIT: no that didnt work.
The script is:
if (actionserverside) {
if (strequals(#p(0),save1)){
with (getplayer(#p(1))){
setstring clientr.body#p(2),#8;
setstring clientr.head#p(2),#3;
setstring clientr.shield#p(2),#2;
setstring clientr.sword#p(2),#1;
setstring clientr.skin#p(2),#C0;
setstring clientr.coat#p(2),#C1;
setstring clientr.sleeves#p(2),#C2;
setstring clientr.shoes#p(2),#C3;
setstring clientr.belt#p(2),#C4;
}}
if (strequals(#p(0),load1)){
with (getplayer(#p(1))){
setplayerprop #8,#s(clientr.body#p(2));
setplayerprop #3,#s(clientr.head#p(2));
setplayerprop #2,#s(clientr.shield#p(2));
setplayerprop #1,#s(clientr.sword#p(2));
setplayerprop #C0,#s(clientr.skin#p(2));
setplayerprop #C1,#s(clientr.coat#p(2));
setplayerprop #C2,#s(clientr.sleeves#p(2));
setplayerprop #C3,#s(clientr.shoes#p(2));
setplayerprop #C4,#s(clientr.belt#p(2));
}}
if (strequals(#p(0),delete1)){
with (getplayer(#p(1))){
setstring clientr.body#p(2),;
setstring clientr.head#p(2),;
setstring clientr.shield#p(2),;
setstring clientr.sword#p(2),;
setstring clientr.skin#p(2),;
setstring clientr.coat#p(2),;
setstring clientr.sleeves#p(2),;
setstring clientr.shoes#p(2),;
setstring clientr.belt#p(2),;
}}
}
//#CLIENTSIDE
if (playerchats) {
tokenize #c;
if (tokenscount==2) {
if (strequals(#t(0),all)) {
setplayerprop #C0,#t(1);
setplayerprop #C1,#t(1);
setplayerprop #C2,#t(1);
setplayerprop #C3,#t(1);
setplayerprop #C4,#t(1);}
if (strequals(#t(0),skin)) {
setplayerprop #C0,#t(1);}
if (strequals(#t(0),coat)) {
setplayerprop #C1,#t(1);}
if (strequals(#t(0),sleeve)) {
setplayerprop #C2,#t(1);}
if (strequals(#t(0),shoe)) {
setplayerprop #C3,#t(1);}
if (strequals(#t(0),belt)) {
setplayerprop #C4,#t(1);}
}
}
if (playerchats&&startswith(/loadoutfit,#c)){
tokenize #c;
triggeraction 0,0,serverside,Irata/Tailor,load1,#a,#t(1);
setplayerprop #c,Outfit #t(1) Loaded!;
}
if (playerchats&&startswith(/saveoutfit,#c)){
tokenize #c;
triggeraction 0,0,serverside,Irata/Tailor,save1,#a,#t(1);
setplayerprop #c,Outfit #t(1) Saved!;
}
if (playerchats&&startswith(/deleteoutfit,#c)){
tokenize #c;
triggeraction 0,0,serverside,Irata/Tailor,delete1,#a,#t(1);
setplayerprop #c,Outfit #t(1) Deleted!;
}
__________________
Reply With Quote
  #4  
Old 04-15-2006, 05:58 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Could you tell me what it is setting your Strings to?

Also might I suggest, if its all for the same player, using getplayer isnt really needed, as things will be unique to the player who called them.

Maybe also put your confirmation on the serverside, so you can make sure it is going through everything.
Reply With Quote
  #5  
Old 04-15-2006, 07:59 AM
VulcanP2P VulcanP2P is offline
Registered User
VulcanP2P's Avatar
Join Date: May 2005
Location: Florida
Posts: 882
VulcanP2P is on a distinguished road
What I did:
  • Styled the script
  • Removed the getplayer
  • Got rid of the multiple playerchats events
  • Tested online and it seems to work now
What you might want to do:
  • Add a check while loading the outfit so it doesn't load all white if the outfit doesn't exist
  • Use an array rather than so many strings
  • Convert to GS2
PHP Code:
if (actionserverside) {
  if (
strequals(#p(0),save1)){
    
setstring clientr.body#p(1),#8;
    
setstring clientr.head#p(1),#3;
    
setstring clientr.shield#p(1),#2;
    
setstring clientr.sword#p(1),#1;
    
setstring clientr.skin#p(1),#C0;
    
setstring clientr.coat#p(1),#C1;
    
setstring clientr.sleeves#p(1),#C2;
    
setstring clientr.shoes#p(1),#C3;
    
setstring clientr.belt#p(1),#C4;
  
}
  if (
strequals(#p(0),load1)){
    
setplayerprop #8,#s(clientr.body#p(1));
    
setplayerprop #3,#s(clientr.head#p(1));
    
setplayerprop #2,#s(clientr.shield#p(1));
    
setplayerprop #1,#s(clientr.sword#p(1));
    
setplayerprop #C0,#s(clientr.skin#p(1));
    
setplayerprop #C1,#s(clientr.coat#p(1));
    
setplayerprop #C2,#s(clientr.sleeves#p(1));
    
setplayerprop #C3,#s(clientr.shoes#p(1));
    
setplayerprop #C4,#s(clientr.belt#p(1));
  
}
  if (
strequals(#p(0),delete1)){
    
setstring clientr.body#p(1),;
    
setstring clientr.head#p(1),;
    
setstring clientr.shield#p(1),;
    
setstring clientr.sword#p(1),;
    
setstring clientr.skin#p(1),;
    
setstring clientr.coat#p(1),;
    
setstring clientr.sleeves#p(1),;
    
setstring clientr.shoes#p(1),;
    
setstring clientr.belt#p(1),;
  
}
}
//#CLIENTSIDE
if (playerchats) {
  
tokenize #c;
  
if (tokenscount==2) {
    if (
strequals(#t(0),all)) {
      
setplayerprop #C0,#t(1);
      
setplayerprop #C1,#t(1);
      
setplayerprop #C2,#t(1);
      
setplayerprop #C3,#t(1);
      
setplayerprop #C4,#t(1);
    
}
    if (
strequals(#t(0),skin)) {
      
setplayerprop #C0,#t(1);
    
}
    if (
strequals(#t(0),coat)) {
      
setplayerprop #C1,#t(1);
    
}
    if (
strequals(#t(0),sleeve)) {
      
setplayerprop #C2,#t(1);
    
}
    if (
strequals(#t(0),shoe)) {
      
setplayerprop #C3,#t(1);
    
}
    if (
strequals(#t(0),belt)) {
      
setplayerprop #C4,#t(1);
    
}
    if (
strequals(#t(0),/loadoutfit)) {
      
triggeraction 0,0,serverside,Irata/Tailor,load1,#t(1);
      
setplayerprop #c,Outfit #t(1) Loaded!;
    
}
    if (
strequals(#t(0),/saveoutfit)) {
      
triggeraction 0,0,serverside,Irata/Tailor,save1,#t(1);
      
setplayerprop #c,Outfit #t(1) Saved!;
    
}
    if (
strequals(#t(0),/deleteoutfit)) {
      
triggeraction 0,0,serverside,Irata/Tailor,delete1,#t(1);
      
setplayerprop #c,Outfit #t(1) Deleted!;
    
}
  }

__________________

For Zone or Guild Support use the Support Center

Last edited by VulcanP2P; 04-15-2006 at 08:09 AM..
Reply With Quote
  #6  
Old 04-15-2006, 08:03 AM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
Thanks and I would convert to Gs2 but I know nothing about it.
EDIT:
hmm... the delete part still wont work.
__________________
Reply With Quote
  #7  
Old 04-16-2006, 06:35 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
^-- But you don't seem to know much at GS1, so theirfore, its at your best to convert now.
Reply With Quote
  #8  
Old 04-16-2006, 06:58 PM
wild8900 wild8900 is offline
Mr. Brightside
wild8900's Avatar
Join Date: Dec 2005
Posts: 418
wild8900 is an unknown quantity at this point
Send a message via MSN to wild8900
=/
I know more at GS1 than i do at Gs2 so if I start Gs2 I will be back at the bottom.
__________________
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 11:37 PM.


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