Jump to content
  • 0

Help how to make it 1 Per IP


Question

Posted

Help how to make it 1 Per IP

 
-    script    faith    -1,{
 
OnPCLoginEvent:
if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }
    if(gettime(4) == 6) goto L_7Day;
    message strcharinfo(0), "You received 5 Loyalty Points";
    set #LoyaltyPoints,#LoyaltyPoints+5;
    set #faithd,gettimetick(2);
    set #consecutive,#consecutive+1;
    end;
 
L_7Day:
if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }
    if(#consecutive == 7){
        set #consecutive,1;
        set #LoyaltyPoints,#LoyaltyPoints+20;
        message strcharinfo(0), "Congratulations, You receive 20 Loyalty Points";
        set #faithd,gettimetick(2);
        end;
    }
    message strcharinfo(0), "You received 5 Loyalty Points";
    set #LoyaltyPoints,#LoyaltyPoints+5;
    set #faithd,gettimetick(2);
    set #consecutive,1;
    end;
 
}

2 answers to this question

Recommended Posts

Posted


- script faith -1,{

OnPCLoginEvent:

if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }

.@size = query_sql( "SELECT `login`.`account_id` FROM login LEFT JOIN `char` ON `login`.`account_id`= `char`.`account_id` WHERE `login`.`last_ip` LIKE '"+ escape_sql( getcharip() ) +"' and `char`.`online` = 1", .@acc_id );

if ( .@size > 1 ) end;

if(gettime(4) == 6) goto L_7Day;

message strcharinfo(0), "You received 5 Loyalty Points";

set #LoyaltyPoints,#LoyaltyPoints+5;

set #faithd,gettimetick(2);

set #consecutive,#consecutive+1;

end;

L_7Day:

if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }

if(#consecutive == 7){

set #consecutive,1;

set #LoyaltyPoints,#LoyaltyPoints+20;

message strcharinfo(0), "Congratulations, You receive 20 Loyalty Points";

set #faithd,gettimetick(2);

end;

}

message strcharinfo(0), "You received 5 Loyalty Points";

set #LoyaltyPoints,#LoyaltyPoints+5;

set #faithd,gettimetick(2);

set #consecutive,1;

end;

}

  • Upvote 1
Posted
-	script	faith	-1,{
 
OnPCLoginEvent:
if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }
	.@size = query_sql( "SELECT `login`.`account_id` FROM login LEFT JOIN `char` ON `login`.`account_id`= `char`.`account_id` WHERE `login`.`last_ip` LIKE '"+ escape_sql( getcharip() ) +"' and `char`.`online` = 1", .@acc_id );
	if ( .@size > 1 ) end;
    if(gettime(4) == 6) goto L_7Day;
    message strcharinfo(0), "You received 5 Loyalty Points";
    set #LoyaltyPoints,#LoyaltyPoints+5;
    set #faithd,gettimetick(2);
    set #consecutive,#consecutive+1;
    end;
 
L_7Day:
if(gettimetick(2) - #faithd < (60 * 60 * 24)){ end; }
    if(#consecutive == 7){
        set #consecutive,1;
        set #LoyaltyPoints,#LoyaltyPoints+20;
        message strcharinfo(0), "Congratulations, You receive 20 Loyalty Points";
        set #faithd,gettimetick(2);
        end;
    }
    message strcharinfo(0), "You received 5 Loyalty Points";
    set #LoyaltyPoints,#LoyaltyPoints+5;
    set #faithd,gettimetick(2);
    set #consecutive,1;
    end;
 
}

thx capuche. i will try this :)

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