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 07-05-2002, 06:43 PM
Glory Glory is offline
Banned
Glory's Avatar
Join Date: Mar 2002
Location: Sunnydale
Posts: 1,365
Glory is on a distinguished road
Send a message via AIM to Glory
Ummm

Yes I know this script is wrong but I suck at scripting...this is what I have, well a friend has...

if (startswith(message,#c)) {
ishighstaff();
if (this.highstaff==1) {
if (tokenscount < 3) {
setstring server.message,0;

And well it needs to be so you say

message "accountname" "what you want to appear over there head"

highstaff is like the tag so like (GP) etc. Pleasehelp
Reply With Quote
  #2  
Old 07-05-2002, 07:02 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Re: Ummm

Quote:
Originally posted by Glory
Yes I know this script is wrong but I suck at scripting...this is what I have, well a friend has...

if (startswith(message,#c)) {
ishighstaff();
if (this.highstaff==1) {
if (tokenscount < 3) {
setstring server.message,0;

And well it needs to be so you say

message "accountname" "what you want to appear over there head"

highstaff is like the tag so like (GP) etc. Pleasehelp
Well.. first.. you need an event to go along with startswith.. like playerchats.

NPC Code:
if (playerchats&&startswith(message,#c)){



That way.. the script knows when to check if #c starts with "message" or not.
ishighstaff doesnt really need to be a function..
You can add onto the first if statement to see if they're in that guild or not:
NPC Code:
if (playerchats&&startswith(message,#c)&&strequals(#g  ,GuildName)){



Now, the script will only go on if all three of those are true; The player chats, #c starts with message, and the guild the player is in is "GuildName."
If you want to make sure the player has more than 3 words there, use tokenize first.
NPC Code:
if (playerchats&&startswith(message,#c)&&strequals(#g  ,GuildName)){
tokenize #c;
if (tokenscount>=3){
setstring server.message,#t(2) //#t(2) is the 2nd token (third word).. so put the message in quotes when you type it out.. like message accountname "message here", that way everything inside the quotes will be treated as one token.
}
}

__________________

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 08:40 AM.


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