Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Script Showroom => Topic started by: Rusty on March 18, 2009, 03:33:43 PM

Title: Weed Growing [FBS Add-On]
Post by: Rusty on March 18, 2009, 03:33:43 PM
Here's a very simple Weed Growing System.

Commands: !growweed, !pickweed


  elseif ($3 == growweed) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 Must be logged in.
    elseif (Weedfield !isin $FBS.Buildings(1, $2)) vcmp.msg $1 $2 You can only grow Weed in the Field.
    elseif ($readini(FBS.weed.ini,PLANTED,$vcmp.name($1, $2)) == Planted) vcmp.msg $1 $2 You are already growing Weed, wait till you pick then grow some more.
    else {
      vcmp.msg $1 $2 You are now growing Weed, wait till it grows.
      !writeini -n FBS.weed.ini PLANTED $vcmp.name($1, $2) Planted
      timer 1 60 vcmp.msg $1 $2 Your weed has Grown. Type !pickweed to pick it.
      !writeini -n FBS.weed.ini GROWN $vcmp.name($1, $2) Weedgrown
    }
  }
  elseif ($3 == pickweed) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 Must be logged in.
    elseif (Weedfield !isin $FBS.Buildings(1, $2)) vcmp.msg $1 $2 You Must be at the Field to Pick Weed.
    elseif ($readini(FBS.weed.ini,GROWN,$vcmp.name($1, $2)) == $null) vcmp.msg $1 $2 You must Grow your Weed first.
    else {
      vcmp.msg $1 $2 You have picked up your Units of Weed.
      !writeini -n FBS.weed.ini WEED $vcmp.name($1, $2) $calc($FBS.drugweed($1, $2) + 4)
      !remini -n FBS.weed.ini PLANTED $vcmp.name($1, $2)
      !remini -n FBS.weed.ini GROWN $vcmp.name($1, $2)
    }
  }


!weed - Command to show how much weed you Have.

  elseif ($3 == weed) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 Must be logged in.
    else {
      vcmp.msg $1 $2 Weed: $iif($readini(FBS.weed.ini,WEED,$vcmp.name($1, $2)),$v1,0)
    }
  }




Weed Alias: alias FBS.drugweed !return $iif($readini(FBS.weed.ini,WEED,$vcmp.name($1, $2)),$v1,0)
Title: Re: Weed Growing [FBS Add-On]
Post by: VRocker on March 19, 2009, 02:27:39 PM
Noticed a small bug in this script.
You have this line:

      timer 1 60 vcmp.msg $1 $2 Your weed has Grown. Type !pickweed to pick it.
      !writeini -n FBS.weed.ini GROWN $vcmp.name($1, $2) Weedgrown


This is actually writing to GROWN straight away since mirc starts a timer, then moves onto the next. So this is waiting 60 seconds to tell you, but you are able to pick the weed straight away.

A better way would be to put an alias on a timer, which tells you and writes to the ini.

Also a small suggestion for the timer, give it a unique name for the player. So when they leave it can be stopped. Otherwise if someone type !growweed and leaves then somebody else joins with the same player id, they will get the message about it being grown.

Something like .timer $+ $2 would do.
Title: Re: Weed Growing [FBS Add-On]
Post by: [DGC]Doomer on March 23, 2009, 04:28:39 PM
an example please i dont understand what you mean :-\
Title: Re: Weed Growing [FBS Add-On]
Post by: Edward_RD on November 17, 2009, 01:56:31 AM
Hya all,

I think he is saying....  you will pickwep before the 60 mins, but the notice is in 60 mins,  but u will take the pick before the 60 minutes...

Regars
Edward_RD
Title: Re: Weed Growing [FBS Add-On]
Post by: Javi on November 17, 2009, 05:11:38 PM
Quote from: Edward_RD on November 17, 2009, 01:56:31 AM
I think he is saying....  you will pickwep before the 60 mins, but the notice is in 60 mins,  but u will take the pick before the 60 minutes...
You are awesome.

WTF are you trying to say?!
Title: Re: Weed Growing [FBS Add-On]
Post by: NicoArin on February 15, 2010, 03:25:21 AM
Quote from: Forze on November 17, 2009, 05:11:38 PM
Quote from: Edward_RD on November 17, 2009, 01:56:31 AM
I think he is saying....  you will pickwep before the 60 mins, but the notice is in 60 mins,  but u will take the pick before the 60 minutes...
You are awesome.

WTF are you trying to say?!
yes he is, didnt u know?