[Include] Dynamic CCTV
#1

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:




Reply
#2

I apologize for having created the topic initially empty.
Reply
#3

No comments?
Reply
#4

Good job man, +rep!
Reply
#5

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

Awesome!!
Reply
#7

can we record using cctv? O.o
Reply
#8

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

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

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
Reply
#11

gudy
Reply
#12

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.
Reply
#13

gsgsgs
Reply
#14

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

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

* Meller posts in the legendary thread
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)