Vehicle Happy one minute

Started by [VSS]Shawn, Jul 22, 2015, 04:15 AM

Previous topic - Next topic

[VSS]Shawn

Hello Last time Kakan say u didn't made any snippet :( but i want to release one of them Its is almost maden by me but Mashreq help me in Query

Creater: Shawn
Helper: Mashreq


Well it works perfect in Vccnr but u can even change and add your query if u are using any other script

Add it on Commands

if(cmd=="vhm")
    { 
   //your admin level function
      else if ( !text) MessagePlayer( "/vhm <Vehicle-Model>.", player );
   else if ( VhmActive == true ) MessagePlayer( "Vehicle Minute is already active.", player );
{
           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+"'");
            Message("Happy one minute has started!");
   NewTimer( "stop",60000, 1, text );
           local changing=  QuerySQL( db, "UPDATE VehicleCost SET Cost='10000' WHERE Name='" + text + "'" );  // add your one if not similiar
   EchoMessage( ICOL_RED + "Happy one minute for car started." );
  VhmActive = true
    Message("[#FF0000]Vehicle "+text+" [#FFF000]is now for just 000 hurry up before it [#FFFFFF]expires, the offer is available for only one minute!");
FreeSQLQuery(changing);

}   

Functions....

function stop(text)
{
local restoring = QuerySQL( db, "UPDATE VehicleCost SET Cost='900000' WHERE Name='" + text + "'" ); // your query
Message( "[#FF0000]Vehicle " + text + " Ammount has been exceeded" );
VhmActive= false;
FreeSQLQuery(restoring);
}

on Main.nut ...

onScriptLoad()
{
VhmActive <- false;
}

And Functions Again....


Enjoy if don't work Pm me ;)


Code Updated .. Thanks Beztone

Alterito


[VSS]Shawn


[VSS]Shawn

Lol Who say yoiu for Do 5 time if one is not end and its for admin i have say their add your admin level function

[VSS]Shawn

Code is Updated Please see first post

Thijn

Why do you query the same thing twice without freeing the results? This could easily result in an memory leak...

.

Quote from: Thijn on Jul 22, 2015, 05:49 AM... This could easily result in an memory leak...

It is a memory leak. No need to be polite about it :P
.

[VSS]Shawn

#7
Sorry Code Updated Thanks Beztone