Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- DROP TABLE IF EXISTS `geworben`;
- CREATE TABLE `geworben` (
- `account_id` int(11) NOT NULL,
- `friend_id` int(11) NOT NULL,
- `message` text NOT NULL,
- `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- `confirmed` int(11) NOT NULL,
- `name` text NOT NULL,
- PRIMARY KEY (`account_id`)
- ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
- */
- //===== ExRO Scripts =========================================
- //= Player advertised with accept/decline & SQL
- //===== By: ==================================================
- //= Innos [rA n00B with bad English]
- //===== Current Version: =====================================
- //= Alpha -0,001
- //============================================================
- prontera,155,175,6 script Test 606,{
- set .@npc$, "[^FF0000User werben User^000000]";
- mes .@npc$;
- mes "Would you like to get your picture taken with Santa?";
- if( Select( "^008800Recruit Friend^000000", "See all advertised", "Beenden" ) == 3 )
- close;
- //-> advertised friends list
- if( @menu == 2 ) {
- next;
- set .@c1, Query_SQL( "SELECT `name`, DATE_FORMAT(`time`, '%d.%m.%Y'), `confirmed` FROM `geworben` WHERE `account_id` = " + GetCharID( 3 ), .@Friend$, .@date$, .@confirmed );
- if( .@c1 == 0 ) {
- mes .@npc$;
- mes "^FF0000No advertised Friends found^000000";
- close;
- }
- if( .@confirmed == 0 ) {set .@con$, "Wait";} if( .@confirmed == 1 ) {set .@con$, "declined";} if( .@confirmed == 2 ) {set .@con$, "accept";}
- mes "[^FF0000Recruited Friends - " + .@c1 + " Accounts^000000]";
- mes "[Nr] <Name> (<Date) [Answer]";
- for( set .@i, 0; .@i < .@c1; set .@i, .@i + 1 )
- mes "[" + ( .@i + 1 ) + "] " + .@Friend$[ .@i ] + " (" + .@date$[ .@i ] + ") " + .@con$[ .@i ] + "";
- close;
- }
- //-> search player
- mes "Player Name?";
- do {
- Input( .@name$ );
- set .@c, Query_Sql( "SELECT `account_id` FROM `char` WHERE `name` = '" + .@name$ + "'", .@FriendID );
- next;
- if( .@c == 0 ) {
- mes "^ff0000'" + .@name$ + "' not found!^000000";
- if( Select( "Please try again", "Quit" ) == 2 )
- close;
- }
- } while( .@c < 1 );
- mes .@npc$;
- mes "^0000FFPlayer^000000: " + .@name$ + " ";
- mes "found.";
- next;
- //-> add player
- if( @menu == 1 ) {
- if( Select( "Entry Player!", "Quit!" ) == 2 ){
- mes "^ff0000cancelled...^000000";
- close;
- }
- //-> request already exist
- Query_SQL( "SELECT `friend_id` FROM `geworben` WHERE `friend_id` = '" + .@FriendID + "'", .@check );
- if( .@check > 0 ){ // Friend ID already in Table
- mes "^ff0000For this action an inquiry already exists!^000000";
- close;
- }else{
- mes "Please insert a Message!";
- Input( .@message$ );
- Query_SQL( "INSERT INTO `geworben` VALUES ( " + .@WerberID + ", " + .@FriendID + ", '" + .@message$ + "', '0000-00-00 00:00:00', '0', '" + .@name$ + "' );" );
- next;
- }
- }
- mes "^0000FFPlayer^000000: " + .@name$ + " ";
- mes "^0000FFMessage^000000: " + .@message$ + " ";
- close;
- OnPCLoginEvent:
- if( Query_SQL( "SELECT `message`, `account_id` FROM `geworben` WHERE `friend_id` = " + GetCharID( 3 ), .@message$, .@aid ) == 0 )
- end;
- Query_SQL( "UPDATE `geworben` SET `time` = NOW() WHERE `friend_id` = " + GetCharID( 3 ) );
- mes "[^FF0000User werben User^000000]";
- mes "Somebody has you recruited!";
- mes "^FF0000---- Name/Nachricht ----^000000";
- mes .@aid[ 0 ];
- mes .@message$[ 0 ];
- next;
- mes "Is this wrong or right?";
- if( Select( "Right!!", "Wrong." ) == 2 ){
- mes "^ff0000You have rejected.^000000";
- Query_SQL( "UPDATE `geworben` SET `confirmed` = '1' WHERE `account_id` = " + .@aid );
- close;
- }else{
- mes "You have confirmed!";
- Query_SQL( "UPDATE `geworben` SET `confirmed` = '2' WHERE `account_id` = " + .@aid );
- mes "^008800successfully recorded!^000000";
- close;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement