Jump to content
  • 0
Sign in to follow this  
Yoh Asakura

GM Shop

Question

Hello,

 

I would like to ask if someone could make this script to me.

 

How it works?

This npc will be available only for GM's above group_id 60. Gm's can purchase items, like the NPC Quest Shop, but here they can purchase for free, however, in order to get the item they first need to tell a reason why they are picking that item. And this will be recorded in SQL, with the 'char name', 'time', 'chosen item', 'reason'.

 

I believe that with this kind of NPC the administrators can control more what GM's are using for Events and see those who are just trying to get items for themselves.

 

 

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

  • 0

change

query_sql( "INSERT INTO `gm_shop_log` ( `account_id`,`char_id`,`name`,`item`,`reason`,`time` ) VALUES ( "+getcharid(3)+","+getcharid(0)+",'"+strcharinfo(0)+"','"+@bought_quantity[0]+"x "+getitemname( @bought_nameid[0] )+"',"+.@reason$+",NOW() ) " );

into

query_sql( "INSERT INTO `gm_shop_log` ( `account_id`,`char_id`,`name`,`item`,`reason`,`time` ) VALUES ( "+getcharid(3)+","+getcharid(0)+",'"+strcharinfo(0)+"','"+@bought_quantity[0]+"x "+getitemname( @bought_nameid[0] )+"','"+.@reason$+"',NOW() ) " );

Share this post


Link to post
Share on other sites
  • 0

 

 

change

query_sql( "INSERT INTO `gm_shop_log` ( `account_id`,`char_id`,`name`,`item`,`reason`,`time` ) VALUES ( "+getcharid(3)+","+getcharid(0)+",'"+strcharinfo(0)+"','"+@bought_quantity[0]+"x "+getitemname( @bought_nameid[0] )+"',"+.@reason$+",NOW() ) " );

into

query_sql( "INSERT INTO `gm_shop_log` ( `account_id`,`char_id`,`name`,`item`,`reason`,`time` ) VALUES ( "+getcharid(3)+","+getcharid(0)+",'"+strcharinfo(0)+"','"+@bought_quantity[0]+"x "+getitemname( @bought_nameid[0] )+"','"+.@reason$+"',NOW() ) " );

Okay, I've changed and now I can put the reason, but if I try to use the npc for the 2nd time, when I put the reason appears an error.

 

post-3532-0-97366100-1432731112_thumb.jpg

Share this post


Link to post
Share on other sites
  • 0

You've changed the SQL Table...now I get this error on my database when I try to create the table:

 

 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AUTO_INCREMENT, `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0', `char_' at line 2

Edited by Yoh Asakura

Share this post


Link to post
Share on other sites
  • 0

I think its better if you will just let the GM Type the item that he/she wants.

 

Ex:

 

Item ID /  Quantity  / Reason

 

 

No, I prefer to make a shop so they can choose, is more easy.

im getting error

 

http://prntscr.com/7c0n6x

 

 

Change this line

-	shop	gm_shop_npc	-1,607:1,608:2,
 

to this

 

-	shop	gm_shop_npc	-1,607:1,608:2
 

After the last item ID you can't use ','

Edited by Yoh Asakura

Share this post


Link to post
Share on other sites
  • 0

@@Emistry

I've just tested here and if I buy more than 1 item I will only receive the 1st item that I put to purchase and on SQL will only appear the 1st item too...

Edited by Yoh Asakura

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...
Sign in to follow this  

×
×
  • Create New...

Important Information

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