Jump to content
  • 0

Script not working properly. Always recognizing item.


HristDead

Question


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Hi

 

I have this script and can't figure out what the problem is. what it does is count items in the loadmapevent and warping back the player when the items are in the array. I have also tried to add in a cart check, but it always seems to find a brynhild (2383) in my cart? I know it's in the array but it even finds it when my cart is empty..

 

What did I do wrong? Please help me great scripters.  :)

-    script    Vanilla1    -1,{




OnPCLoadMapEvent:

getmapxy(.@map$,.@mapx,.@mapy,0);

if(.@map$ == "prtg_cas01"){

    for(set .@i,0; .@i < getarraysize(.itemcheck); set .@i, .@i + 1){

        if(countitem(.itemcheck[.@i])){

            dispbottom "[ Info ] : item ["+getitemname(.itemcheck[.@i])+"] found (Inventory). Kicking..";            

            warp "prontera",200,180;

            end;

            }

        query_sql("SELECT `nameid` FROM `cart_inventory` WHERE `char_id` = " + getcharid(0), .itemcheck[0]);

            dispbottom "[ Info ] : item ["+getitemname(.itemcheck[.@i])+"] found (Cart). Kicking..";            

            warp "prontera",200,180;

           end;

        }

    }

end;





OnInit:

setarray .itemcheck[0],2383,2204,20025,20026,20027,20028,20029,20030,20031,20032,20033;

end;

}





prtg_cas01    mapflag    loadevent
Edited by HristDead
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

Wouldn't it be better just to configure this in the server files in the item_noequip.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

Wouldn't it be better just to configure this in the server files in the item_noequip.txt

 

Too many items.. and I already listed down all the id's. I am using map_zone_db.conf (hercules) which work on item names and not id's. :(

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

you can try this

http://upaste.me/r/996569

 

data that stored in sql something it need more time to update it.

it's better to check it in game and not from the database itself.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

you can try this

http://upaste.me/r/996569

 

data that stored in sql something it need more time to update it.

it's better to check it in game and not from the database itself.

 

Hi emistry senpai. I tried your script but I have an error here on this line. Any idea?:

 

e6srrk.png

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

update your rAthena.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

update your rAthena.

 

using hercules. probably not possible like this with hercules, right? 

I got it working with SQL but I had to alter the map server.conf auto save time. I'm a bit scared that with many players, my server will be overload.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

you can try convert the source mod to Hercules 

https://github.com/rathena/rathena/commit/01c30bf

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  29
  • Topics Per Day:  0.01
  • Content Count:  270
  • Reputation:   20
  • Joined:  12/10/11
  • Last Seen:  

 

update your rAthena.

 

using hercules. probably not possible like this with hercules, right? 

I got it working with SQL but I had to alter the map server.conf auto save time. I'm a bit scared that with many players, my server will be overload.

 

 

Hercules should actually have a better way of doing it, I will look into it for you

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  66
  • Topics Per Day:  0.01
  • Content Count:  167
  • Reputation:   2
  • Joined:  08/01/12
  • Last Seen:  

 

 

update your rAthena.

 

using hercules. probably not possible like this with hercules, right? 

I got it working with SQL but I had to alter the map server.conf auto save time. I'm a bit scared that with many players, my server will be overload.

 

 

Hercules should actually have a better way of doing it, I will look into it for you

 

 

Herc doesnt have checkcart command sadly but thanks >.<

 

The problem with SQL query with this.. it only saves the sql db once every X minutes unless i change the settings in my map-server.conf, but I'm affraid that'll overload my server with many online players.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

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