• Welcome to Vice City Multiplayer.
 

Scripting new areas - Only for gus new dll

Started by Chezor, March 22, 2009, 06:37:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Chezor

elseif ($3 == corner1) {
    if ($vcmp.cmdcheck(!corner1,%id) == fail) !halt
    else {
      !writeini -n vc-mp/vcmp.myarea.ini AREA x1 $round($vcmp.location($1,%id).x,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA y1 $round($vcmp.location($1,%id).y,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA z1 $round($vcmp.location($1,%id).z,3)
      !writeini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id) yes
      vcmp.msg $1 %id Corner 1 saved
    }
  }
  elseif ($3 == corner2) {
    var %c1 = $readini(vc-mp/vcmp.myarea.ini,C1,$vcmp.name($1,%id))
    if ($vcmp.cmdcheck(!corner2,%id) == fail) !halt
    elseif (%c1 != yes) vcmp.msg $1 %id Corner1 is not saved.
    else {
      !writeini -n vc-mp/vcmp.myarea.ini AREA x2 $round($vcmp.location($1,%id).x,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA y2 $round($vcmp.location($1,%id).y,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA z2 $round($vcmp.location($1,%id).z,3)
      !writeini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id) yes
      vcmp.msg $1 %id Corner 2 saved
    }
  }
  elseif ($3 == setarea) {
    var %x1 = $readini(vc-mp/vcmp.myarea.ini,AREA,x1)
    var %y1 = $readini(vc-mp/vcmp.myarea.ini,AREA,y1)
    var %z1 = $readini(vc-mp/vcmp.myarea.ini,AREA,z1)
    var %x2 = $readini(vc-mp/vcmp.myarea.ini,AREA,x2)
    var %y2 = $readini(vc-mp/vcmp.myarea.ini,AREA,y2)
    var %z2 = $readini(vc-mp/vcmp.myarea.ini,AREA,z2)
    var %c1 = $readini(vc-mp/vcmp.myarea.ini,C1,$vcmp.name($1,%id))
    var %c2 = $readini(vc-mp/vcmp.myarea.ini,C2,$vcmp.name($1,%id))
    if ($vcmp.cmdcheck(!createarea,%id) == fail) !halt
    elseif (!$4) vcmp.msg $1 %id Please enter name for your new Area
    elseif (%c1 != yes) vcmp.msg $1 %id Corner1 is not saved.
    elseif (%c2 != yes) vcmp.msg $1 %id Corner2 is not saved.
    else {
      !writeini -n vc-mp/vcmp.myarea.ini SETAREA %x1 $+ , $+ %y2 $+ , $+ %x2 $+ , $+ %y2 $+ , $+ %x2 $+ , $+ %y1 $+ , $+ %x1 $+ , $+ %y1 $4-
      !remini -n vc-mp/vcmp.myarea.ini AREA x1
      !remini -n vc-mp/vcmp.myarea.ini AREA y1
      !remini -n vc-mp/vcmp.myarea.ini AREA z1
      !remini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id)
      !remini -n vc-mp/vcmp.myarea.ini AREA x2
      !remini -n vc-mp/vcmp.myarea.ini AREA y2
      !remini -n vc-mp/vcmp.myarea.ini AREA z2
      !remini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id)
      vcmp.msg $1 %id New Area Created: $4-
    }
  }
  elseif ($3 == clearareaini) {
    if ($vcmp.cmdcheck(!clearareafile,%id) == fail) !halt
    else {
      !remini -n vc-mp/vcmp.myarea.ini AREA x1
      !remini -n vc-mp/vcmp.myarea.ini AREA y1
      !remini -n vc-mp/vcmp.myarea.ini AREA z1
      !remini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id)
      !remini -n vc-mp/vcmp.myarea.ini AREA x2
      !remini -n vc-mp/vcmp.myarea.ini AREA y2
      !remini -n vc-mp/vcmp.myarea.ini AREA z2
      !remini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id)
      vcmp.msg $1 %id Your area file cleared.
    }
  }


  This is script for scripting a name for a particular area.  But only 1 person can use it at a time. Suppose you have to name a area of house with square shape. Then just go at one corner of house and type /c corner1 and then go to opposite corner of the house and type /c corner2 and then type /c setarea <nameofarea>. Your area is created. Its in vc-mp/vcmp.myarea.ini
  Now copy your area line and paste it in vcmp.data.ini at the top of other areas. and restart mirc. done!
  And if the area script gets bugged just type /c clearareaini

