Jump to content
  • 0
Sign in to follow this  
mrlongshen

Wish NPC or Greeting NPC

Question

I want to request npc that all player can wrote on its.

and the npc will display the message onclick the msg npc. All the message will displayed.

Then npc have a function anti flooding. Each player can wrote a msg and have to wait  about 10 minutes for write the next msg.

GM can delete the msg.

 

Example of the NPC:

 

Name: Player 1

Message: Hai all. What are you doing now ?

 

Name: Player 2

Message: I'm waiting for someone make this script for me xD

 

Like this. Hope someone can make its for me.

 

 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

try?

 

 

 

prontera,150,150,4    script    sample    100,{    query_sql "SELECT `name`,`message` FROM `wish`", .@name$, .@message$; // get values from wish table.    mes "[ " +strnpcinfo(3)+ " ]",        "What do you want to do?";    next;    switch ( select ( "View Message","Write Message" ) ) {        case 1:            mes "[ " +strnpcinfo(3)+ " ]";            for (set .@i,0; .@i < getarraysize(.@name$); set .@i, .@i + 1) {                mes "^ff0000Name^000000 : " + .@name$[.@i], "^0000ffMessage^000000 : "+ .@message$[.@i]; // show name and message.                next;            }            close;        case 2:            input .@input$; // input message            query_sql ( "INSERT INTO `wish` (`name`, `message`) VALUES ('" +  strcharinfo(0) + "', '"+ .@input$ +"')") ; // insert name and message to sql table.            close;    }OnInit:    query_sql "CREATE TABLE IF NOT EXISTS `wish` ( `name` varchar(30) NOT NULL DEFAULT '', `message` varchar(255) NOT NULL DEFAULT '' ) ENGINE=MyISAM"; // create "wish" table if it doesn't exist.     end;}

 

 

Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

@quesoph

 

sir, can you make its auto display on the menu ?

I means by this, when player click on the npc, the msg will list on the npc.

wait i give u a picture...

 


post-1425-0-40213500-1385659252_thumb.png

 

nah.. like this...

Share this post


Link to post
Share on other sites
  • 0
prontera,150,150,4    script    sample    100,{    query_sql "SELECT `name`,`message` FROM `wish`", .@name$, .@message$; // get values from wish table.    mes "[ " +strnpcinfo(3)+ " ]";    for (set .@i,0; .@i < getarraysize(.@name$); set .@i, .@i + 1) {        mes "^ff0000Name^000000 : " + .@name$[.@i], "^0000ffMessage^000000 : "+ .@message$[.@i]," "; // show name and message.    }    menu "Write Message",-;    input .@input$; // input message    query_sql ( "INSERT INTO `wish` (`name`, `message`) VALUES ('" +  strcharinfo(0) + "', '"+ .@input$ +"')") ; // insert name and message to sql table.    close;OnInit:    query_sql "CREATE TABLE IF NOT EXISTS `wish` ( `name` varchar(30) NOT NULL DEFAULT '', `message` varchar(255) NOT NULL DEFAULT '' ) ENGINE=MyISAM"; // create "wish" table if it doesn't exist.    end;}
Edited by quesoph

Share this post


Link to post
Share on other sites
  • 0

@quesoph

 

Yes bro like that. btw. can you add when gm lvl more than 90, he can delete the message. since maybe some user will write a bad words ? is this script, its unlimited right sir ? means there are no delay or ??

Share this post


Link to post
Share on other sites
  • 0

@quesoph

 

Yes bro like that. btw. can you add when gm lvl more than 90, he can delete the message. since maybe some user will write a bad words ? is this script, its unlimited right sir ? means there are no delay or ??

It can show maximum 128 wishes. Since array is bound to 0-127

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.