Jump to content

GM Query Command NPC


Recommended Posts


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

GM Query Command NPC

This script is only for those who understand SQL commands and want to execute custom query's on their SQL server.

Features:

- You can easily request values by the SELECT command ingame.

- You can easily update values by the UPDATE command ingame.

- You can type your own SQL query; SELECT, UPDATE, DELETE and INSERT INTO are supported.

- Password protection

- GM level protection

- Customize Protection, enable/disable password and minimal GM level

- Easy setup

Requirements:

- Knowledge of SQL Query's

- SQL Server

Variables:

You have to edit these variables to customize the npc (please leave the credits enabled):

//edit variables below:

set @passwordenable,1; //set to 0 if you don't wan't to use a password

set @passwordmysql$,"sql"; //password to use the npc

set @namenpcsql$,"

"; //name of the npc

set @sqlcredits,1; //set to 0 if you don't want to see my credits

set @sqlgmlvl,90; //Minimum level of the GM allowed use this NPC, default is 90

[b]Credits:[/b]

I wrote this script a year ago while I was traveling home from school. So all credits go to me I suppose; Dodowvogel =)!.

[b]Support:[/b]

If you have any questions, suggestions or bugs, please post them over here so I can help you and/or improve the script.

[b]Warning:

Be sure you don't give all GM's access to this npc. They will be able to delete tables from your database so your server/database screws up bigtime! [/b][/font]

sqlnpc.txt

Edited by dodowvogel
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

some suggestions if you don't care:

- use npc variables "." instead of temporary variable attached to the character "@"

- set those variables under a OnInit label so it doesn't need to be set everytime a character talks with the NPC

- I don't really like scripts that set the npc name under a variable since you can easily change it with search & replace, but if you really really want to, I sugest you to use strnpcinfo(1) instead

- use escape_sql() to escape strings

- put next; before any menu so you don't need to put next; after every label you call xD

- change menus into switches :D

- take a look at the new commands added to rA from toastofdoom string manipulation pack, I'm pretty sure that you can use some at your npc and improve it!

All in all, good NPC, thanks for the share.

Link to comment
Share on other sites


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

Thanks for your useful feedback. I'll try to improve it in the near future =).

~Dodowvogel

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
Reply to this topic...

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