Jump to content
  • 0

Help how to make it 1 Per IP


PewN

Question


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

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;
 
}
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


- 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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

-	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 :)

Link to comment
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.   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.

×
×
  • Create New...