[FilterScript] Vehicle Ownership System (MySQL R39-2)
#1



Hy all, today i make Vehicle Ownership System that used MySQL as saving system.
This is basic vehicle system, so you can easily edit and add more features what you want.


Features
- Saved Vehicle System
- Sell Vehicle To Server
- GPS System to locate your car (thanks to Fj0rtizFredde)
- Sell Vehicle To Players
- Vehicle Control Panel
- For more features you can view pictures in attachments


Instruction
- First, you need to define your Database info
Code:
#define HOST		"Your Host"
#define USER		"root"
#define PASSWORD	"********"
#define DBNAME		"Database Name"
- To change dealership pos, you need to change dealX, dealY, dealZ variables
Code:
Float:dealX = -1663.640014, Float:dealY = 1208.253662, Float:dealZ = 7.254645
- If you have any problems when compile it, you can ask question in this thread
- Another instruction in script


Downloads


Pastebin (Bad Indentation)
SQL File


* The pictures in attachment below, hope you like it!
Reply
#2

This is really good i like it nice job.
Reply
#3

Quote:
Originally Posted by fonia5
View Post
This is really good i like it nice job.
Thanks for your feedback
Reply
#4

Nice Job , use [img]your ss link[/img] to show your Screenshot xD
Reply
#5

Quote:
Originally Posted by Mya
View Post
Nice Job , use [img]your ss link[/img] to show your Screenshot xD
Thanks, that image is too big to show in post.
Reply
#6

Some of this is copied code you didn't give credits for I'm not sure if there is more copied else where but.

http://users.telenet.be/vge/download...ripts/FGPS.pwn

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid,"YEAH") == 1)
    {
        DestroyObject(GPSObject[playerid]);
        SetPVarInt(playerid,"YEAH",0);
        DeletePVar(playerid,"Spongebob");
        DeletePVar(playerid,"Mario");
        DeletePVar(playerid,"SpiderPig");
        DeletePVar(playerid,"FAIL");
        #if defined UseTd
            TextDrawHideForPlayer(playerid, GPSTD);
        #endif
    }
    return 1;
}
Your code.

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPVarInt(playerid, "YEAH") == 1)
    {
        DestroyObject(GPSObject[playerid]);
        SetPVarInt(playerid, "YEAH",0);
        DeletePVar(playerid, "Spongebob");
        DeletePVar(playerid, "Mario");
        DeletePVar(playerid, "SpiderPig");
        DeletePVar(playerid, "FAIL");
    }
    return 1;
}
I would suggest giving credits for any code that isn't yours.
Reply
#7

@Pottus Yeah sorry about that, i used GPS system from FGPS, but not with the other code,
btw thanks.
Reply
#8

Doesn't matter.. It is a very nice and usefull script, thanks for sharing!
Reply
#9

Quote:
Originally Posted by feheristi97
View Post
Doesn't matter.. It is a very nice and usefull script, thanks for sharing!
You're welcome, and thanks for feedback
Reply
#10

I have many problems with this filterscript. When you buy a car and you leave from server your name will be saved as 0.. next problem is.. where is the MySQL database? please paste somewhere and fix the vehicle saver because for me isn't working.. I leave and I join back and I get that message I dont have any car.. but is created and I do.
Reply
#11

You,must fill max_len parameter at
cache_get_field_content function for minimize bug, i know this is optional but some people will always got bug about the string won't be saved.

cache_get_field_content(row, const field_name[], destination[], connectionHandle = 1, max_len = sizeof(destination))


From wiki:
Source: https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content
Code:
You have to provide the size (''max_len'') by yourself if you use an enum-array as destination.
Reply
#12

Well can with get the MySQL file?
Reply
#13

Quote:
Originally Posted by RaeF
View Post
You,must fill max_len parameter at
cache_get_field_content function for minimize bug, i know this is optional but some people will always got bug about the string won't be saved.

cache_get_field_content(row, const field_name[], destination[], connectionHandle = 1, max_len = sizeof(destination))


From wiki:
Source: https://sampwiki.blast.hk/wiki/MySQL/R33..._field_content
Code:
You have to provide the size (''max_len'') by yourself if you use an enum-array as destination.
Actually, i didn't use enum-array as destination on my script.
I used temporary string.
Thanks, btw.
I didn't know that thing.

Quote:
Originally Posted by tysanio
View Post
Well can with get the MySQL file?
Im sorry about that
You can download sql file here.
Thanks to inform me
Reply
#14

Thank you
Reply
#15

bondowocopz, can you fix the saving then? because when I connect, and I write /mycars I get that message: I dont have any car.. I guess because the NAME string isn't working good.
Reply
#16

The problem was the MySQL table.. because you wrote to the owner `owner` int(10) NOT NULL, and you need `owner` varchar(20) NOT NULL. Little mistake but I found it!
Reply
#17

Quote:
Originally Posted by tysanio
View Post
Thank you
You're welcome

Quote:
Originally Posted by feheristi97
View Post
The problem was the MySQL table.. because you wrote to the owner `owner` int(10) NOT NULL, and you need `owner` varchar(20) NOT NULL. Little mistake but I found it!
Sorry, my mistake. Thanks to inform me.
Updated
Reply
#18

Good job, keep it up
Reply
#19

Quote:
Originally Posted by AdHaM612
View Post
Good job, keep it up
Thanks, i'll
Reply
#20

Saving doesn't appear to work very well, vehicle positions do not update on disconnect - logging back in they all respawn back the dealership even if park was used.

It'd make more sense to save them where they last were, as they all pile up on top of each other at the dealership? Plate was not updating when new plate was entered..

Not really sure what's going on
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)