(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FQdWjRrW.png&hash=0f322de52607aa7bc2670300a1070704b2593524)
Hello guys last night i made this script from scratch. It might not be useful but newbies and some of my friends needs it so, There are few commands.
/createprop : stand some where near of prop and use this command it will create an pickup on your standing postion and will put the data in props.sqlite.
Syntax:
/createprop <Price> <Prop Name>
Prop Name: put your desired property name here such as Vercitty State or Mansion.
Price: The price for property you want to set.
/buypropSyntax:
/buyprop <Property ID>
/sellpropSyntax:
/sellprop <Property ID>
/sharepropSyntax:
/shareprop <Property ID> <Player Name>
/unsharepropSyntax:
/unshareprop <Property ID>
/myprops /mysharedpropsDownload Link: Dropbox Link (https://www.dropbox.com/s/2nivh32xpbic2dt/Properties%20Script.zip?dl=0) Mediafire Link (http://www.mediafire.com/download/cqm44iztcgv3dz2/Properties_Script.zip)
Found Bugs or have Suggestion Please comment belowUpdate: Disconnecting db on onScriptUnload, Removed server.exe
Another Update: Added GetPlayer Function and using GetTok instead split and using escapeSQLString, Added PropertyID
Links updated
Plugins you need Windows x86 (http://v04.maxorator.com/files/plugins/mp04rc2_plugins32_windows.zip), Linux x86 (http://v04.maxorator.com/files/plugins/mp04rc2_plugins32_linux.zip)
1.
You forgot to disconnect the sqlite when the server is turned off.
2.
Why don't you save the things in an array, and later on export/save it to the DB?( you can follow rulk's buycar/getcar system for that)
3.
Read this:- http://forum.vc-mp.org/?topic=898.0
So, please delete the server.exe file, as it is of no use for linux users.
Anyways, Nice work.
Quote from: KAKAN on Nov 14, 2015, 10:18 AM1.
You forgot to disconnect the sqlite when the server is turned off.
I will update it.
Quote from: KAKAN on Nov 14, 2015, 10:18 AM2.
Why don't you save the things in an array, and later on export/save it to the DB?( you can follow rulk's buycar/getcar system for that)
I will but that will become Hard to understand for some newbies
Quote from: KAKAN on Nov 14, 2015, 10:18 AM3.
Read this:- http://forum.vc-mp.org/?topic=898.0
So, please delete the server.exe file, as it is of no use for linux users.
I didnt included any .exe file
Quote from: KAKAN on Nov 14, 2015, 10:18 AMAnyways, Nice work.
Thanks
Quote from: Kusanagi on Nov 14, 2015, 10:33 AMQuote from: KAKAN on Nov 14, 2015, 10:18 AM3.
Read this:- http://forum.vc-mp.org/?topic=898.0
So, please delete the server.exe file, as it is of no use for linux users.
I didnt included any .exe file
Oh c'mon, my eyes are not that bad.
i can see one server.exe file in your script.
As well as, you didn't tell which plugins are required for this to work
Quote from: KAKAN on Nov 14, 2015, 10:59 AMQuote from: Kusanagi on Nov 14, 2015, 10:33 AMQuote from: KAKAN on Nov 14, 2015, 10:18 AM3.
Read this:- http://forum.vc-mp.org/?topic=898.0
So, please delete the server.exe file, as it is of no use for linux users.
I didnt included any .exe file
Oh c'mon, my eyes are not that bad.
i can see one server.exe file in your script.
As well as, you didn't tell which plugins are required for this to work
Sorry i was too tired when i zipped btw link updated
Btw, nyc work.. :)
Good Job. ;)
Did you test this?
1. else if ( text == GetSQLColumnData(QuerySQL(pdb, "SELECT Name FROM Properties"),0) ) MessagePlayer( "Property Already Exists", player );
How would you expect this to work?
2. Property names cannot contain spaces. Use the format /createprop <price> <name>, so you can take the first argument as price, and the rest (no matter how many elements) as name.
3. You do no SQL escaping, at all. What do you think happens when your nick contains an '? Yes. Your query breaks.
4. MyProps loops through all properties, and does a while loop to see if the owner is you. This will break if your database contains, for example:
ID | Owner
0 | Me
1 | You
2 | Me
Your property will break the while loop, and when I enter the myprops command it will only show the first one.
Fix this by changing your SQL to use WHERE Owner = 'playername', then loop through all returned rows.
5. Same for mysharedprops as #4
6. Why do you sometimes use GetTok (createprop), and other times use split? If this is a script directed at beginners it's important to be consistent.
7. Your onPickupPickedUp function does an if on the query. This is great, but if the query returns nothing (The property does not exist, and the pickup was faulty placed there, for whatever reason) it will continue, and will spam null errors in your face. Check if your data is not null, instead.
As you can see there's still a lot of room for improvement, but there's a beginning.
Thanks
@Thijn Fixing
3. You do no SQL escaping, at all. What do you think happens when your nick contains an '? Yes. Your query breaks.
Would you tell me more about SQL escaping
Edit: i hope you was talking about escapeSQLString(text)
@Thijn can you please check it once more
Kusanagi how i become admin for create new property..................................
Quote from: XammaD^.^ on Dec 08, 2015, 01:44 PMKusanagi how i become admin for create new property..................................
in command createprop i wrote my name "Kusanagi" change it to your name "XammaD^.^"
Ok Thanks but my name is not XammaD^.^ . Now i am HaCkeR0o1
@Kusanagi can you forword my port using teamviewer please................
Quote from: HaCkeR0o1 on Dec 08, 2015, 02:02 PM@Kusanagi can you forword my port using teamviewer please................
Maybe you can do that shits in PM?
There are many good websites about port forward.
One of the most popular website is:- portforward.com
Quote from: KAKAN on Dec 08, 2015, 02:40 PMQuote from: HaCkeR0o1 on Dec 08, 2015, 02:02 PM@Kusanagi can you forword my port using teamviewer please................
Maybe you can do that shits in PM?
There are many good websites about port forward.
One of the most popular website is:- portforward.com
but i want to forword port for vcmp..........................
Quote from: HaCkeR0o1 on Dec 08, 2015, 03:10 PMQuote from: KAKAN on Dec 08, 2015, 02:40 PMQuote from: HaCkeR0o1 on Dec 08, 2015, 02:02 PM@Kusanagi can you forword my port using teamviewer please................
Maybe you can do that shits in PM?
There are many good websites about port forward.
One of the most popular website is:- portforward.com
but i want to forword port for vcmp..........................
Follow SAMP and other games tutorial..... Just change the port
Please Dont flood in topic and i dont know about port forwarding
Topic locked