[Help] Assistant NPC

06/29/2011 09:34 Jay10291#1
I have an npc that give 2150 cps and 90000 silvers to new players. right now i have it set to give 2150 cps 90000 silvers AND enough exp to level the player to level 2. the reason why i made the npc give exp was so that people could not keep using the npc to get 2150 cps as it checks to make sure the player is level 1 first. HOWEVER, i want to upgrade the npc and make him so you can only use it once. I have tried my best to do this before comming here, but im stuck. I tried
Code:
if (client.Entity.needTimes >= 1)
                                    {
But that didnt work. so how can i make it so you can only claim the items from this NPC once? or at least once a day.
06/29/2011 09:58 Korvacs#2
You would need to modify the database, or perhaps make a new table to store claims from characters, then check to see if the database already has an entry for this npc event and character, if not grant the user the claim, if so then display a message.
06/29/2011 11:34 zTek#3
Are you adding 1 to it? client.Entity.needTimes++;
06/29/2011 11:36 Korvacs#4
The problem with doing it that way is that whenever you shut down the server that value is just completely reset since it was only stored in memory.