Thread: Force Chat isnt working

Page 1 of 5 123 ... LastLast
Results 1 to 10 of 50
  1. #1 Force Chat isnt working 
    Registered Member
    Join Date
    Feb 2012
    Posts
    285
    Thanks given
    46
    Thanks received
    11
    Rep Power
    29
    As the title says, this is the code i am trying to execute
    Code:
    		Random ran = new Random();
    		NPCHandler.npcs[npcId].forceChat(messages[ran.nextInt(messages.length)].toString());
    and the message array is this:

    Code:
    	private String[] messages = {
    			"What do you think you are doing!", "Thief! Thief!",
    			"Don't try and steal my stuff!", "Get your hands outa there!"
    	};
    Ive testing the npc id and that is correct, but the problem is, the npc isnt saying anything.
    VOUCHES
    Spoiler for Vouches:

    bought a pin off him for 8m
    Quote Originally Posted by zexxo17 View Post
    trusted thanks
    bought pin of him 22m
    Quote Originally Posted by freedomex View Post
    sold 3 month pin to him for 22m , went smooth i went first hes trusted thanks
    Reply With Quote  
     

  2. #2  
    Member Force Chat isnt working Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    is the update flag being set to true...?

    Attached imageAttached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Feb 2012
    Posts
    285
    Thanks given
    46
    Thanks received
    11
    Rep Power
    29
    Quote Originally Posted by Luke132 View Post
    is the update flag being set to true...?
    Code:
    	public void forceChat(String text) {
    		forcedText = text;
    		forcedChatRequired = true;
    		updateRequired = true;
    	}
    or do you mean above the code itself, would it be a npc updateflag?
    VOUCHES
    Spoiler for Vouches:

    bought a pin off him for 8m
    Quote Originally Posted by zexxo17 View Post
    trusted thanks
    bought pin of him 22m
    Quote Originally Posted by freedomex View Post
    sold 3 month pin to him for 22m , went smooth i went first hes trusted thanks
    Reply With Quote  
     

  4. #4  
    Member Force Chat isnt working Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    Does it work when u just do something like NPCHandler.npcs[npcId].forceChat("hi"); ? What's the .toString() for?

    Attached imageAttached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2012
    Posts
    285
    Thanks given
    46
    Thanks received
    11
    Rep Power
    29
    Quote Originally Posted by Luke132 View Post
    Does it work when u just do something like NPCHandler.npcs[npcId].forceChat("hi"); ? What's the .toString() for?
    No it dosnt work and the .toString() is for converting the random lol, its needed, it dosnt work altogether, personally i think it is the npcId part
    VOUCHES
    Spoiler for Vouches:

    bought a pin off him for 8m
    Quote Originally Posted by zexxo17 View Post
    trusted thanks
    bought pin of him 22m
    Quote Originally Posted by freedomex View Post
    sold 3 month pin to him for 22m , went smooth i went first hes trusted thanks
    Reply With Quote  
     

  6. #6  
    Member Force Chat isnt working Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    The NpcId is the number of npc in the server (if you have 6 npcs it'll go from 0-5), not the actual NPC (like how kbd is 53), you know that right? and you already said you know that's right, how?

    Attached imageAttached image
    Reply With Quote  
     

  7. #7  
    Member Force Chat isnt working Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    Quote Originally Posted by The evil ways View Post
    the .toString() is for converting the random lol, its needed
    nextInt returns an int, forceChat(String) want's a string, there's no reason why that's needed unless you're trying to display the value of nextInt as a string

    Attached imageAttached image
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Jun 2014
    Posts
    126
    Thanks given
    32
    Thanks received
    20
    Rep Power
    0
    ur probably not applying it in ur NPC updating
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Feb 2012
    Posts
    285
    Thanks given
    46
    Thanks received
    11
    Rep Power
    29
    Quote Originally Posted by Luke132 View Post
    nextInt returns an int, forceChat(String) want's a string, there's no reason why that's needed unless you're trying to display the value of nextInt as a string
    im converting the nextInt to a string otherwise the npc would print out a value, anyway, i know that the npcId is the id of the npc, right this is in a new skill im rewritting, thieving. basically i want the npc to say the random message, but the forcechat dosnt seem to work, is there any specific way of getting that specific npc that i click on for example man (id 1) for him only, no other npc with the id 1 to shout?
    VOUCHES
    Spoiler for Vouches:

    bought a pin off him for 8m
    Quote Originally Posted by zexxo17 View Post
    trusted thanks
    bought pin of him 22m
    Quote Originally Posted by freedomex View Post
    sold 3 month pin to him for 22m , went smooth i went first hes trusted thanks
    Reply With Quote  
     

  10. #10  
    Member Force Chat isnt working Market Banned


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    35
    Posts
    12,574
    Thanks given
    199
    Thanks received
    7,106
    Rep Power
    5000
    Quote Originally Posted by The evil ways View Post
    im converting the nextInt to a string otherwise the npc would print out a value
    So the problem is that it's not displaying the message you want or that it wont display ANYTHING? ....cos according to that post the problem is your array (which i've just said above) (if it'll print the value of nextInt then that's your problem..)

    is there any specific way of getting that specific npc that i click on for example man (id 1) for him only, no other npc with the id 1 to shout?
    yes but every npc with that id would shout..

    Attached imageAttached image
    Reply With Quote  
     

Page 1 of 5 123 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. My JFrame isnt working with the server...
    By Anthony-| in forum Help
    Replies: 3
    Last Post: 03-30-2009, 02:30 PM
  2. ip ban isnt working
    By Runebay™ in forum Help
    Replies: 3
    Last Post: 03-07-2009, 04:34 PM
  3. Replies: 2
    Last Post: 11-01-2008, 04:09 AM
  4. rs2e v.2 uses forced chat??
    By ritz929 in forum RS 503+ Client & Server
    Replies: 5
    Last Post: 08-06-2008, 03:41 PM
  5. My GUI's for a chat im working on
    By killerjoe in forum Showcase
    Replies: 6
    Last Post: 01-31-2008, 12:38 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •