SA-MP Forums Archive
[FilterScript] Dynamic Update System - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Dynamic Update System (/showthread.php?tid=646311)

Pages: 1 2


Dynamic Update System - Usmanmemon - 14.12.2017

INTRO:
Basically it's an simple filterscript which allow you in game to add/remove/edit updates list.

COMMANDS:

/addupdates (rcon admin command!)
/delupdates (rcon admin command!)
/editupdate (rcon admin command!)
/updates
/maxupdates (rcon admin command!)


SCREEN SHOTS:









DOWNLOAD LINK:

PASTEBIN

BUGS FIXED:
Loop bug fixed.
No bugs founded if you found please inform me Thanks you.


Re: Dynamic Update System - rfr - 14.12.2017

useful, thanks


Re: Dynamic Update System - Usmanmemon - 14.12.2017

Quote:
Originally Posted by rfr
Посмотреть сообщение
useful, thanks
Your Welcome Sir, btw it's my second Filterscript


Re: Dynamic Update System - jasperschellekens - 14.12.2017

Nice
Edit: Script doesn't even work.
You can only see Update ID 1


Re: Dynamic Update System - Usmanmemon - 16.12.2017

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Nice
Edit: Script doesn't even work.
You can only see Update ID 1
Sir thanks to inform me, i fixed!




Re: Dynamic Update System - RogueDrifter - 16.12.2017

not bad this'll come in handy, gj.


Re: Dynamic Update System - darkhunter332 - 16.12.2017

Nice work, very helpful for developers and updates!


Re: Dynamic Update System - RoyalGamer - 17.12.2017

/delupdate 1,2 not working btw when i do /delupdate 3 its working and its only removing by number 3


Re: Dynamic Update System - Usmanmemon - 20.12.2017

Quote:
Originally Posted by RoyalGamer
Посмотреть сообщение
/delupdate 1,2 not working btw when i do /delupdate 3 its working and its only removing by number 3
Its working i have checked but if its not working for you so please provide me Screen shot.


Re: Dynamic Update System - Usmanmemon - 20.12.2017

Quote:
Originally Posted by darkhunter332
Посмотреть сообщение
Nice work, very helpful for developers and updates!
Thank you bruh ❤️

Quote:
Originally Posted by RogueDrifter
Посмотреть сообщение
not bad this'll come in handy, gj.
Thank you too 😊


Re: Dynamic Update System - Kaperstone - 20.12.2017

If you already use sscanf, you can make
/update [add, edit, etc.] rather than /editupdate /addupdate


Why are you using PVars?
What if I use "UID" PVar in my gamemode, that'd mean that your filterscript would overwrite my PVars

Код:
new str[256];
Max. length of a message that you can send in a SendClientMessage is 144, so the array must be 145 with one for terminal.

Код:
format(tmp4, sizeof(tmp4), "Updates\tDate Of Update\n%s", tmp3);
Код:
format(s, sizeof(s), "update%d", x);
Why are you using format to append string? use strcat
Format would just be slower for such simple task.

Код:
h[256]
The dates are around 10 char, surely not 256 char
Код:
%d/%d/%d
2+2+4+3=11 max.
You have 245 wasted cells


Код:
for(new x=1 ; x<560 ; x++)
            {
                new s[256];
Its better to create the array outside the loop than to create an array for every loop, would just eat up processing time, moreover, if you'd create it outside, empty the string every loop with ``string[0] = EOS;``


I've noticed that you haven't stated max. length of string for an update line to be?


Re: Dynamic Update System - rfr - 20.12.2017

For strcat example:

PHP код:
new string[144+1];
strcat(string,"\ni have not even read your code yet");
ShowPlayerDialog(playeridDIALOG_UPDATESDIALOG_STYLE_"Server Updates"string"Close"""); 



Re: Dynamic Update System - Kaperstone - 20.12.2017

Quote:
Originally Posted by rfr
Посмотреть сообщение
For strcat example:

PHP код:
new string[144];
strcat(string,"\ni have not even read your code yet");
ShowPlayerDialog(playeridDIALOG_UPDATESDIALOG_STYLE_"Server Updates"string"Close"""); 
Although the max. info length is 4096, don't forget about EOS / '\0' (End Of String)
144 + 1


Re: Dynamic Update System - rfr - 20.12.2017

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
Although the max. info length is 4096, don't forget about EOS / '\0' (End Of String)
144 + 1
oh my bad. thank you.


Re: Dynamic Update System - DonaldDuck - 21.12.2017

Nice work, keep it up.


Re: Dynamic Update System - Usmanmemon - 21.12.2017

Quote:
Originally Posted by Kaperstone
Посмотреть сообщение
If you already use sscanf, you can make
/update [add, edit, etc.] rather than /editupdate /addupdate


Why are you using PVars?
What if I use "UID" PVar in my gamemode, that'd mean that your filterscript would overwrite my PVars

Код:
new str[256];
Max. length of a message that you can send in a SendClientMessage is 144, so the array must be 145 with one for terminal.

Код:
format(tmp4, sizeof(tmp4), "Updates\tDate Of Update\n%s", tmp3);
Код:
format(s, sizeof(s), "update%d", x);
Why are you using format to append string? use strcat
Format would just be slower for such simple task.

Код:
h[256]
The dates are around 10 char, surely not 256 char
Код:
%d/%d/%d
2+2+4+3=11 max.
You have 245 wasted cells


Код:
for(new x=1 ; x<560 ; x++)
            {
                new s[256];
Its better to create the array outside the loop than to create an array for every loop, would just eat up processing time, moreover, if you'd create it outside, empty the string every loop with ``string[0] = EOS;``


I've noticed that you haven't stated max. length of string for an update line to be?
Uhh if i say its my second fs then?
Thank you for telling my mistakes i will try to improve it.


Re: Dynamic Update System - Usmanmemon - 21.12.2017

Quote:
Originally Posted by DonaldDuck
Посмотреть сообщение
Nice work, keep it up.
Thanks Bro


Re: Dynamic Update System - Barnwell - 23.12.2017

Good job


Re: Dynamic Update System - xMoBi - 23.12.2017

u call this dynamic, i call this shit. i would write my own system for something like that and use anything else than ini.


Re: Dynamic Update System - Usmanmemon - 23.12.2017

Quote:
Originally Posted by Zoranzoki21
Посмотреть сообщение
No work. When I add update, it can not be seen.
Make sure to make an file in scriptfiles folder, name 'updates.ini'