« [ GameMode ] ADM Script v1.0
Sunshine Auto's - by rulk
[ #D~ Tools ] Textdraw & Sprite Editor! »

Eva

  • Full Member
  • Posts: 138
Re: Sunshine Auto's - by rulk
« Reply #60, on May 2nd, 2016, 06:42 PM »Last edited on May 2nd, 2016, 06:47 PM
Did it manualy now and it works :) thnx

And rulk i looked at your screenshots manual and i do it exactly the same as you show, but it doesnt load the vehicles in sql.blah

and my vehicles are in server.config (old way).

anyway thanks again it works now :)

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
Re: Sunshine Auto's - by rulk
« Reply #61, on May 3rd, 2016, 11:33 PM »
fucking mother cows do everything as this in the script but when I try to open the database of sunshine with this browser opens it me blank, not is that it happens, but I think it is the browser but other databases if you open them. before this example if it opened. What happened to the old sunshine? This is empty...

rulk

  • Full Member
  • Shine Jesus Shine
  • Posts: 119
We are all god's children.

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
Re: Sunshine Auto's - by rulk
« Reply #63, on May 4th, 2016, 10:59 PM »
Error. When I open the browser I choose Import. then it displays a message and I option of duress in 'NO' then says "BROWSER. EXE STOPPED WORKING"

Thijn

  • VC:MP Beta Tester
  • Posts: 1,688

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
Re: Sunshine Auto's - by rulk
« Reply #65, on May 4th, 2016, 11:08 PM »
   CREATE TABLE `MyVehicles` (

         `VehicleID`   INTEGER,

         `VehicleModel`   TEXT,

         `VehicleCat`   TEXT,

         `VehiclePrice`   INTEGER,

         `IsPurchased`   TEXT,

         `IsShared`   TEXT

      );

Thijn

  • VC:MP Beta Tester
  • Posts: 1,688

kennedyarz

  • Sr. Member
  • Making American Great Again
  • Posts: 334
Re: Sunshine Auto's - by rulk
« Reply #67, on May 4th, 2016, 11:37 PM »Last edited on May 4th, 2016, 11:51 PM
help me in line for team views

This does not know that answer. but as he says "it is easy"

Bob

  • Hero Member
  • Posts: 777
Re: Sunshine Auto's - by rulk
« Reply #68, on May 13th, 2016, 01:13 PM »Last edited on May 13th, 2016, 01:15 PM
@rulk I haven't used your script but I have taken the time to read threw and I find it very interesting.
As well as your scripting methods,. This is an interesting release.

This is not a support forum,. @kennedyarz
Please respect author's post when needing help. A kind thing to do is create a support forum and message the content owner in PM that you could use there assistance,. and if the PM does not work just add a link to this post instead.

Also kennedyarz this is not something a rookie plays with or someone like myself technically, Yet I have been scripting for quite some time now. I suggest for you to take the time to read the scripts and study them understand how they work. Learn from rulk. This is not something you just add to a server due to either the server you own sucks and you want to be a boss server owner, This is more of a script you add when your server is successful and you want to treat your player base. Technically this script is pointless without a really decent player base.

@rulk I am glad you have taken the time to create this release for other scriptwriters to be capable to read and understand(if they actually will instead of just attempting to add it to a random server work^^^).
Honestly I do not see myself using this at all instead just reading and understanding.
~*Thank You

Kewun

  • Hero Member
  • Posts: 785
Re: Sunshine Auto's - by rulk
« Reply #69, on June 13th, 2016, 04:28 PM »
i have a problem with this goddamn script
i have created the sql file thing it has 30 kb
whenever when i enter a car, and type /car nothing happens, and prints a error in to console
i entered a stinger, and typed /car
error:

AN ERROR HAS OCCURED [the index '113' does not exist]

line 33
 its:
Code: [Select]
local output = @"Model: " + MyVehicles[ vehicle.ID ].VehicleModel + " - "  +

