Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Remove a string from player attributes? (https://forums.graalonline.com/forums/showthread.php?t=65393)

wild8900 04-15-2006 02:24 AM

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.

Andy0687 04-15-2006 05:38 AM

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

wild8900 04-15-2006 05:43 AM

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!;
}

Andy0687 04-15-2006 05:58 AM

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.

VulcanP2P 04-15-2006 07:59 AM

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!;
    
}
  }



wild8900 04-15-2006 08:03 AM

Thanks and I would convert to Gs2 but I know nothing about it.
EDIT:
hmm... the delete part still wont work.

KuJi 04-16-2006 06:35 PM

^-- But you don't seem to know much at GS1, so theirfore, its at your best to convert now.

wild8900 04-16-2006 06:58 PM

=/
I know more at GS1 than i do at Gs2 so if I start Gs2 I will be back at the bottom.


All times are GMT +2. The time now is 02:36 PM.

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