Jump to content
  • 0

Help with atcommand in script


jcgt85

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  01/31/12
  • Last Seen:  

Hi, I was making a script for a Guild Master castle, so he can change the color of their guildmember's chat through the @faction command... But I have a problem with it, it works fine when the character has 1 name, but when their name has 2 or more words, it doesn't work... This is the script.

schg_cas03,289,193,3 script Colorful Rainbow 444,{
set .@GIDF,GetCastleData("schg_cas03",1);

if (.@GIDF == 0) {
 mes "[Colorful Rainbow]";
 mes "Tu no eres de esta guild.";
 mes "Fuera de aqui antes de que llame a los guardias.";
 close;
 end;
}
if (GetGuildMaster(.@GIDF) != strcharinfo(0)) {
 mes "[Colorful Rainbow]";
 mes "No molestes, yo solo hablo con ^ff0000"+GetGuildMaster(.@GIDF)+"^000000.";
 close;
 end;
}
mes "[Colorful Rainbow]";
mes "Bienvenido, ^ff0000"+strcharinfo(0)+"^000000...";
mes "¿Que necesitas?";
next;
switch (select("Poner color a un miembro:Quitarle color a alguien:Nada")) {
case 1:
 mes "[Colorful Rainbow]";
 mes "¿A quien le quieres poner color?";
 next;
 mes "[Colorful Rainbow]";
 mes "Recuerda que tiene que la persona debe estar ONLINE para poder ponerle el color";
 next;
 input .@nombre$;
 if (!isloggedin(getcharid(3,.@nombre$),getcharid(0,.@nombre$))) {
  mes "[Colorful Rainbow]";
  mes .@nombre$ + " no esta conectado";
  close;
  end;
 }
 else if (getcharid(2,.@nombre$) != .@GIDF){
  mes "[Colorful Rainbow]";
  mes .@nombre$ + " no es de tu guild";
  close;
  end;
 }
 attachrid(getcharid(3,.@nombre$));
 atcommand "*faction " + .@nombre$ + " " + 1;
 mes "[Colorful Rainbow]";
 mes "Listo, eso fue todo.";
 close;
 end;

case 2:
 mes "[Colorful Rainbow]";
 mes "¿A quien le quieres quitar color?";
 next;
 mes "[Colorful Rainbow]";
 mes "Recuerda que tiene que la persona debe estar ONLINE para poder quitarle el color";
 next;
 input .@nombre$;
 if (!isloggedin(getcharid(3,.@nombre$),getcharid(0,.@nombre$))) {
  mes "[Colorful Rainbow]";
  mes .@nombre$ + "no esta conectado";
  end;
 }
 attachrid(getcharid(3,.@nombre$));
 atcommand "@faction " + .@nombre$ + " " + 0;
 mes "[Colorful Rainbow]";
 mes "Listo, eso fue todo.";
 close;
 end;


case 3:
 mes "[Colorful Rainbow]";
 mes "Vuelve pronto";
 close;
 end;
}
}

When the character's name that the GL put has 2 or more words, it says "Faction not found, use @faction <faction ID>"... And its because when a character has 2 names I have to use "" ... But I have no idea how to put them in the script D:

Need help u.u'

PS. Yeah, the * in my server is the #...

Edited by jcgt85
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

prontera,152,187,5	script	kjdhfkdsjfhks	100,{
atcommand "@kami a\"sdas\"fafs";
atcommand "@kami asdasfafs";
end;
}

use \ symbol to escape a string

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  22
  • Reputation:   0
  • Joined:  01/31/12
  • Last Seen:  

Works like a charm. Didn't knew about that escape.

Thanks AnnieRuru!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...