Thread: [small-tut]Heart gfx above romeos head...

Results 1 to 8 of 8
  1. #1 [small-tut]Heart gfx above romeos head... 
    Registered Member
    Join Date
    Jul 2006
    Age
    35
    Posts
    487
    Thanks given
    0
    Thanks received
    0
    Rep Power
    56
    Make sure you have him in your autospawn

    Add this in NPC.java:
    Code:
    protected int playerId;
    Add this void in your NPCHandler.java:
    Code:
    public void staticGraphic(int gfx, int x, int y, int i)
    	{
    		int Player = npcs[i].playerId;
    		client p = (client) server.playerHandler.players[Player];
    		p.stillgfx(gfx, y, x);
    	}
    Add this under the process:
    Code:
    if (npcs[i].npcType == 639)
    				{
    					if (misc.random(100) == 20)
    					{
    						staticGraphic(574, npcs[i].absX, npcs[i].absY, i);
    					}
    				}
    Then add this under your welcome message:
    Code:
    for(int i = 0; i < server.npcHandler.maxNPCs; i++)
    		{
    			if (server.npcHandler.npcs[i] != null)
    			{
    				server.npcHandler.npcs[i].playerId = playerId;
    			}
    		}
    - Mr. Brightside

    You can use this for other npc gfx also
     

  2. #2  
    Mr.Lothar
    Guest
    we can now make animations to npcs i mean head thanks for you P
     

  3. #3  
    Renown Programmer
    Harha's Avatar
    Join Date
    Jul 2006
    Age
    30
    Posts
    433
    Thanks given
    3
    Thanks received
    31
    Rep Power
    339
    Nice, it works, but if i host my server with this code like 5 minutes, it crashes and then no1 cant connect to it... Try to fix that, then it's perfect, or if your server wont crash, there's something wrong with my server.
     

  4. #4  
    bee hind u
    Guest
    lol santa idiot under process it will blink like every second.
     

  5. #5  
    Sam Server
    Guest
    Nice man
     

  6. #6  
    I'm unique


    Join Date
    Oct 2006
    Age
    32
    Posts
    708
    Thanks given
    0
    Thanks received
    1
    Rep Power
    82
    I got someting wrong Where do I need to add
    Code:
    for(int i = 0; i < server.npcHandler.maxNPCs; i++)
    		{
    			if (server.npcHandler.npcs[i] != null)
    			{
    				server.npcHandler.npcs[i].playerId = playerId;
    			}
    ? In client.java? or Please help, thanks.
    Sincerly yours,
    Simox.
     

  7. #7  
    Member

    Join Date
    Dec 2006
    Posts
    1,263
    Thanks given
    3
    Thanks received
    3
    Rep Power
    0
    Uhm, sweet Added this to my new project. Thanks.
     

  8. #8  
    Registered Member
    Join Date
    Jul 2006
    Age
    35
    Posts
    487
    Thanks given
    0
    Thanks received
    0
    Rep Power
    56
    Quote Originally Posted by Simox View Post
    I got someting wrong Where do I need to add
    Code:
    for(int i = 0; i < server.npcHandler.maxNPCs; i++)
    		{
    			if (server.npcHandler.npcs[i] != null)
    			{
    				server.npcHandler.npcs[i].playerId = playerId;
    			}
    ? In client.java? or Please help, thanks.
    Under your welcome message in client.java
     


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. Poem from my heart.
    By Robin Spud in forum Literature & Language Arts
    Replies: 12
    Last Post: 02-20-2010, 03:52 AM
  2. Replies: 10
    Last Post: 02-21-2009, 10:47 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •