black_dog_z
Joined: 17 Apr 2005 Posts: 2
|
Posted: Sun Apr 17, 2005 20:20 Post subject: weird problem |
|
|
ok 2 things, first i intalled my sql and nwnx easily that part was no problem the walkthrough needs to be updated though as Jeroen_Broekhuizen...MySQL12 file has been udated since then and some of the things they want were hard to figure out with the new version. now everything appears to work fine except in both the demo mod and my module im trying to make persistant the info seems to store fine as it dosnt error but when recalling the info it dosnt work. im trying to figure out what i did wrong here is my code for the script
Code: |
#include "aps_include"
void main()
{
object oPC = GetPCSpeaker();
int nwuse1 = (GetPersistentInt(OBJECT_SELF,"wuse1")+1);
int nwuse2 = (GetPersistentInt(OBJECT_SELF,"wuse2")+1);
int nwuse3 = (GetPersistentInt(OBJECT_SELF,"wuse3")+1);
int nwuse4 = (GetPersistentInt(OBJECT_SELF,"wuse4")+1);
if (GetGold(oPC) <= 99)
{
AssignCommand(GetObjectByTag("innkeep1"), ActionSpeakString("You dont have enough Money. feel free to wander the lounge though."));
}
else if (nwuse1 < 2)
{
AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
CreateItemOnObject("innkey1" ,oPC);
SetPersistentInt(OBJECT_SELF,"wuse1",nwuse1++);
}
else if (nwuse2 < 2)
{
AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
CreateItemOnObject("innkey2" ,oPC);
SetPersistentInt(OBJECT_SELF,"wuse2",nwuse2++);
}
else if (nwuse3 < 2)
{
AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
CreateItemOnObject("innkey3" ,oPC);
SetPersistentInt(OBJECT_SELF,"wuse3",nwuse3++);
}
else if (nwuse4 < 2)
{
AssignCommand(oPC, TakeGoldFromCreature(100, oPC, TRUE));
CreateItemOnObject("innkey4" ,oPC);
SetPersistentInt(OBJECT_SELF,"wuse4",nwuse4++);
}
else
AssignCommand(GetObjectByTag("innkeep1"), ActionSpeakString("We are currently out of rooms but feel free to wonder the lounge."));
}
|
the script keeps giving me key one but if i change the word persistant to local it works fine but isnt persistant any ideas on whats wrong? Maybe i just don't understand persistant scripting yet hopefully someone can help _________________ It's Me the monkley! |
|