Vice City Multiplayer

VC:MP => mIRC/pawn Scripting => Script Showroom => Topic started by: Force on July 26, 2008, 03:34:09 PM

Title: Simple gotoloc and saveloc for SanSan
Post by: Force on July 26, 2008, 03:34:09 PM
I got bored just now and decided to whip up a quick gotoloc and saveloc script for sansan. Admittedtly the alias's have come from Tommis' GUS 9.0 ;)

on *:SIGNAL:vcmp.event.gamecmd {


  elseif ($2 == !gotoloc) {
    if (!$3) vcmp.adminmsg $1 Error - Missing Information, $2 <Name>
    elseif (!$vcmp.name.getloc($3-)) vcmp.adminmsg $1 Error - Absent/Wrong Location Name
    else {
      vcmp.adminmsg $1 Taking you to location name: $chr(91) $vcmp.name.getloc($3-) $chr(93)
      vcmp.setloc $1 $vcmp.axis.getloc($3-)
    }
  }

  elseif ($2 == !saveloc) {
    if (!$3) vcmp.adminmsg $1 Error - Missing Information, $2 <Name>
    else {
      vcmp.adminmsg $1 Location Saved - Name: $chr(91) $3- $chr(93)
      !writeini -n vcmp.locations.ini LOCATIONS $round($vcmp.hgetpos.x($1),3) $+ , $+ $round( $vcmp.hgetpos.y($1),3) $+ , $+ $round( $vcmp.hgetpos.z($1)),3) $3-
    }
  }


;--- Go To Loc Alias'


alias vcmp.name.getloc {
  var %a = 0
  while (%a <= $ini(vcmp.locations.ini,LOCATIONS,0)) {
    if ($1 isin $readini(vcmp.locations.ini,LOCATIONS,$ini(vcmp.locations.ini,LOCATIONS,%a))) !return $readini(vcmp.locations.ini,LOCATIONS,$ini(vcmp.locations.ini,LOCATIONS,%a))
    !inc %a
  }
}
alias vcmp.axis.getloc {
  var %a = 0
  while (%a <= $ini(vcmp.locations.ini,LOCATIONS,0)) {
    if ($1 isin $readini(vcmp.locations.ini,LOCATIONS,$ini(vcmp.locations.ini,LOCATIONS,%a))) !return $gettok($ini(vcmp.locations.ini,LOCATIONS,%a),1,44) $gettok($ini(vcmp.locations.ini,LOCATIONS,%a),2,44) $gettok($ini(vcmp.locations.ini,LOCATIONS,%a),3,44)
    !inc %a
  }
}
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: GTA-Roloboy on July 26, 2008, 09:44:04 PM
Quote from: [SDT]F_T_F0RC3 on July 26, 2008, 03:34:09 PM
come from VRocker's GUS 9.0 ;)

hmm, since when is GUS 9.0 of vRocker?  :-\ :P
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Force on July 27, 2008, 12:08:34 AM
Well whoever made it :P I thought it was VRocker
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: bakasan on July 27, 2008, 12:18:12 AM
Tommis  ;)

Quote*These scripts have been wrote fully by me, but i still leave Vrocker's name in there, because without him, i wouldnt of made these scripts
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Tommis on August 04, 2008, 04:43:02 AM
Hey,

I completely URGE you to stay away from this. Get rid of the "loc find loop". Once your ini get's too big, every query will go through every single line trying to find the closest match, causing insane amounts of CPU usage (almost always hanging the scripts).

As in my new scripts, just make it go by exact name. And its not case sensitive, so this should work perfectly.

Regards,
Tommis
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Windlord on August 04, 2008, 06:28:27 AM
Same thing happened to me with the pickups.
Try not to search inis with loops in any case.

Using hashes would be a good idea.
My own computer used to run for a hundred miles before giving the result from my pickup ini.

//Windlord
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Tamas on August 13, 2008, 11:39:23 PM
Hmm this script didnt do anything for me, but i trying  ???
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: maxorator on August 27, 2008, 09:43:58 PM
Yikes... it's like a flame war has unleashed here. K.I.S.S, bazza, stop it, or you'll be banhammered. Stunty2008, don't accuse people of stealing code without referring to a valid source.

Bazza, you are the one offending and insulting people and Force is the one donating pieces of code and being polite to others. Do yourself a favor and leave him alone.
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Jkownz on August 28, 2008, 05:57:33 AM
Doesnt work 4 me says Bad Command im workng on how to fix it
Title: Re: Simple gotoloc and saveloc for SanSan
Post by: Punjabi on September 15, 2008, 06:22:14 PM
For me also........ :(