NPC Dialogue? and oter stuff (noob one)

Hello im triying to figure how to do a Dialogue for my NPCS

let say i just drop a npc on a map well when i press E on him a dialogue appears saying Welcome Soldier do you want to buy someting? and then 2 buttons appear Yes and the second one No

Then if the player Click on No it closes the menu but if he click yes he calls my function

Second Question
Im also triying to implement a RANK system lets say you kill 20 combines if you reach enough XP a small text pops up and tells you that you have Level up and you name changes to (steam user nickname-Sargent Rank)

I know im a lua started but i want to learn any help or hints are very appreciated!

NPC http://wiki.garrysmod.com/?title=NPC_Shop_Tutorial
Use something like http://wiki.garrysmod.com/?title=Player.SetPData or http://wiki.garrysmod.com/?title=LUA:SQLite_Tutorial
and save Rank and xp. Then have a hook to when an npc dies and update the players xp and level.

thanks a lot for all you help i tried to use the npc i puttted it on my addon folders since it had the addon file and on the console i writted gmod_spawnnpc shop_npc_example but then a text come and says

Sorry you cant spawn this npc

[editline]12th January 2011[/editline]

well after the SQL tutorial every time i load my gamemdoe it crashes when it goes to Initialising Resources but if i delete the sql_database lua file it works well

What does a otter have to do with this? :downsrim:

[editline]11th January 2011[/editline]

Rate me dumb if you like my joke btw!