[FilterScript] Vehicle Ownership System [MySQL]
#1

took me time thinking to release this system or not ...

Commands:

Player Commands:
  • /buyvehicle <VehicleID> - Buy the offered vehicle in the dealership.
  • /vehicles - Shows the current player owned vehicles, Click on the vehicle to spawn/change plate/empty/etc.
  • /changeplate <Number/Text> - Change the number plate of the vehicle.
  • /lock <VehicleID> - Lock a vehicle (If you are inside the vehicle, No need for the 'VehicleID' parameter).
  • /unlock <VehicleID> - Unlock a vehicle (If you are inside the vehicle, No need for the 'VehicleID' parameter).
Administrator Commands:
  • /buyvehicle <VehicleID> - Buy the offered vehicle in the dealership.
  • /createvehicle <ModelID/Vehicle Name> <Color1> <Color2> <Price> - Create a vehicle for the dealership.
  • /gotovehicle <VehicleID> - Teleport to a vehicle.
  • /setvehicleprice <Price> - Change dealership vehicle price.
  • /deletevehicle <VehicleID> - Delete a vehicle.
Requirements:

Streamer - Incognito
MySQL - BlueG/maddinat0r
Foreach - Kar/******
SSCANF2 - ******/maddinat0r/Emmet_
Command Processor - SickAttack

Bugs:

Nothing found yet, If you found please post here.

Download:

ClickHere! - GitHub

Special Thanks:

AndySedeyn; Improvements and some fixes.
Konstantinos; Improvements and some fixes.

Enjoy, Hope you like it.
Reply
#2

Nice one
Reply
#3

'oly fu' dude - can't rep :3
Reply
#4

Great!
Reply
#5

i like it thanks
Reply
#6

noice
Reply
#7

So you've listened to my suggestion... good job tho!
Reply
#8

I know it might be easier to re-upload the .pwn file again but pushing commits will be better for reviewing the changes.

The filterscript is nice and I know you will eventually change few other things to improve it so I always appreciate you take into consideration most of my suggestions!

PS: Another version for R40+ would be good as well.
Reply
#9

How to Do it? i mean how to instill it to mySQL I Already have mysql datebase
Reply
#10

Hey, isn't this a bad thing to do According to: (https://sampforum.blast.hk/showthread.php?tid=420363)

Код:
     new query[500];
    mysql_format(mysql, query, sizeof(query), "UPDATE `Vehicles` SET `vehName` = '%e', `vehOwner` = '%e', `vehLock` = %i, `vehModel` = %i,\
    `vehPlate` = '%e', `vehMod_1` = %i, `vehMod_2` = %i, `vehMod_3` = %i, `vehMod_4` = %i, `vehMod_5` = %i, `vehMod_6` = %i, `vehMod_7` = %i,\
    `vehMod_8` = %i, `vehMod_9` = %i, `vehMod_10` = %i, `vehMod_11` = %i, `vehMod_12` = %i, `vehMod_13` = %i, `vehMod_14` = %i, `vehColorOne` = %i,\
    `vehColorTwo` = %i, `vehX` = %f, `vehY` = %f, `vehZ` = %f, `vehA` = %f WHERE `vehID` = %d", vInfo[vehicleid][vehName], vInfo[vehicleid][vehOwner],
    vInfo[vehicleid][vehLock], vInfo[vehicleid][vehModel], vInfo[vehicleid][vehPlate], vInfo[vehicleid][vehMod][0], vInfo[vehicleid][vehMod][1], vInfo[vehicleid][vehMod][2], 
    vInfo[vehicleid][vehMod][3], vInfo[vehicleid][vehMod][4], vInfo[vehicleid][vehMod][5], vInfo[vehicleid][vehMod][6], vInfo[vehicleid][vehMod][7], vInfo[vehicleid][vehMod][8], 
    vInfo[vehicleid][vehMod][9], vInfo[vehicleid][vehMod][10], vInfo[vehicleid][vehMod][11], vInfo[vehicleid][vehMod][12], vInfo[vehicleid][vehMod][13], vInfo[vehicleid][vehColorOne],
    vInfo[vehicleid][vehColorTwo], vInfo[vehicleid][vehX], vInfo[vehicleid][vehY], vInfo[vehicleid][vehZ], vInfo[vehicleid][vehA], vInfo[vehicleid][vehID]);
    mysql_tquery(mysql, query);
    return 1;
}
Saving all the mods even though some may not be used?

Edit: The limit for numberplates are 32 chars. why'd you save it as 16 chars,would that be enough?
Reply
#11

Nothing unseen but yeah its MYSQL
Reply
#12

Quote:
Originally Posted by iLearner
Посмотреть сообщение
So you've listened to my suggestion... good job tho!
As i said, it took me a bit time of thinking to release this or not, Thank you by the way.

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I know it might be easier to re-upload the .pwn file again but pushing commits will be better for reviewing the changes.

The filterscript is nice and I know you will eventually change few other things to improve it so I always appreciate you take into consideration most of my suggestions!

