Jump to content
  • 0

Freebies how to block same IP


Question

6 answers to this question

Recommended Posts

Posted

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;
}
Posted

 

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?

Posted (edited)

 

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
Posted

 

 

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

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