Jump to content
  • 0

Freebies how to block same IP


Ernest90

Question


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/04/14
  • Last Seen:  

looking for help for my freebies how to block same ip for claiming? 

 

thank you.

freebies.txt.txt

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  12/04/14
  • Last Seen:  

I use:

- script Only1perIP -1,{
OnPCLoadMapEvent:
set .maps$, "bat_room";
set .@my_map$, strcharinfo(3);
if (compare(","+.maps$+"," , ","+.@my_map$+","))
{
query_sql "SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id " +
"WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") " +
"AND `char`.online=1 AND login.account_id!="+getcharid(3), .@account_id;

for (set .@i,0; .@i<getarraysize(.@account_id); set .@i,.@i+1)
{
getmapxy .@map$,.@x,.@y, 0, rid2name(.@account_id[.@i]);
if (.@map$ == .@my_map$)
{
set .@name$, strcharinfo(0);
announce "Sorry, only 1 char per IP can be on this map at a time.", bc_self;
sleep 1000;
atcommand "@kick " + .@name$;
}
}
}
end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/04/14
  • Last Seen:  

 

I use:

- script Only1perIP -1,{
OnPCLoadMapEvent:
set .maps$, "bat_room";
set .@my_map$, strcharinfo(3);
if (compare(","+.maps$+"," , ","+.@my_map$+","))
{
query_sql "SELECT login.account_id FROM login LEFT JOIN `char` ON login.account_id=`char`.account_id " +
"WHERE login.last_ip=(SELECT last_ip FROM login WHERE account_id="+getcharid(3)+") " +
"AND `char`.online=1 AND login.account_id!="+getcharid(3), .@account_id;

for (set .@i,0; .@i<getarraysize(.@account_id); set .@i,.@i+1)
{
getmapxy .@map$,.@x,.@y, 0, rid2name(.@account_id[.@i]);
if (.@map$ == .@my_map$)
{
set .@name$, strcharinfo(0);
announce "Sorry, only 1 char per IP can be on this map at a time.", bc_self;
sleep 1000;
atcommand "@kick " + .@name$;
}
}
}
end;
}

just add under my script?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  12/04/14
  • Last Seen:  

 

prontera,155,188,5 script Freebies 718,{
 
query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
 
if ( getd("$" + .@lip$ + "_NO") > 0 || #gift > 0)
{
mes "[Freebies]";
mes "Good Day.";
close;
}
 
if( !#Freebies ) {
set #gift, 1;
setd "$" + .@lip$ + "_NO", getd("$" + .@lip$ + "_NO") + 1;
mes "Welcome...this is your gift...";
getitem 2624,2;
getitem 2289,1;
getitem2 2308,1,1,7,0,0,0,0,0;
getitem2 1705,1,1,10,0,0,0,0,0;
getitem2 2528,1,1,7,0,0,0,0,0;
getitem2 2424,1,1,7,0,0,0,0,0;
close;
 

 

 

for example

Edited by SmokeIT
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/04/14
  • Last Seen:  

 

 

prontera,155,188,5 script Freebies 718,{
 
query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
 
if ( getd("$" + .@lip$ + "_NO") > 0 || #gift > 0)
{
mes "[Freebies]";
mes "Good Day.";
close;
}
 
if( !#Freebies ) {
set #gift, 1;
setd "$" + .@lip$ + "_NO", getd("$" + .@lip$ + "_NO") + 1;
mes "Welcome...this is your gift...";
getitem 2624,2;
getitem 2289,1;
getitem2 2308,1,1,7,0,0,0,0,0;
getitem2 1705,1,1,10,0,0,0,0,0;
getitem2 2528,1,1,7,0,0,0,0,0;
getitem2 2424,1,1,7,0,0,0,0,0;
close;
 

 

 

 

 

is not working. npc did not appear. :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  5
  • Reputation:   0
  • Joined:  12/04/14
  • Last Seen:  

download

Edited by SmokeIT
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/04/14
  • Last Seen:  

download

 

This time i click npc doesnt get anything. sorry about that

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