[FilterScript] Miki!Props - Advanced House System - MySQL
#1

This is a property system that I made 1~2 months ago. It's pretty simple, but you can easily modify and do your way.

http://pastebin.com/bx6B1Ge7 - DB
http://pastebin.com/RPKQzz0j - Script

Have fun. If you want me to modify and do awesome things, PM me. (paid)

The script have some cmds to test, you can remove them.

Cintid is the custom int that you set in the interiorinfo table. It's just for create propertys easily.








Reply
#2

This seems to be awesome release, First post Congrulaaz btw 4 stars rated
Reply
#3

Thanks xD
Reply
#4

Cool FS, good job (:
Reply
#5

Great Filterscript!
Reply
#6

Reading the code atm - it saves/loads some things from .ini? Also you should add, that it uses Strickenkids sql plugin. Btw, pastebin f@cks up identication.
Reply
#7

Pretty nice thanks dude !
Reply
#8

Uhm are there already Houses Added becos i do not see anthying and /propertyhelp doesn't work maby i didn't loaded something probaly but i've got all the includes...
Reply
#9

Got errors when complied:

pawn Код:
(306) : warning 213: tag mismatch
(541) : error 075: input line too long (after substitutions)
(542) : error 017: undefined symbol "propertyi"
(543) : error 017: undefined symbol "d"
(543) : error 029: invalid expression, assumed zero
(543) : error 029: invalid expression, assumed zero
(543) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


6 Errors.
Is it only me?
Reply
#10

I guess so.
Reply
#11

Here is a few suggestions that could make your script better:

1. You are using a query per house rather than one single query for all of the houses. A example of this would be

pawn Код:
new query[256];
new count = 0, i = 0;
mysql_query("SELECT * FROM propertyinfo");
mysql_store_result();
while(mysql_fetch_row(query,"|"))              
{
    printf("\n|------ Loading Property ID: %d" , i );
    new field[22][MAX_PLAYER_NAME];
    explode(query, field, "|");
    count++;
    propertyInfo [i] [E_X]          =   floatstr( field[  1 ] );
    propertyInfo [i] [E_Y]          =   floatstr( field[  2 ] );
    propertyInfo [i] [E_Z]          =   floatstr( field[  3 ] );
    propertyInfo [i] [E_INT]        =   strval  ( field[  4 ] );
    propertyInfo [i] [E_VW]         =   strval  ( field[  5 ] );
    printf("|--- Exterior Info| X: %f | Y: %f | Z: %f" , propertyInfo [i] [E_X],propertyInfo [i] [E_Y],propertyInfo [i] [E_Z] );
    printf("|--- INT: %d | VW: %d" , propertyInfo [i] [E_INT],propertyInfo [i] [E_VW] );
    propertyInfo [i] [I_X]          =   floatstr( field[  6 ] );
    propertyInfo [i] [I_Y]          =   floatstr( field[  7 ] );
    propertyInfo [i] [I_Z]          =   floatstr( field[  8 ] );
    propertyInfo [i] [I_INT]        =   strval  ( field[  9 ] );

    printf("|--- Interior Info| X: %f | Y: %f | Z: %f" , propertyInfo [i] [I_X],propertyInfo [i] [I_Y],propertyInfo [i] [I_Z] );
    printf("|--- INT: %d" , propertyInfo [i] [I_INT]);
    propertyInfo [i] [TYPE]         =   strval  ( field[ 10 ] );
    propertyInfo [i] [LEVEL]        =   strval  ( field[ 11 ] );
    propertyInfo [i] [CASHBOX]      =   strval  ( field[ 12 ] );
    printf("|--- Property TYPE: %d | Level: %d | Cashbox: %d" , propertyInfo [i] [TYPE] , propertyInfo [i] [LEVEL] , propertyInfo [i] [CASHBOX] );
    propertyInfo [i] [NAME]         =   field[ 13 ];
    propertyInfo [i] [OWNER]        =   field[ 14 ];
    propertyInfo [i] [CO_OWNER]     =   field[ 15 ];
    printf("|--- Name: %s | Owner: %s | Co-Owner: %s" , propertyInfo [i] [NAME] , propertyInfo [i] [OWNER] , propertyInfo [i] [CO_OWNER] );
    propertyInfo [i] [SOLD]         =   strval  ( field[ 16 ] );
    propertyInfo [i] [LOCK]         =   strval  ( field[ 17 ] );
    propertyInfo [i] [ALARM]        =   strval  ( field[ 18 ] );
    propertyInfo [i] [PRICE]        =   strval  ( field[ 19 ] );
    printf("|--- Sold: %b | Lock Level: %d | Alarm Level: %d | Price: %d" , propertyInfo [i] [SOLD] , propertyInfo [i] [LOCK] , propertyInfo [i] [ALARM], propertyInfo [i] [PRICE]);
    propertyInfo [i] [USED_SLOT]    =   true;
///////////////////////////////////////////////////////////
    propertyCP   [i]                =   CreateDynamicCP(propertyInfo [i] [E_X] , propertyInfo [i] [E_Y] , propertyInfo [i] [E_Z] , 2 , propertyInfo [i] [E_VW] , propertyInfo [i] [E_INT] , -1 , 4);
    printf("|--- PROPERTYID: %d | Loaded propertyCP: ID: %d" , i , propertyCP[i] );
    i++;
}
mysql_free_result();
2. Take out the debugging commands such as /pegarumabufunfa and /pd as they can be used by anyone.

3. You use sscanf for some of it and explode for the other part of it. Use sscanf for the whole thing.
Reply
#12

Hmm... I get no error messages in the script and it loads the script but then when I type any of your commands Unknown Command thing comes up. I have logged into rcon but it's still not working! Why?
Reply
#13

Very good, it is so cool to see more and more people using MySQL!
Reply
#14

are houses already created?
Reply
#15

Awesome!!!
Reply
#16

Nice One Dude.
Reply
#17

I got this error
D:\SA-MP 0.3x server\filterscripts\hsystem.pwn(4) : fatal error 100: cannot read from file: "mysql"
Reply
#18

error "tag mismatch"
Reply
#19

Use https://www.assembla.com/code/san-fr...sql.inc?rev=71
This MySQL include
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)