Jump to content
  • 0
caspe

IP address based G pack

Question

Hello,

i like to have script which gives G Pack based on IP, not account based.

it should store the last IP of players who already claim the G Pack.

 

I'm currently using this script

Spoiler

turbo_room,99,115,4    script    Gpack    4W_KID,{

if( !#Gpack ){
set #Gpack,1;
mes "Welcome...this is your G pack...";


getitem2 2424,1,1,7,0,0,0,0,0;
getitem2 2528,1,1,7,0,0,0,0,0;
getitem 2115,1;
getitem 7720,30;
getitem 7539,10;


}else{
mes "You have already claim the G pack.";
}
close;
}

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0
Spoiler

set .@n$, "[Seyra]";
setarray .@rwd[0],2115,1,2357,1,2421,1,2524,1; // Rewards: <item id>,<item amount>
query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0)
    {
        mes .@n$;
        mes "I'm sorry, the rewards are exclusively for new players.";
        close;
    }
    mes .@n$;
    mes "Welcome! Here are some free gifts";
    mes "for newcomers:";
        for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
        mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]);
        close2;
        set #NewbieGift, 1;
        setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;
        for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
        getitem .@rwd[.@i], .@rwd[.@i+1];
end;

OnInit:
waitingroom "Newbie Gift!",0;
end;
}

this script which was posted by @Anakid working fine, but how can i use getitem2 in it?

because i wan't also give +7 equips. 

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, caspe said:
  Hide contents

set .@n$, "[Seyra]";
setarray .@rwd[0],2115,1,2357,1,2421,1,2524,1; // Rewards: <item id>,<item amount>
query_sql ("SELECT `last_ip` FROM `login` WHERE `account_id`=" + getcharid(3) + "", .@lip$);
if ( getd("$" + .@lip$ + "_NG") > 0 || #NewbieGift > 0)
    {
        mes .@n$;
        mes "I'm sorry, the rewards are exclusively for new players.";
        close;
    }
    mes .@n$;
    mes "Welcome! Here are some free gifts";
    mes "for newcomers:";
        for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
        mes .@rwd[.@i+1] + " x " + getitemname(.@rwd[.@i]);
        close2;
        set #NewbieGift, 1;
        setd "$" + .@lip$ + "_NG", getd("$" + .@lip$ + "_NG") + 1;
        for ( set .@i, 0; .@i < getarraysize(.@rwd); set .@i, .@i + 2 )
        getitem .@rwd[.@i], .@rwd[.@i+1];
end;

OnInit:
waitingroom "Newbie Gift!",0;
end;
}

this script which was posted by @Anakid working fine, but how can i use getitem2 in it?

because i wan't also give +7 equips. 

The simpler way is just adding getitem2 under the getitem on the script, with static values like on the first one. But remember, someone with dynamic IP can receive multiple G Packs.

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

×
×
  • Create New...

Important Information

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