[FilterScript] [MySQL R41-4] Dynamic Update System
#1

Introduction
Hello, this is a new system which I have been working on for like 30 minutes, I use this on my own upcoming server and I just find it useful. Basically, you are able to add updates and changelog in-game, without having to re-edit the script every time you change your code or a system.

How to use it?
Download or clone the repository on GitHub, and compile the code. There are a few includes you need though.

Commands

There are currently three commands, two admin commands and a player command.

- /addupdate [status] [text] - RCON Admins
- /removeupdate [updateid] - RCON Admins
- /updates - Player Command

Credits
SA-MP team for a_samp
BlueG / maddinat0r for a_mysql
Emmet_ for easyDialog
Zeex for zcmd
Y_Less / maddinat0r for sscanf2

Screenshots
Here's a list of screenshots:

https://imgur.com/a/fdIbGIs

Download
GitHub
Pastebin

Enjoy it.
Reply
#2

great i really need this. +rep
Reply
#3

That's clever! Good job man. Just a simple notice, dialogs with white font are better than the default color
Reply
#4

This is hot, but you also have to check if the update list is empty and return by sending the client a message that the update is empty otherwise it'll show a empty dialog.
Reply
#5

Good shit. +4 rep.
Reply
#6

Quote:
Originally Posted by Ponga
View Post
great i really need this. +rep
Thank you

Quote:
Originally Posted by TheToretto
View Post
That's clever! Good job man. Just a simple notice, dialogs with white font are better than the default color
Thanks

Quote:
Originally Posted by ConnorW
View Post
This is hot, but you also have to check if the update list is empty and return by sending the client a message that the update is empty otherwise it'll show a empty dialog.
Have you seen the screenshots? I have already done that, https://i.imgur.com/nblsJF2.png. Thanks by the way.

Quote:
Originally Posted by Logic_
View Post
Good shit. +4 rep.
Thank you .
Reply
#7

Nice job here. Do you think your system can be a good sample to make a vehicle ownership system? Also i see you haven't used any enums, just normal mysql queries.

FYI, i'm referring to something like:

pawn Code:
#define MAX_REPORTS 50

enum rData
{
    reportID,
    reporterName,
    reportedPlayer,
    reportedReason
}

new ReportData[MAX_REPORTS][rData];
Reply
#8

Good work
Reply
#9

Good work, but consider these points:

1) Right now, every time someone types /updates, you perform a query to get all news items.
2) News items are the same for everyone.
3) The only time an "update" of the news items is needed is when a new one is added/removed.

News items are really just formatted strings. You need one instance of all strings (since they're common to everyone), and my suggestion is to use a Vector to keep track of all string values.

When someone creates a new entry, you just push back to the vector via VECTOR_push_back_str.
When someone deletes an entry, you just remove that entry via VECTOR_remove_str.
When someone enters the /updates command, you can just print a dialog with all the concatenated strings from the news vector.

Edit: When the gamemode first starts, you perform the query and populate the initial vector.
Reply
#10

Haven't seen the code, but sounds fair enough for a 30-minute work. Well done.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)