Jump to content

bambang777

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by bambang777

  1. 2 hours ago, Winterfox said:

    Hello,

    try this:

    mall01, 92, 135, 5	script	Guild Vip Registrar	612,{
        if(getcharid(2) == 0) {
            mes .NPC$;
    		mes "You need to be in a guild to use my services.";
    		close;
        }
    
        query_sql("SELECT TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2),	.@secondsUntilExpiration);
    	if (.@secondsUntilExpiration > 0)  {
    		mes .NPC$;
    		mes "Dear " + strcharinfo(0) + ", your guild " + strcharinfo(2) + " has still vip status. So there is nothing i can really help you with.";
    		close;
    	}
    
    	mes .NPC$;
    	mes "Hello " + strcharinfo(0) + ", What can i do for you?";
    	next;
    
    	if (select("- I want to make my guild vip:- Nothing") - 1) close;
    	
    	mes .NPC$;
    	mes "Okay, to make your guild vip you need the following: ";
    	mes "- " + .Amount +  " x "  + getitemname(.ID);
    	next;
    	mes .NPC$;
    	mes "So what do you want now?";
    	next;
    
    	if (select("Yes, i have those requirements:I'll think over it again") - 1) close;
    	
    	mes .NPC$;
    	mes "Let me check your items to ensure that you meet the requirements.";
    	next;
    
    	if (countitem(.ID) < .Amount) {
    		mes .NPC$;
    		mes "Sorry " + strcharinfo(0) + ", it seems like you don't meet the requirements.";
    		close;
    	}
    
    	mes .NPC$;
    	mes "Alright then, i will register your guild as a vip guild.";
    	query_sql "INSERT INTO `vip_guild` (`guild_id`, `expiration_time`) VALUES (" + getcharid(2) + ", DATE_ADD(NOW(), INTERVAL 1 MONTH))";
    	delitem .ID, .Amount;
    	close;
    
        OnPCLoginEvent:
            .@rowCount = query_sql("SELECT TIMESTAMPDIFF(DAY, NOW(), expiration_time), TIMESTAMPDIFF(SECOND, NOW(), expiration_time) FROM vip_guild WHERE `guild_id` = " + getcharid(2),
       		.@daysUntilExpiration,
    		.@secondsUntilExpiration);
    
    		if(.@rowCount == 0) end;
    
            if (.@secondsUntilExpiration <= 0) {
                dispbottom "Your guilds vip state has expired";
                query_sql("DELETE FROM `vip_guild` WHERE `guild_id` = " + getcharid(2));
                end;
            }
    
            dispbottom "Hello " +strcharinfo(0)+ ", your guilds vip state ends in " + callfunc("F_InsertPlural", .@daysUntilExpiration, "day") + ".";
        end;
    
        OnInit:
            .NPC$ = "[ " +strnpcinfo(1)+ " ]";
            .Amount = 30;
            .ID = 51582;
    
            query_sql("CREATE TABLE IF NOT EXISTS `vip_guild` (`guild_id` INT NOT NULL, `expiration_time` DATETIME NOT NULL, PRIMARY KEY (guild_id)) ENGINE=INNODB");
    }

     

    thanks, it's work. just a little change at "ENGINE". from "INNODB" to "InnoDB"

  2. mall01,92,135,5	script	GVip Regist	612,{
    if (gettimetick(2) < #gtimer)  {
    	mes .NPC$;
    	mes "Dear " +strcharinfo(2)+ ", you are still a vip guild. You cannot talk to me until you are not a vip guild";
    	close;
    }
    mes .NPC$;
    mes "Hello " +strcharinfo(2)+ ", What can i do for you?";
    next;
    if (select("- I want to be a vip:- Nothing") - 1) close;
    mes .NPC$;
    mes "Okay then, before you become a vip you need the following : ";
    mes "- " +.Amount+ "x " +getitemname(.ID);
    next;
    mes .NPC$;
    mes "So what do you want now?";
    next;
    if (select("Yes, i have those requirements:I'll think over it again") - 1) close;
    mes .NPC$;
    mes "Let me check your items to ensure that you have my requirements";
    next;
    if (countitem(.ID) < .Amount) {
    	mes .NPC$;
    	mes "Sorry " +strcharinfo(2)+ " seems like you doesn't meet my requirements.";
    	close;
    }
    mes .NPC$;
    mes "Alright then, i will register your guild as a vip, guild" +getcharid(2)+ "must be relog";
    set .@timeConverter, .Days * 24 * 60 * 60;
    query_sql "INSERT INTO `vip_guild` (`guild_id`, `time`) VALUES ('"+getcharid(2)+"', '"+.@timeConverter+"')";
    delitem .ID, .Amount;
    set #gtimer,gettimetick(2) + .@timeConverter;
    close2;
    
    OnPCLoginEvent:
    	if (gettimetick(2) > #gtimer) {
    		dispbottom "Your vip guild is already expired";
    		query_sql "DELETE FROM `vip_guild` WHERE `guild_id` = '"+getcharid(2)+"'";
    		end;
    	}
    	set .@timeInSeconds, #gtimer - gettimetick(2);
    	set .@daysLeft, .@timeInSeconds/60/60/24;
    	dispbottom "Hello " +strcharinfo(2)+ " your vip guild still have " +.@daysLeft+ " days";
    	end;
    
    OnInit:
    	.NPC$ = "[ " +strnpcinfo(1)+ " ]";
    	.Amount = 30;
    	.ID = 51582;
    	.Days = 30;
    	query_sql "CREATE TABLE IF NOT EXISTS `vip_guild` (`guild_id` INT NOT NULL, `time` INT NOT NULL) ENGINE=MyISAM";
    	end;	
    }

    This script has a bug, when guild members login at the same time it will be erased faster in SQL, how to edit the Vip Guild System run smoothly? I mean how can this VIP guild run out for 1 month? Please help me

  3. this happened 3 days ago when I was about to compile, I tried to shut down the server and then I used the command "./configure" then "make clean" and "make sql" but then an error occurred (I don't have the photo), after that today I tried again it turned out the file "athena-start" error and there is a corruption file,image.png.3fb6994ae8dd67f13b81dd671c742a4e.png
     tried to get the file on github and in the end it happened athena-start permission denied
    I'm newbie, please help

×
×
  • Create New...