• Welcome to Vice City Multiplayer.
 

Weed Growing [FBS Add-On]

Started by Rusty, March 18, 2009, 02:33:43 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Rusty

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)

VRocker

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.


[DGC]Doomer

an example please i dont understand what you mean :-\

Edward_RD

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

Javi

Quote from: Edward_RD on November 17, 2009, 12: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?!

NicoArin

Quote from: Forze on November 17, 2009, 04:11:38 PM
Quote from: Edward_RD on November 17, 2009, 12: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?