Chezor...

Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..

thijn

The Z axis is not needed, So it would be:

elseif ($3 == corner1) {
    if ($vcmp.cmdcheck(!corner1,%id) == fail) !halt
    else {
      !writeini -n vc-mp/vcmp.myarea.ini AREA x1 $round($vcmp.location($1,%id).x,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA y1 $round($vcmp.location($1,%id).y,3)
      !writeini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id) yes
      vcmp.msg $1 %id Corner 1 saved
    }
  }
  elseif ($3 == corner2) {
    var %c1 = $readini(vc-mp/vcmp.myarea.ini,C1,$vcmp.name($1,%id))
    if ($vcmp.cmdcheck(!corner2,%id) == fail) !halt
    elseif (%c1 != yes) vcmp.msg $1 %id Corner1 is not saved.
    else {
      !writeini -n vc-mp/vcmp.myarea.ini AREA x2 $round($vcmp.location($1,%id).x,3)
      !writeini -n vc-mp/vcmp.myarea.ini AREA y2 $round($vcmp.location($1,%id).y,3)
      !writeini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id) yes
      vcmp.msg $1 %id Corner 2 saved
    }
  }
  elseif ($3 == setarea) {
    var %x1 = $readini(vc-mp/vcmp.myarea.ini,AREA,x1)
    var %y1 = $readini(vc-mp/vcmp.myarea.ini,AREA,y1)
    var %x2 = $readini(vc-mp/vcmp.myarea.ini,AREA,x2)
    var %y2 = $readini(vc-mp/vcmp.myarea.ini,AREA,y2)
    var %c1 = $readini(vc-mp/vcmp.myarea.ini,C1,$vcmp.name($1,%id))
    var %c2 = $readini(vc-mp/vcmp.myarea.ini,C2,$vcmp.name($1,%id))
    if ($vcmp.cmdcheck(!createarea,%id) == fail) !halt
    elseif (!$4) vcmp.msg $1 %id Please enter name for your new Area
    elseif (%c1 != yes) vcmp.msg $1 %id Corner1 is not saved.
    elseif (%c2 != yes) vcmp.msg $1 %id Corner2 is not saved.
    else {
      !writeini -n vc-mp/vcmp.myarea.ini SETAREA %x1 $+ , $+ %y2 $+ , $+ %x2 $+ , $+ %y2 $+ , $+ %x2 $+ , $+ %y1 $+ , $+ %x1 $+ , $+ %y1 $4-
      !remini -n vc-mp/vcmp.myarea.ini AREA x1
      !remini -n vc-mp/vcmp.myarea.ini AREA y1
      !remini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id)
      !remini -n vc-mp/vcmp.myarea.ini AREA x2
      !remini -n vc-mp/vcmp.myarea.ini AREA y2
      !remini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id)
      vcmp.msg $1 %id New Area Created: $4-
    }
  }
  elseif ($3 == clearareaini) {
    if ($vcmp.cmdcheck(!clearareafile,%id) == fail) !halt
    else {
      !remini -n vc-mp/vcmp.myarea.ini AREA x1
      !remini -n vc-mp/vcmp.myarea.ini AREA y1
      !remini -n vc-mp/vcmp.myarea.ini C1 $vcmp.name($1,%id)
      !remini -n vc-mp/vcmp.myarea.ini AREA x2
      !remini -n vc-mp/vcmp.myarea.ini AREA y2
      !remini -n vc-mp/vcmp.myarea.ini C2 $vcmp.name($1,%id)
      vcmp.msg $1 %id Your area file cleared.
    }
  }

Anyways, Nice script ;)


Chezor


Scripts: Fuel system in vehicles, Speedometer, Spawnback, Improved Copwork, Improved Jailing, Improved phone with sms, and many more. Coming soon..