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 11-16-2001, 05:27 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
chat system ...

will someone fix my chat script:
NPC Code:

NPC Code:

// Chat System
// NPC made by Nyght
if (playertouchsme) {
toweapons Chat;
}
if (playersays(chat on) && chatoff) {
setplayerprop #c,;
set chaton;
unset chatoff;
disabledefmovement;
setstring server.chatrow1,(#a is entering chat);
showimg 500,norin_chat.gif,5,5;
changeimgvis 500,4;
timeout=0.05;
}

if (playersays(reset chat)) {
if (strcontains(#g,Admin) || strcontains(#a,nyghtGT)) {
setstring client.chatreset,start;
setplayerprop #c,;
}
}

if (strcontains(start,#s(client.chatreset))) {
setstring server.chatrow10,;
setstring server.chatrow9,;
setstring server.chatrow8,;
setstring server.chatrow7,;
setstring server.chatrow6,;
setstring server.chatrow5,;
setstring server.chatrow4,;
setstring server.chatrow3,;
setstring server.chatrow2,;
setstring server.chatrow1,(Chat reset by #a);
setstring client.chatreset,done;
}

if (playerchats && strlen(#c)>=42 && chaton) {
setstring server.chatrow1,(#a problem post exceeds max number of letters);
}

if (playerchats) {
if (!strlen(#c)>=42 && chaton) {
setstring server.chatrow10,#s(server.chatrow9);
setstring server.chatrow9,#s(server.chatrow8);
setstring server.chatrow8,#s(server.chatrow7);
setstring server.chatrow7,#s(server.chatrow6);
setstring server.chatrow6,#s(server.chatrow5);
setstring server.chatrow5,#s(server.chatrow4);
setstring server.chatrow4,#s(server.chatrow3);
setstring server.chatrow3,#s(server.chatrow2);
setstring server.chatrow2,#s(server.chatrow1);
setstring server.chatrow1,#a: #c;
}
}

if (timeout) {
showimg 510,@verdana@#s(server.chatrow10),20,20;
changeimgvis 510,4;
changeimgzoom 510,0.55;
changeimgcolors 510,0,0,0,1;
showimg 509,@verdana@#s(server.chatrow9),20,35;
changeimgvis 509,4;
changeimgzoom 509,0.55;
changeimgcolors 509,0,0,0,1;
showimg 508,@verdana@#s(server.chatrow8),20,50;
changeimgvis 508,4;
changeimgzoom 508,0.55;
changeimgcolors 508,0,0,0,1;
showimg 507,@verdana@#s(server.chatrow7),20,65;
changeimgvis 507,4;
changeimgzoom 507,0.55;
changeimgcolors 507,0,0,0,1;
showimg 506,@verdana@#s(server.chatrow6),20,80;
changeimgvis 506,4;
changeimgzoom 506,0.55;
changeimgcolors 506,0,0,0,1;
showimg 505,@verdana@#s(server.chatrow5),20,95;
changeimgvis 505,4;
changeimgzoom 505,0.55;
changeimgcolors 505,0,0,0,1;
showimg 504,@verdana@#s(server.chatrow4),20,110;
changeimgvis 504,4;
changeimgzoom 504,0.55;
changeimgcolors 504,0,0,0,1;
showimg 503,@verdana@#s(server.chatrow3),20,125;
changeimgvis 503,4;
changeimgzoom 503,0.55;
changeimgcolors 503,0,0,0,1;
showimg 502,@verdana@#s(server.chatrow2),20,140;
changeimgvis 502,4;
changeimgzoom 502,0.55;
changeimgcolors 502,0,0,0,1;
showimg 501,@verdana@#s(server.chatrow1),20,155;
changeimgvis 501,4;
changeimgzoom 501,0.55;
changeimgcolors 501,0,0,0,1;
timeout=0.05;
}

if (strequals(#a: chat off,#s(server.chatrow1))) {
setstring server.chatrow1,(#a has left chat);
unset chaton;
set chatoff;
enabledefmovement;
}

if (!chaton && chatoff) {
hideimg 500;
hideimg 501;
hideimg 502;
hideimg 503;
hideimg 504;
hideimg 505;
hideimg 506;
hideimg 507;
hideimg 508;
hideimg 509;
hideimg 510;
}
if (playersays(chat off)) {
set chatoff;
}




the main problem is that when i chat it sets the same string twice ... try it and you'll see
Reply With Quote
  #2  
Old 11-16-2001, 07:48 PM
TDO2000 TDO2000 is offline
Registered User
TDO2000's Avatar
Join Date: Jul 2001
Location: Germany
Posts: 655
TDO2000 is on a distinguished road
I wouldn't use strlen >= 42 I would shorten it with #e so it will have the right size and also longer textes are accepted...
__________________
No Webhost at the moment
Reply With Quote
  #3  
Old 11-17-2001, 03:31 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
nyght is that the one you gave me?
Reply With Quote
  #4  
Old 11-17-2001, 03:53 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by royce
nyght is that the one you gave me?
yes it is and will someone please help me out ?
Reply With Quote
  #5  
Old 11-17-2001, 04:44 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
askin the wrong person here XD
Reply With Quote
  #6  
Old 11-17-2001, 06:45 AM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~AlphaFlame~

The problem is you have it in your weapons and on the level in the same time... it's calling the playerchats event twice...

P.S - condense the changeimgvis with a for loop...
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #7  
Old 11-17-2001, 10:43 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by entravial
~AlphaFlame~

The problem is you have it in your weapons and on the level in the same time... it's calling the playerchats event twice...

P.S - condense the changeimgvis with a for loop...
yeah i just thoght of that too ...thanx ....
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 06:35 PM.


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