Jump to content
  • 0
Sign in to follow this  
Petey Pablo

Need script expert for Gpack

Question

how to add required level 50 guild here

 

prontera,164,163,3    script    Guild Package    4W_SAILOR,{    
.@req_online = 2; // how many players need to online to claim. 
.@req_lv = MAX_LEVEL; // minimum level of .@online players that has to be. 
if ( !getcharid(2) ) 
{        
mes "[ Guild Package ]";
mes "you must have a guild";        
close;    
}    
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) 
{        
mes "[ Guild Package ]";
mes "you are not a guild master";        
close;    
}    
getguildmember getcharid(2), 1;    
getguildmember getcharid(2), 2;    
for ( .@i = 0; .@i < $@guildmembercount; .@i++ )        
if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) )            
.@online++;    if ( .@online < .@req_online ) 
{        
mes "[ Guild Package ]";
mes "your guild must have "+ .@req_online +" guild members online";        
close;    
}    
    .@origin = getcharid(3);    
        for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) 
    {        
        if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) 
        {            
            attachrid $@guildmemberaid[.@i];            
            if ( BaseLevel < .@req_lv ) 
        {                
            .@deny_name$[.@c] = strcharinfo(0);                
            .@c++;            
        }        
    }    
}    attachrid .@origin;    if ( .@c ) 
        {        
            mes "[ Guild Package ]";
            mes "there are "+ .@c +" member does not meet the level requirement";        
            mes implode( .@deny_name$, "," );        
            close;    
        }    
            for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) 
        {        
            if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) 
            {            
                attachrid $@guildmemberaid[.@i];            
                if ( #guild_package_claimed ) 
                {                
                .@deny_name$[.@c] = strcharinfo(0);                
                .@c++;            
                }        
            }    
        }    
        attachrid .@origin;    if ( .@c ) 
        {        
        mes "[ Guild Package ]";
        mes "there are "+ .@c +" members already claimed this package within their account";        
        mes implode( .@deny_name$, "," );        
        close;    
        }    if ( query_sql( "select account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2) +" group by last_ip", .@aid, .@ip$ ) < .@req_online ) 
        {        
        mes "[ Guild Package ]";
        mes "same ip detected";        
        .@nb = query_sql( "select name, account_id as aaa, ( select last_ip from login where account_id = aaa ) as last_ip from guild_member where guild_id = "+ getcharid(2), .@name$, .@aid, .@ip$ );        
        for ( .@i = 0; .@i < .@nb; .@i++ )            
        mes "[ Guild Package ]";
        mes (.@i +1)+". "+ .@name$[.@i] +" ("+ .@ip$ +")";        
        next;    
        }    
        mes "[ Guild Package ]";
        mes "Congratulations! Your Gpack has been claimed!";    for ( .@i = 0; .@i < $@guildmembercount; .@i++ ) 
        {        
        if ( isloggedin( $@guildmemberaid[.@i], $@guildmembercid[.@i] ) ) 
        {            
        attachrid $@guildmemberaid[.@i];            
        if ( getguildmasterid( getcharid(2) ) != $@guildmembercid[.@i] )                
        getitem 14232, 100; // Yggberry Box
        else                
        getitem 14232, 100; // Yggberry Box
        getitem 30110, 100; // Box Of Thunder Box
        getitem 14004, 100; // EDP Box
        getitem 31051, 20; // Credits
        getitem 4302, 1; // Tao Gunka
        getitem 4305, 2; // Turtle
        getitem 4121, 2; // Phreeoni
        getitem 4174, 1; // Deviling
        getitem 4047, 1; // Ghostring
        getitem 4128, 1; // GTB
        getitem 4146, 1; // Maya
        getitem 4352, 1; // Gen Egnihem
        getitem 7227, 100; // Voting Proof Ticket
        #guild_package_claimed = 1;        
        }    
    }    
    attachrid .@origin;    close;
}
 

 

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

 

 

Correct me if i did wrong

 

Hope this works  *tho, I never tried this one in-game*

 

insert this on your script

 

EDIT: i forgot to attach player id on getcharid

 

 

query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '" + getcharid(2, ""+strcharinfo(0)+"") + "'",.@gldlvl;

	if (.@gldlvl < 50) {
		mes "Sorry, your guild level didn't reach it's level requirement.";
		close;
		
	}

 

Insert in what line? Thanks man for the help.

 

 

 

 

 

 

Add it below this:

 

if ( !getcharid(2) ) 
{        
mes "[ Guild Package ]";
mes "you must have a guild";        
close;    
} 

Share this post


Link to post
Share on other sites
  • 0

Correct me if i did wrong

 

Hope this works  *tho, I never tried this one in-game*

 

insert this on your script


EDIT: i forgot to attach player id on getcharid

 

 

query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '" + getcharid(2, ""+strcharinfo(0)+"") + "'",.@gldlvl;

	if (.@gldlvl < 50) {
		mes "Sorry, your guild level didn't reach it's level requirement.";
		close;
		
	}
Edited by Legend

Share this post


Link to post
Share on other sites
  • 0

 

Correct me if i did wrong

 

Hope this works  *tho, I never tried this one in-game*

 

insert this on your script

 

EDIT: i forgot to attach player id on getcharid

 

 

query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '" + getcharid(2, ""+strcharinfo(0)+"") + "'",.@gldlvl;

	if (.@gldlvl < 50) {
		mes "Sorry, your guild level didn't reach it's level requirement.";
		close;
		
	}

 

Insert in what line? Thanks man for the help.

Share this post


Link to post
Share on other sites
  • 0

 

 

 

 

 

Correct me if i did wrong

 

Hope this works *tho, I never tried this one in-game*

 

insert this on your script

 

EDIT: i forgot to attach player id on getcharid

 

 

query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '" + getcharid(2, ""+strcharinfo(0)+"") + "'",.@gldlvl;	if (.@gldlvl < 50) {		mes "Sorry, your guild level didn't reach it's level requirement.";		close;			}

Insert in what line? Thanks man for the help.

 

 

 

 

 

Add it below this:

if ( !getcharid(2) ) {		mes "[ Guild Package ]";mes "you must have a guild";		close;	}

Not working :wacko:

 

Untitled.png

Edited by Will Su

Share this post


Link to post
Share on other sites
  • 0

Afaik, you need to wait 60 seconds after changes have been done with your guild level since you are sending query to sql

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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