mrlongshen 22 Posted November 14, 2013 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. Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted November 14, 2013 (edited) 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 November 14, 2013 by quesoph Quote Share this post Link to post Share on other sites
0 mrlongshen 22 Posted November 28, 2013 @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... nah.. like this... Quote Share this post Link to post Share on other sites
0 quesoph 105 Posted November 28, 2013 (edited) 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 November 28, 2013 by quesoph Quote Share this post Link to post Share on other sites
0 mrlongshen 22 Posted November 28, 2013 @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 ?? Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted November 29, 2013 @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 Quote Share this post Link to post Share on other sites
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