Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Ummm (https://forums.graalonline.com/forums/showthread.php?t=32974)

Glory 07-05-2002 06:43 PM

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

CheeToS2 07-05-2002 07:02 PM

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.
}
}



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

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