Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Script Showroom => Topic started by: Amenine on January 05, 2009, 01:18:45 PM

Title: License Script [Done]
Post by: Amenine on January 05, 2009, 01:18:45 PM
[LB]Darkness requested me for a license script so i have done for him..here it is minor bugs can be here but will work..[GUS]..

Here the script how u can get ur driving license..
elseif ($2 == !getlicense) {
  if (Sunshine-Autos !isin $vcmp.area(%b)) vcmp.msg %id Error - You have to be at the Sunshine Autos!
  elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
  else {
    .timer 1 1  vcmp.setcont %id 0
    .timer 1 1 vcmp.announce %id ~y~Please wait..
    .timer 1 2 vcmp.cash- %b $vcmp.cost(%b)
    !writeini -n vcmp.license.ini LICENSE %name yes
    .timer 1 3  vcmp.msg $2 You can now drive vehicles...
    .timer 1 3 vcmp.announce %id ~y~Got a License!
    .timer 1 3 vcmp.setcont %id 1
  }
}


And License identifier..
on *:SIGNAL:vcmp.enter:{
  var %name = $1
  var %id = $vcmp.getid($1)
  var %Entertype = $4
 
  if ( %EnterType == 16) vcmp.msg %id Entered Vehicle as a driver..
    if ($readini(vcmp.license.ini,LICENSE,%name) == yes) {
      vcmp.msg %id You can drive vehicle,you have driving license..
    }
    else vcmp.msg %id You dont got driving license..
      vcmp.setlocation %id $vcmp.location(%id)
    }
  }
}


-------------------------------
Location:
-------------------------------

-1013.792,-862.95,17.954=SunShine-Autos


Note:Untested

Thanks
Amenine
Title: Re: License Script [Done]
Post by: Darkness on January 07, 2009, 09:56:15 AM
Thank You very Much :)
Title: Re: License Script [Done]
Post by: Amenine on January 07, 2009, 07:38:59 PM
You welcome.. :D
Title: Re: License Script [Done]
Post by: [ECG]CraCk on January 27, 2009, 09:00:54 PM
Nice but how do i get it to my Server?
Title: Re: License Script [Done]
Post by: thijn on January 27, 2009, 10:11:08 PM
Just add it into ur GUS script
Title: Re: License Script [Done]
Post by: Daniel95 on January 30, 2009, 04:01:22 PM
And what its will do?
Title: Re: License Script [Done]
Post by: [NoN]Toiletduck on January 30, 2009, 04:22:45 PM
Quote from: Amenine on January 05, 2009, 01:18:45 PM
[LB]Darkness requested me for a license script so i have done for him..here it is minor bugs can be here but will work..[GUS]..

Here the script how u can get ur driving license..
elseif ($2 == !getlicense) {
  if (Sunshine-Autos !isin $vcmp.area(%b)) vcmp.msg %id Error - You have to be at the Sunshine Autos!
  elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
  else {
    .timer 1 1  vcmp.setcont %id 0
    .timer 1 1 vcmp.announce %id ~y~Please wait..
    .timer 1 2 vcmp.cash- %b $vcmp.cost(%b)
    !writeini -n vcmp.license.ini LICENSE %name yes
    .timer 1 3  vcmp.msg $2 You can now drive vehicles...
    .timer 1 3 vcmp.announce %id ~y~Got a License!
    .timer 1 3 vcmp.setcont %id 1
  }
}


And License identifier..
on *:SIGNAL:vcmp.enter:{
  var %name = $1
  var %id = $vcmp.getid($1)
  var %Entertype = $4
 
  if ( %EnterType == 16) vcmp.msg %id Entered Vehicle as a driver..
    if ($readini(vcmp.license.ini,LICENSE,%name) == yes) {
      vcmp.msg %id You can drive vehicle,you have driving license..
    }
    else vcmp.msg %id You dont got driving license..
      vcmp.setlocation %id $vcmp.location(%id)
    }
  }
}


-------------------------------
Location:
-------------------------------

-1013.792,-862.95,17.954=SunShine-Autos


Note:Untested

Thanks
Amenine





Okay now there are some problems with this so let me help you out!


Command
elseif ($2 == !getlicense) {
  if (Sunshine-Autos !isin $vcmp.area(%b)) vcmp.msg %id Error - You have to be at the Sunshine Autos!
  elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
  else {
    .timer 1 1  vcmp.setcont %id 0
    .timer 1 1 vcmp.announce %id ~y~Please wait..
    .timer 1 2 vcmp.cash- %b $vcmp.cost(%b)
    !writeini -n vcmp.license.ini LICENSE %name yes
    .timer 1 3  vcmp.msg $2 You may now drive vehicles...
    .timer 1 3 vcmp.announce %id ~y~Received a License!
    .timer 1 3 vcmp.setcont %id 1
  }
}




And License identifier..
on *:SIGNAL:vcmp.enter:{
  var %name = $1
  var %id = $vcmp.getid($1)
  var %Entertype = $4
 
  if ( %EnterType == 16) vcmp.msg %id Entered Vehicle as a driver..
    if ($readini(vcmp.license.ini,LICENSE,%name) == yes) {
      vcmp.msg %id Driving this vehicle as a legal driver.
    }
    else {
      vcmp.msg %id You have no driver's license.
      vcmp.setlocation %id $vcmp.location(%id)
  }



Title: Re: License Script [Done]
Post by: vice on February 08, 2009, 07:31:27 PM
just 1 small qeustion. if i press scripts editor -> remote. i just copy and paste the codes somewhere? or in a special section? plz help
Title: Re: License Script [Done]
Post by: Knucis on February 08, 2009, 09:08:07 PM
You need to put in a special part of the script:
On the SIGNAL:vcmp.enter [on *:SIGNAL:vcmp.enter:{] put this:
var %name = $1
  var %id = $vcmp.getid($1)
  var %Entertype = $4
 
  if ( %EnterType == 16) vcmp.msg %id Entered Vehicle as a driver..
    if ($readini(vcmp.license.ini,LICENSE,%name) == yes) {
      vcmp.msg %id You can drive vehicle,you have driving license..
    }
    else vcmp.msg %id You dont got driving license..
      vcmp.setlocation %id $vcmp.location(%id)
    }
  }
}


And on the SIGNAL:vcmp.command [on *:SIGNAL:vcmp.command:{] put this:
elseif ($2 == !getlicense) {
  if (Sunshine-Autos !isin $vcmp.area(%b)) vcmp.msg %id Error - You have to be at the Sunshine Autos!
  elseif ($vcmp.cost(%b) > $vcmp.cash(%b)) vcmp.msg %id Error - You need atleast $ $+ $bytes($vcmp.cost(%b),b) to use this command
  else {
    .timer 1 1  vcmp.setcont %id 0
    .timer 1 1 vcmp.announce %id ~y~Please wait..
    .timer 1 2 vcmp.cash- %b $vcmp.cost(%b)
    !writeini -n vcmp.license.ini LICENSE %name yes
    .timer 1 3  vcmp.msg $2 You can now drive vehicles...
    .timer 1 3 vcmp.announce %id ~y~Got a License!
    .timer 1 3 vcmp.setcont %id 1
  }
}
Title: Re: License Script [Done]
Post by: Kaufmancab51 on March 15, 2009, 05:37:22 PM
I can't get the ! command to work! what am i doing wrong?

/}}if: not connected to server (line 327, vcmp.rpg.mrc)

Invalid parameters: $inpoly (line 701, vcmp.mrc)
Title: Re: License Script [Done]
Post by: [XT]ariel[X] on October 16, 2009, 08:47:49 PM
and for WSV?? :D