Jump to content
  • 0

Query Insert HELP


Question

Posted

Hi guys... Im having problem with this code.

It doesnt store the items in the storage.

					if ($@members > 9){set .@greward,2;}
					else if ($@members > 14) { set .@greward,3; set .@areward,1; }
					else if ($@members > 19) { set .@greward,4; set .@areward,2; }
					else if ($@members == 25) { set .@greward,5; set .@areward,3; }
					else {set .@greward,1;}

				mes .@n$;
				mes "Processing....";
				next;
				mes .@n$;
				mes "All items are stored to your storage please check.";
		

					
					for( set .@i, 0; .@i < getarraysize(.@Gitem); set .@i, .@i + 1 ){
						query_sql("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Gitem[.@i]', '.@GAmount[.@i]*.@greward', '1')");
					}

					if ($@members > 14){
							for( set .@i, 0; .@i < getarraysize(.@Aitem); set .@i, .@i + 1 ){
								query_sql("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Aitem[.@i]', '.@AAmount[.@i]*.@areward', '1')");
							}
					}

					set #Claimed, 1;
					set $@members,0;
					set .@greward,0;
					set .@areward,0;

				close;			

prontera,164,161,4	script	Guild Admin	88,{


		//Directly stored in the guild master storage.
		setarray .@Gitem[0],	14003,  13995,  14004,  13989, 13414,  5170,  2701,  2624,  2729,  2424, 2528,  2285;	//Item Number
		setarray .@GAmount[0], 25,     25,     25,     25,    1,     1,     1,     2,     1,     5,    5,     2;	//Amount

		//Additional Items for 15+ Members
		setarray .@Aitem[0],  1228,  5518,  5137,  5423; 	//Item Number
		setarray .@AAmount[0],   1,     1,     1,     1; 	//Amount

		set .@n$, "[Guild Admin]";	// Input the NPC name.
		set .check,1;			// Set 1 if you have harmony , Set 0 if you don't have harmony

		set .@guild, getcharid(2);	
		set .@acc, getcharid(3);	

3 answers to this question

Recommended Posts

Posted (edited)

can you plz post the complete script?

    if ($@members > 9){set .@greward,2;}
                    else if ($@members > 14) { set .@greward,3; set .@areward,1; }
                    else if ($@members > 19) { set .@greward,4; set .@areward,2; }
                    else if ($@members == 25) { set .@greward,5; set .@areward,3; }
                    else {set .@greward,1;}

                mes .@n$;
                mes "Processing....";
                next;
                mes .@n$;
                mes "All items are stored to your storage please check.";
        

                    
                    for( set .@i, 0; .@i < getarraysize(.@Gitem); set .@i, .@i + 1 ){
                        query_sql("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Gitem[.@i]', '.@GAmount[.@i]*.@greward', '1')");
                    }

                    if ($@members > 14){
                            for( set .@i, 0; .@i < getarraysize(.@Aitem); set .@i, .@i + 1 ){
                                query_sql("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Aitem[.@i]', '.@AAmount[.@i]*.@areward', '1')");
                            }
                    }

                    set #Claimed, 1;
                    set $@members,0;
                    set .@greward,0;
                    set .@areward,0;

                close;            

change that for this

 

 if ($@members > 9){set .@greward,2;}
                    else if ($@members > 14) { set .@greward,3; set .@areward,1; }
                    else if ($@members > 19) { set .@greward,4; set .@areward,2; }
                    else if ($@members == 25) { set .@greward,5; set .@areward,3; }
                    else {set .@greward,1;}


                mes .@n$;
                mes "Processing....";
                next;
                mes .@n$;
                mes "All items are stored to your storage please check.";
        


                    
                    for( set .@i, 0; .@i < getarraysize(.@Gitem); set .@i, .@i + 1 ){
                       set .@acc_idl, getcharid(3) ;
                                query_sql ("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Gitem[.@i]', '.@GAmount[.@i]*.@greward', '1') WHERE `account_id` = '"+ .@acc_id +"'");
                    }


                    if ($@members > 14){
                            for( set .@i, 0; .@i < getarraysize(.@Aitem); set .@i, .@i + 1 ){
                            set .@acc_idl, getcharid(3) ;
                                query_sql ("INSERT INTO `storage` (`id`, `account_id`, `nameid`, `amount`, `identify`) VALUES (NULL, '.@acc', '.@Gitem[.@i]', '.@GAmount[.@i]*.@greward', '1') WHERE `account_id` = '"+ .@acc_id +"'");
                            }
                    }


                    set #Claimed, 1;
                    set $@members,0;
                    set .@greward,0;
                    set .@areward,0;
close;  
Edited by Dynasty

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...