PS: Another version for R40+ would be good as well.
The R40+ version will be ready in few minutes or tomorrow, Thank you!

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Hey, isn't this a bad thing to do According to: (https://sampforum.blast.hk/showthread.php?tid=420363)

Код:
...
Saving all the mods even though some may not be used?

Edit: The limit for numberplates are 32 chars. why'd you save it as 16 chars,would that be enough?
I didn't see this thread before when i was making the filterscript, But Konstantinos has already told me about it, Thank you!

Quote:
Originally Posted by Sreyas
Посмотреть сообщение
Nice one
Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
'oly fu' dude - can't rep :3
Quote:
Originally Posted by Dark_Children
Посмотреть сообщение
Great!
Quote:
Originally Posted by RyderX
Посмотреть сообщение
i like it thanks
Quote:
Originally Posted by Eoussama
Посмотреть сообщение
noice
Thank you guys, Appreciate it!
Reply
#13

Update:

- Added MySQL R40+ version.
- Few improvements.
Reply
#14

Nice filterscript, Keep up the good work!
Reply
#15

Cool one
Reply
#16

I downloaded the newest plugins, includes, samp version but I still get the same error back. If you remove that line then you'll get the same error back to another line.


C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(103) : error 075: input line too long (after substitutions)
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(104) : error 037: invalid string (possibly non-terminated string)
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(104) : error 017: undefined symbol "CREATE"
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(104) : error 017: undefined symbol "TABLE"
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(104) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors
Reply
#17

Either use zeex pawn compiler patches, or run this query in your database
Код:
CREATE TABLE IF NOT EXISTS `Vehicles` (`vehID` int(11) NOT NULL, `vehModel` int(11) NOT NULL, `vehName` varchar(25) NOT NULL, `vehOwner` varchar(25) NOT NULL default '-', `vehPlate` varchar(16) NOT NULL default 'UG', `vehPrice` int(11) NOT NULL, `vehLock` int(11) NOT NULL, `vehMod_1` int(11) NOT NULL, `vehMod_2` int(11) NOT NULL, `vehMod_3` int(11) NOT NULL, `vehMod_4` int(11) NOT NULL, `vehMod_5` int(11) NOT NULL, `vehMod_6` int(11) NOT NULL, `vehMod_7` int(11) NOT NULL, `vehMod_8` int(11) NOT NULL, `vehMod_9` int(11) NOT NULL, `vehMod_10` int(11) NOT NULL, `vehMod_11` int(11) NOT NULL, `vehMod_12` int(11) NOT NULL, `vehMod_13` int(11) NOT NULL, `vehMod_14` int(11) NOT NULL, `vehColorOne` int(11) NOT NULL, `vehColorTwo` int(11) NOT NULL, `vehX` float NOT NULL, `vehY` float NOT NULL, `vehZ` float NOT NULL, `vehA` float NOT NULL, UNIQUE KEY `vehID` (`vehID`))
and remove these codes
Код:
mysql_tquery(mysql, "CREATE TABLE IF NOT EXISTS `Vehicles` (\
      `vehID` int(11) NOT NULL,\
      `vehModel` int(11) NOT NULL,\
      `vehName` varchar(25) NOT NULL,\
      `vehOwner` varchar(25) NOT NULL default '-',\
      `vehPlate` varchar(16) NOT NULL default 'UG',\
      `vehPrice` int(11) NOT NULL,\
      `vehLock` int(11) NOT NULL,\
      `vehMod_1` int(11) NOT NULL,\
      `vehMod_2` int(11) NOT NULL,\
      `vehMod_3` int(11) NOT NULL,\
      `vehMod_4` int(11) NOT NULL,\
      `vehMod_5` int(11) NOT NULL,\
      `vehMod_6` int(11) NOT NULL,\
      `vehMod_7` int(11) NOT NULL,\
      `vehMod_8` int(11) NOT NULL,\
      `vehMod_9` int(11) NOT NULL,\
      `vehMod_10` int(11) NOT NULL,\
      `vehMod_11` int(11) NOT NULL,\
      `vehMod_12` int(11) NOT NULL,\
      `vehMod_13` int(11) NOT NULL,\
      `vehMod_14` int(11) NOT NULL,\
      `vehColorOne` int(11) NOT NULL,\
      `vehColorTwo` int(11) NOT NULL,\
      `vehX` float NOT NULL,\
      `vehY` float NOT NULL,\
      `vehZ` float NOT NULL,\
      `vehA` float NOT NULL,\
      UNIQUE KEY `vehID` (`vehID`))");
Reply
#18

I know. I tried to do the same thing, but you get now error to another line.

C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(673) : error 075: input line too long (after substitutions)
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(674) : error 037: invalid string (possibly non-terminated string)
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(674) : error 017: undefined symbol "UPDATE"
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(674) : error 029: invalid expression, assumed zero
C:\Users\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gamemode.pwn(674) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#19

Default pawn compiler has a line limit of 511. You have to split the format or use this to compile: https://sampforum.blast.hk/showthread.php?tid=473595
Reply
#20

Thank you. I used this before, but I totally forgot about it.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)