SA-MP Forums Archive
[Include] Dynamic CCTV - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Dynamic CCTV (/showthread.php?tid=615759)



Dynamic CCTV System (MySQL, foreach, ZCMD) - IFilip - 26.08.2016

DYNAMIC CCTV SYSTEM

What About:
Through this system you can create the CCTV cameras directly in-game, usable Role Play / RPG.

Commands:
/helpcctv - /createcctv - /deletecctv - /editcctv - /rangecctv
/movecctv - /renamecctv - /factioncctv - /gotocctv - /cctv - /cctvoff


Downloads:

foreach (https://github.com/Kar2k/SAMP-foreach)
MySQL R-39 (https://github.com/pBlueG/SA-MP-MySQL/releases)
ZCMD (http://www.solidfiles.com/d/d20f/)

- CCTV (core): http://pastebin.com/TbhjCFW1
- CCTV (commands): http://pastebin.com/BjksJXRS


Screens:

Quote:







Re: Dynamic CCTV - IFilip - 26.08.2016

I apologize for having created the topic initially empty.


Re: Dynamic CCTV - IFilip - 27.08.2016

No comments?


Re: Dynamic CCTV - TayFunCZE - 27.08.2016

Good job man, +rep!


Re: Dynamic CCTV - CoachCarter - 28.08.2016

Awesome mate. This system can be used for other purposes aswell. awesome.


Re: Dynamic CCTV - Ritzy2K - 28.08.2016

Awesome!!


Re: Dynamic CCTV - XHunterZ - 28.08.2016

can we record using cctv? O.o


Re: Dynamic CCTV - IFilip - 29.08.2016

Thanks all.
XHunterZ, yes can record position using CCTV, you must only set position of CCTV.


Re: Dynamic CCTV - MaazS - 29.08.2016

Seems great, I'll check it out! Thanks for the release OP.


Re: Dynamic CCTV - Kaliber - 29.08.2016

There are some things you should think about

1. You should use static and stock.
For example if someone only wanna use 1 or 2 functions, he dont need the others.
So use stock for Variables and Functions if you write an Include.
The other thing is, imagine he uses the same variable name like u.
Then it comes to an Error, so that this never happens use static so your include has his own scope

2. Huge Space Wasting
PHP код:
new
    
FloatCCTV_oldX[MAX_PLAYERS],
    
FloatCCTV_oldY[MAX_PLAYERS],
    
FloatCCTV_oldZ[MAX_PLAYERS],
    
FloatCCTV_oldAngle[MAX_PLAYERS],
    
CCTV_oldSkin[MAX_PLAYERS],
    
CCTV_oldVW[MAX_PLAYERS],
    
CCTV_oldInterior[MAX_PLAYERS],
    
inCCTV[MAX_PLAYERS],
    
CCTV_ID[MAX_PLAYERS],
    
CCTV_inEditing[MAX_PLAYERS]; 
10 (there are 10 Vars)*500 (MAX_PLAYERS)*4 (4Bytes per Cell)
= 20.000Bytes = ~19.53 KB

So...this isnt a complex system and an user wanna use it and instant waste 19.53 KB...
In Pawn this is much space and most time this all doesn't get used.
So it is wasted.
Temporary Vars, when u just wanna save a var over a short time, for example Dialog choosing, or for commands and then using dialogs, it is perfect to use PVars, cause you can delete it right after you used it and save a lot of space.
For other things it is neat to use Propertys, because if you do this, you can use as much as your Server RAM is big
And most of your vars are only for a short distance so use PVar, and delete it right after you used it

3. Why use MySQL?
MySQL can do huge problems for not so experienced users or with plugins and microsoft or linux.
So just use SQLite so, the user doesn't need to make a huge thing about your include.
Try to make it smart, so that it runs perfect

4. Injections
There are some open bugs in your code
For example if you save the vars, you use for the name %s, but if i write an injection in the name, so yeah you right load it
So you should use %q instead or escape the string

5. Defines
At the End of the Include you should undefine your defines.
For example
PHP код:
#undef MAX_CCTV_NAME 
And you should do the start like this:
PHP код:
#if !defined MAX_CCTV
    #define MAX_CCTV 100
#endif 
So that you can redefine it from the Script and dont need to edit your include


So far some points, but all in all it isn't that bad
Good that you use Streamer functions and an Iteration Include

And nice idea, so good job anyway


Respuesta: Dynamic CCTV - EdinsonWalker - 30.08.2016

gudy


Re: Dynamic CCTV - MaazS - 30.08.2016

Do I put them as seperate includes, make them one .inc, or do I put the cmds into my actual gamemode? Sorry, I'm new.


Re: Dynamic CCTV - SetPlayerNameTag - 27.08.2017

gsgsgs


Re: Dynamic CCTV - Xeon™ - 27.08.2017

Quote:
Originally Posted by SetPlayerNameTag
Посмотреть сообщение
gsgsgs
Good job posts famer, bumping an 1 year ago thread.


Re: Dynamic CCTV - SetPlayerNameTag - 28.08.2017

Quote:
Originally Posted by XeonMaster
Посмотреть сообщение
Good job posts famer, bumping an 1 year ago thread.
farmer*


Re: Dynamic CCTV - Meller - 28.08.2017

* Meller posts in the legendary thread