Jump to content

Virtue

Members
  • Content Count

    259
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Virtue


  1. Hi All,

    I need help with a quick SQL query script.

    -    script    testcharname#Testserver    FAKE_NPC,{
    
    OnInit:
    bindatcmd("testingname","testcharname#Testserver::OnTestName",99);
    
    OnTestName:
    mes "GO";
    input .@name$;
    next;
    query_sql "SELECT charid,name FROM `char` WHERE `name` = "+.@name$,.@charid,.@gname$;
        if(.@gname$ == .@name$){
        mes "Hey";
        dispbottom ("["+.@charid+"]",0x00FA9A);
        close;
        } else {
        mes "Hoy";
        dispbottom ("Character doesn't exist.",0x00FA9A);
        close;
        }
    }

    I need to get results if the input is valid, if not will display "character doesn't exist". Got no errors on script checker but script doesn't proceed. I think there's something wrong with my query and I'm not getting results


  2. Hi,

    I'm at a loss about this script. No Errors on script checker, it's just that once the set VIP time expires sometimes it goes on negative and the VIP time doesn't end.

    Any help would be appreciated!

    Script below

     
    
    function	script	timeleft__	{
    	if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
    	.@day = .@left / 86400;
    	.@hour = .@left % 86400 / 3600;
    	.@min = .@left % 3600 / 60;
    	.@sec = .@left % 60;
    	if ( .@day )
    		return .@day +" day "+ .@hour +" hour";
    	else if ( .@hour )
    		return .@hour +" hour "+ .@min +" min";
    	else if ( .@min )
    		return .@min +" min "+ .@sec +" sec";
    	else
    		return .@sec +" sec";
    }
    
    
    prontera,150,150,0	script	VIP Administrator	4_F_KAFRA5,{
    	set .@npcname$,"^0000FF[ TEst ]^000000";
    	if ( getgroupid() > 1 ) {
    		mes .@npcname$;
    		mes "Hell no, you shouldn't use me !";
    		close;
    	}
    	if ( #viptimeleft ) {
    		mes .@npcname$;
    		mes "Your time left for being a VIP is "+ callfunc( "timeleft__", #viptimeleft - gettimetick(2) )+".";
    		close;
    	}
    	mes .@npcname$;
    	mes "How can I help?";
    	next;
    	if ( select( "What's a VIP?", "Nothing" ) == 2 ) close;
    	mes .@npcname$;
    	mes "You'll get the following benefits for being a VIP:";
    	mes "Server rates increased while on VIP Status";
    	mes "^9ACD32Base & Job Exp - 12x^000000";
    	mes "^FF4500Equipment - 6x^000000";
    	mes "^FF0000Cards - 0.12%^000000";
    	mes "^00BFFFUsable, Healing & Common Drop - 7x^000000";
    	mes "^FF0000Death Penalty - 0.5%^000000";
    	close;
    	
    OnPCLoginEvent:
    	if ( #viptimeleft >= 0 ) {
    		ModExp = 125;
    		ModDrop = 125;
    		ModDeath = 50;
    		dispbottom ("VIP: Your time left for being a VIP is "+ callfunc( "timeleft__", #viptimeleft - gettimetick(2) ) +".",0xFF7256);
    		}
    	if ( #viptimeleft < gettimetick(2) )
    		set #viptimeleft,0;
    	else if ( #viptimeleft - gettimetick(2) < 2147483 ) // don't execute addtimer if over integer limit
    		addtimer(( #viptimeleft - gettimetick(2))*1000, strnpcinfo(NPC_NAME_UNIQUE)+"::OnTimeUp");
    	else if ( #viptimeleft < 0)
    	ModExp = 100;
    	ModDrop = 100;
    	ModDeath = 100;
    	end;
    	
    OnTimeUp:
    	announce "[ VIP : Your VIP Subcription has Expired. ]",bc_self,0xffbc90;
    	dispbottom ("VIP: Your VIP Subcription has Expired.",0xFF7256);
    	#viptimeleft = 0;
    	ModExp = 100;
    	ModDrop = 100;
    	ModDeath = 100;
    	end;
    }

  3. 19 minutes ago, Gra Des Illus said:

    OIS does thies error still not yet fix? so when you feed pet you client will crash is it something like that?

    Fixing it is really easy, just change the line 2579 on your msgstringinfo to 

    Feeding the pet. '%s' (%d) remaining#

    (this is also applicable to client date 2015-09-16aRagexe.exe)

×
×
  • Create New...

Important Information

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