i cant get it to working :( i already readed your installation guide, but i cant make it work

KAKAN

  • Wiki Contributor
  • Posts: 3,343
Re: Sunshine Auto's - by rulk
« Reply #70, on June 14th, 2016, 08:17 AM »
Well, dump the .sql file to a database file and load that database. Usually, any SQLite viewer/editor can do this work.
Click on the import option, then select .sql as the option and locate the sql file.
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

Kewun

  • Hero Member
  • Posts: 785
Re: Sunshine Auto's - by rulk
« Reply #71, on June 14th, 2016, 03:04 PM »Last edited on June 14th, 2016, 03:20 PM
still the same error
i mean, how to import and then load to that database file?

nvm, i fixed myself

THX!!!
Re: Sunshine Auto's - by rulk
« Reply #72, on August 21st, 2016, 05:55 PM »
Found a exploit in your script in the /buycar command

Players can buy car, but without money.

Code: [Select]

if ( cmd == "buycar" )
{
// Lets first establish if your in a vehicle
if ( player.Vehicle == null ) MessagePlayer( "[#ff0000]Error: you are not in a vehicle.", player );
else
{
// OK, we're in a vehicle, lets get it's instance into a variable.
local vehicle = player.Vehicle;

// Put the IsPurchased property into a variable, so we can access squirrel's VM built in manipulation functions for that data type.
local val = MyVehicles[ vehicle.ID ].IsPurchased;

// First, check its an empty value ( it's available to buy )
if ( ( val == null ) || ( val.len() == 0 ) )
{
// Then Set the value in our array.
MyVehicles[ vehicle.ID ].IsPurchased = player.Name;

// The array has been updated, so set our value to 'true' so we can save it to the database.
MyVehicles[ vehicle.ID ].Update = true;

// Display whats going on.
MessagePlayer( "[#ff0000]You have now purchased this vehicle.", player );
}

// It's got a value, and is purchased, therefore, not avilable to buy
else MessagePlayer( "[#ff0000]Error: Vehicle not avilable to purchase.", player );
}
}

there isnt any money checks , so a player can buy any car with 0$  in their pocket
Re: Sunshine Auto's - by rulk
« Reply #73, on August 21st, 2016, 06:48 PM »
fixed

Code: [Select]
if ( cmd == "buycar" )
{
// Lets first establish if your in a vehicle
if ( player.Vehicle == null ) MessagePlayer( "[#ff0000]Error: you are not in a vehicle.", player );
else
{
// OK, we're in a vehicle, lets get it's instance into a variable.
local vehicle = player.Vehicle;

// Put the IsPurchased property into a variable, so we can access squirrel's VM built in manipulation functions for that data type.
local val = MyVehicles[ vehicle.ID ].IsPurchased;

// First, check its an empty value ( it's available to buy )
if ( player.Cash < MyVehicles[vehicle.ID].VehiclePrice ) {
PM("[#ff0000]Not enought cash",player)
return false;
}
if ( ( val == null ) || ( val.len() == 0 ) )
{
// Then Set the value in our array.
MyVehicles[ vehicle.ID ].IsPurchased = player.Name;

// The array has been updated, so set our value to 'true' so we can save it to the database.
MyVehicles[ vehicle.ID ].Update = true;
player.Cash -= MyVehicles[vehicle.ID].VehiclePrice;
// Display whats going on.
MessagePlayer( "[#ff0000]You have now purchased this vehicle.", player );
}

// It's got a value, and is purchased, therefore, not avilable to buy
else MessagePlayer( "[#ff0000]Error: Vehicle not avilable to purchase.", player );
}
}
Re: Sunshine Auto's - by rulk
« Reply #74, on August 28th, 2016, 04:15 PM »
Quote from Kewun on August 21st, 2016, 06:48 PM
fixed

Code: [Select]
if ( cmd == "buycar" )
{
// Lets first establish if your in a vehicle
if ( player.Vehicle == null ) MessagePlayer( "[#ff0000]Error: you are not in a vehicle.", player );
else
{
// OK, we're in a vehicle, lets get it's instance into a variable.
local vehicle = player.Vehicle;

// Put the IsPurchased property into a variable, so we can access squirrel's VM built in manipulation functions for that data type.
local val = MyVehicles[ vehicle.ID ].IsPurchased;

// First, check its an empty value ( it's available to buy )
if ( player.Cash < MyVehicles[vehicle.ID].VehiclePrice ) {
PM("[#ff0000]Not enought cash",player)
return false;
}
if ( ( val == null ) || ( val.len() == 0 ) )
{
// Then Set the value in our array.
MyVehicles[ vehicle.ID ].IsPurchased = player.Name;

// The array has been updated, so set our value to 'true' so we can save it to the database.
MyVehicles[ vehicle.ID ].Update = true;
player.Cash -= MyVehicles[vehicle.ID].VehiclePrice;
// Display whats going on.
MessagePlayer( "[#ff0000]You have now purchased this vehicle.", player );
}

// It's got a value, and is purchased, therefore, not avilable to buy
else MessagePlayer( "[#ff0000]Error: Vehicle not avilable to purchase.", player );
}
}
i forgot a little thing, use MessagePlayer instead of PM because in my script i use PM created function.

« [ GameMode ] ADM Script v1.0
[ #D~ Tools ] Textdraw & Sprite Editor! »