05.08.2016, 20:10
Heyhey.
I'm making a dynamic job system right now, but I am stuck because I managed to confuse myself - therefore I need some help and hints to get out of it and sort it out. Also need some tips regarding actors, but will get back to that later.
Here's my current "script", just includes two commands pretty much: http://pastebin.com/v950waAL
My MySQL database has an own table for jobs. Right now it has a jobid (primary key, auto increment), jobtype (int), jobname (varchar, 24), jobposx-z(float) and jobworld. Including jobworld incase I'll add a job inside an interior. When I make a job in-game the 3d text is being created, however whenever I try to update it - it adds a new 3dxtext label. I haven't made any load function yet, will try to do that soon.
All the code releated to dynamic text labels gets a tag mismatch warning (even the destroy, so 3 warnings)
Since the jobid is auto increment and primary key, I'm wondering how the heck I am supposed to do this correctly. Example my enums, when I use them on /createjob - I wrote createjobtype, but that is clearly wrong as it is supposed to be the jobid I guess? But that's being auto generated, so will I have to retrieve/find that from the database first? I'm confusing myself.
About actors:
How does that work? Like if I'd like to replace the dynamic 3d text labels with actors instead, how'd that work out? Like in the same table as jobs. Whenever I /createjob - an actor spawns, and tells the person that is closeby to type /takejob to join the job for instance. Or does it require a own table as it needs an unique ID? Anyone got a good idea here?
And if there's anything that could be done another way, please tell me about it. Trying to learn.
I'm making a dynamic job system right now, but I am stuck because I managed to confuse myself - therefore I need some help and hints to get out of it and sort it out. Also need some tips regarding actors, but will get back to that later.
Here's my current "script", just includes two commands pretty much: http://pastebin.com/v950waAL
My MySQL database has an own table for jobs. Right now it has a jobid (primary key, auto increment), jobtype (int), jobname (varchar, 24), jobposx-z(float) and jobworld. Including jobworld incase I'll add a job inside an interior. When I make a job in-game the 3d text is being created, however whenever I try to update it - it adds a new 3dxtext label. I haven't made any load function yet, will try to do that soon.
All the code releated to dynamic text labels gets a tag mismatch warning (even the destroy, so 3 warnings)
Since the jobid is auto increment and primary key, I'm wondering how the heck I am supposed to do this correctly. Example my enums, when I use them on /createjob - I wrote createjobtype, but that is clearly wrong as it is supposed to be the jobid I guess? But that's being auto generated, so will I have to retrieve/find that from the database first? I'm confusing myself.
About actors:
How does that work? Like if I'd like to replace the dynamic 3d text labels with actors instead, how'd that work out? Like in the same table as jobs. Whenever I /createjob - an actor spawns, and tells the person that is closeby to type /takejob to join the job for instance. Or does it require a own table as it needs an unique ID? Anyone got a good idea here?
And if there's anything that could be done another way, please tell me about it. Trying to learn.