SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 17/03/2019, 01:32 AM   #1
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 550
Reputation: 67
Default [MySQL R41-4] Dynamic Update System

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.
willbedie is online now   Reply With Quote
Old 17/03/2019, 04:57 AM   #2
Ponga
Big Clucker
 
Ponga's Avatar
 
Join Date: Oct 2017
Posts: 88
Reputation: 9
Default Re: [MySQL R41-4] Dynamic Update System

great i really need this. +rep
__________________
Ponga is offline   Reply With Quote
Old 17/03/2019, 07:00 AM   #3
TheToretto
Gangsta
 
TheToretto's Avatar
 
Join Date: Jul 2015
Posts: 515
Reputation: 52
Default Re: [MySQL R41-4] Dynamic Update System

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






Toretto#9902

Rest in peace grandpa, 03 November 2018
TheToretto is offline   Reply With Quote
Old 17/03/2019, 07:20 AM   #4
ConnorW
Huge Clucker
 
ConnorW's Avatar
 
Join Date: Apr 2012
Location: Los Santos
Posts: 224
Reputation: 71
Default Re: [MySQL R41-4] Dynamic Update System

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.
__________________
retired
ConnorW is offline   Reply With Quote
Old 17/03/2019, 07:45 AM   #5
Logic_
High-roller
 
Logic_'s Avatar
 
Join Date: Jun 2015
Location: Pakistan
Posts: 1,587
Reputation: 294
Default Re: [MySQL R41-4] Dynamic Update System

Good shit. +4 rep.
__________________
Cheap game-host and hosted tab @ www.prestigesteve.com

Developer @ Metropolitan RP; Former developer @ Core RP, Nevada State Prison RP, COD:BO3, COD:AW, International RP, PC:RP, NEG, Zombieland TDM, CookieDM and IW:TDM.

❤❤❤❤❤
Logic_ is offline   Reply With Quote
Old 17/03/2019, 09:03 PM   #6
willbedie
Gangsta
 
willbedie's Avatar
 
Join Date: Feb 2016
Location: Albania
Posts: 550
Reputation: 67
Default Re: [MySQL R41-4] Dynamic Update System

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 .
willbedie is online now   Reply With Quote
Old 17/03/2019, 10:11 PM   #7
SymonClash
Huge Clucker
 
SymonClash's Avatar
 
Join Date: Dec 2018
Posts: 213
Reputation: 12
Default Re: [MySQL R41-4] Dynamic Update System

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];
SymonClash is online now   Reply With Quote
Old 17/03/2019, 10:45 PM   #8
Variable™
Gangsta
 
Join Date: Jul 2015
Location: Somewhere...
Posts: 790
Reputation: 164
Default Re: [MySQL R41-4] Dynamic Update System

Good work
__________________
MW4 Community

Variable™ is offline   Reply With Quote
Old 18/03/2019, 02:03 PM   #9
liszt
Little Clucker
 
Join Date: Mar 2019
Posts: 1
Reputation: 0
Default Re: [MySQL R41-4] Dynamic Update System

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.
liszt is offline   Reply With Quote
Old 19/03/2019, 11:50 PM   #10
Private200
High-roller
 
Private200's Avatar
 
Join Date: May 2012
Posts: 1,244
Reputation: 206
Default Re: [MySQL R41-4] Dynamic Update System

Haven't seen the code, but sounds fair enough for a 30-minute work. Well done.
__________________
just a signature
Private200 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Dynamic Update System Usmanmemon Filterscripts 25 13/01/2019 07:59 AM
[FilterScript] Dynamic MySQL GPS System CaptainBoi Filterscripts 21 13/01/2019 03:21 AM
[FilterScript] Group System (2). [MySQL\Dynamic Rank and permission system] verlaj Filterscripts 11 26/08/2017 07:53 PM
[FilterScript] Dynamic Apartment System v0.2 (UPDATE 7.3.2012) Maki187 Filterscripts 30 11/12/2012 04:28 PM
[Help] Mysql Dynamic System. tony_fitto Scripting Help 4 07/07/2012 03:10 AM


All times are GMT. The time now is 08:30 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.