Happy Minute

Started by [VSS]Shawn, Jul 12, 2015, 10:55 AM

Previous topic - Next topic

[VSS]Shawn

Hello Guys well i was making happy car minute for my server but i m unable to make it

This is irc command I made it little bit but problem is that database does not updated You can see the code


if(cmd=="!vhm")
{
  local q = QuerySQL( db, "SELECT Cost,Name FROM VehicleCost WHERE rowid LIKE '"+text+"'");
  local Cost = QuerySQL( db, "SELECT Cost FROM VehicleCost WHERE rowid LIKE '"+text+"'");
  if ( !text ) EchoMessage( ICOL_RED + "!vhm <infernus/hotring>." );
  else if ( level <= 3 )  EchoMessage( ICOL_GREEN + "Insufficient Level" );
else if ( text == "Infernus" )
{
            EMessage("Happy one minute has started!");
            QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' WHERE rowid LIKE '" + text + "'" );
EchoMessage( ICOL_RED + "Happy one minute for car started." );
EchoMessage( ICOL_RED + "Vehicle Infernus is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
EMessage("Vehicle Infernus is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
}
else if ( text == "Hotring Racer #2" )
{
EMessage("Happy one minute has started!");
            QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' where rowid like '"+text+"'" );
EchoMessage( ICOL_RED + "Happy one minute for car started." );
EchoMessage( ICOL_RED + "Vehicle Hotring Race #2 is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
EMessage("Vehicle Hotring Racer #2 is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
}

:\

FarisDon

#1
Quote from: [VSS]Shawn on Jul 12, 2015, 10:55 AMHello Guys well i was making happy car minute for my server but i m unable to make it

This is irc command I made it little bit but problem is that database does not updated You can see the code

if(cmd=="!vhm")
{
    local q = QuerySQL( db, "SELECT Cost,Name FROM VehicleCost WHERE rowid LIKE '"+text+"'");
                                    local Cost = QuerySQL( db, "SELECT Cost FROM VehicleCost WHERE rowid LIKE '"+text+"'");
  if ( !text ) EchoMessage( ICOL_RED + "!vhm <infernus/hotring>." );
  else if ( level <= 3 )  EchoMessage( ICOL_GREEN + "Insufficient Level" );
else if ( text == "Infernus" )
{
            EMessage("Happy one minute has started!");
            QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' WHERE rowid LIKE '" + text + "'" );
EchoMessage( ICOL_RED + "Happy one minute for car started." );
EchoMessage( ICOL_RED + "Vehicle Infernus is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
EMessage("Vehicle Infernus is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
}
else if ( text == "Hotring Racer #2" )
{
EMessage("Happy one minute has started!");
            QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' where rowid like '"+text+"'" );
EchoMessage( ICOL_RED + "Happy one minute for car started." );
EchoMessage( ICOL_RED + "Vehicle Hotring Race #2 is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
EMessage("Vehicle Hotring Racer #2 is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
}

:\
The only problem with your db is your leaked script which doesn't let you think , but let you copy the things , and now there 2 ways to solve it.
(1)Leave Scripting and become a criminal in vcmp history as there are many , and you are the one of them.
(2)will you please post the error!!!! if you want solution
Edit:try this
if(cmd=="!vhm")
    {
      local q = QuerySQL( db, "SELECT Cost,Name FROM VehicleCost WHERE rowid LIKE '"+text+"'");
      local Cost = QuerySQL( db, "SELECT Cost FROM VehicleCost WHERE rowid LIKE '"+text+"'");
      if ( !text) EchoMessage( ICOL_RED + "!vhm <Vehicle-Model>." );//now you are able to set any vehicle model cost to 10000.
      else if ( level <= 3 )  EchoMessage( ICOL_GREEN + "Insufficient Level" );
else
{
            EMessage("Happy one minute has started!");
            QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' WHERE Name '" + text + "'" );//just got table name from vccnr
   EchoMessage( ICOL_RED + "Happy one minute for car started." );
   EchoMessage( ICOL_RED + "Vehicle Infernus is now for just $10000 hurry up before it expires, the offer is available for only one minute!");
    EMessage("Vehicle "+text+" is now for just $10000 hurry up before it expires, the offer is available for only one minute!");

}   
Try this might be that work.

[VSS]Shawn

Same as My Command Issue When i sit in infernus and do /car Cost 780000
-_-

FarisDon

Quote from: [VSS]Shawn on Jul 12, 2015, 11:27 AMSame as My Command Issue When i sit in infernus and do /car Cost 780000
-_-
What?i can't understand what you are talking about!,will you show me error and does that work?

[VSS]Shawn

Lol There is no error in console

FarisDon

I mean to show the database table picture.

[VSS]Shawn

i m on laptop can t show on screenshot but might remember That Its like this

VehicleCost table name

Rows
Job Name Cost
0 Carname Cost

FarisDon

else if(cmd=="!vhm")
    {
QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' WHERE Name '" + text + "'" );
}
Don't worry i just gave you this code to check that if it works! so now check and tell else there would be other problem.

[VSS]Shawn


FarisDon

Well i give up since you are copying things it wouldn't work.

[VSS]Shawn

what stfu i made it my self dont work so came here for help

Mashreq

Are you updating the table according to the vehicle name or its id?
I see you are updating the cost according to the rowid for the table (VehicleCost), are you storing the vehicle name in your database?

[VSS]Shawn

yes its VehicleCost

FarisDon

Quote from: Mashreq on Jul 12, 2015, 12:38 PMAre you updating the table according to the vehicle name or its id?
I see you are updating the cost according to the rowid for the table (VehicleCost), are you storing the vehicle name in your database?
Yes,He is.

Thijn

"Cost" shouldn't be a text field, so wont need quotes.