CNN Faction Suggestion
#1

Im going to create a San Andreas News Faction but i have a problem. I want to create a CMD dat make ppls in CNN faction update everyday the journal. But how the journal works? How can it automatically update? How can i set it "non buyable" if its not updated? Im in troubld with The number of variables to create and save
Reply
#2

Do you mean, CNN (or whatever) news will appear underneath the screen like on TV? If yes that's a hell of a good idea
Reply
#3

I didnt mean that but you gave me a good idea ahah
Reply
#4

I assume you're using MySQL as with a system like this, it's a necessity really. I'll go through what database tables you could have and then the logic of it afterwards.

So, you'd first of all have the journal table which could have the following columns: id, title, content, timestamp

You'd also have a playerdata_journal table with the following columns: journal_id, playerdata_id, timestamp

The timestamps on both tables aren't necessary but give you more information to play with.

So, the logic is as follows. When a member of CNN adds a new journal entry, it inserts into the journal table. When a player purchases a journal entry, it inserts into the playerdata_journal table. You set journal_id equal to the id inside the journal table and you set playerdata_id equal to the id of the user inside the playerdata table. Not their in game player id but the id associated with their account under your playerdata table. Obvioiusly, you might have it called playerdata but I'm sure you know what I mean.

Moving on, the way to detect if someone has already purchased a journal entry or not is to run an SQL query searching the playerdata_journal for a row where the journal_id is equal to the selected journal entry and where the playerdata_id is equal to the player's PLAYERDATA ID. If a row is found, then you know they've already purchased that entry before. If not, allow them to purchase it.

Hope this make sense, I've tried to break it down. More importantly, I hope I've understood what you want!

Let me know if you need any more help.
Reply
#5

Quote:
Originally Posted by Jonesy96
Посмотреть сообщение
I assume you're using MySQL as with a system like this, it's a necessity really. I'll go through what database tables you could have and then the logic of it afterwards.

So, you'd first of all have the journal table which could have the following columns: id, title, content, timestamp

You'd also have a playerdata_journal table with the following columns: journal_id, playerdata_id, timestamp

The timestamps on both tables aren't necessary but give you more information to play with.

So, the logic is as follows. When a member of CNN adds a new journal entry, it inserts into the journal table. When a player purchases a journal entry, it inserts into the playerdata_journal table. You set journal_id equal to the id inside the journal table and you set playerdata_id equal to the id of the user inside the playerdata table. Not their in game player id but the id associated with their account under your playerdata table. Obvioiusly, you might have it called playerdata but I'm sure you know what I mean.

Moving on, the way to detect if someone has already purchased a journal entry or not is to run an SQL query searching the playerdata_journal for a row where the journal_id is equal to the selected journal entry and where the playerdata_id is equal to the player's PLAYERDATA ID. If a row is found, then you know they've already purchased that entry before. If not, allow them to purchase it.

Hope this make sense, I've tried to break it down. More importantly, I hope I've understood what you want!

Let me know if you need any more help.
You understood perfectly but i really dont know how mysql works, im actually saving variables with dfile. Can this system be scripted without mysql?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)