Wish NPC or Greeting NPC

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
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.

 
try?

Code:
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;}
 
Last edited by a moderator:
@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...

29-Nov-13 1-13-54 AM.png

nah.. like this...

 
Code:
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;}
 
Last edited by a moderator:
@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 ??

 
@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
 
Back
Top