Author Topic: Question  (Read 5144 times)

0 Members and 1 Guest are viewing this topic.

Offline Cristian

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Question
« on: September 07, 2008, 02:27:00 pm »
Hi,

Question:

1? there is a !lockcar and a !unlockcar for SanSan v3 ?  as is the script?

2? There is a command to know: how many cars there are sold, how many there are prop sold, how many cars there are in total, how many there are in total prop? as is the script?
   
thanks for your reply!


szostol

  • Guest
Re: Question
« Reply #1 on: September 07, 2008, 08:36:46 pm »
1* make it your self, you have example with lockcar for wsv in next topic

2* Count how many cars you have in map, write ti in some ini file like cars.ini
[CARS]
total=177
forsale=177

and add to buycar command line wich - 1 from forsale and to sell command + 1 to forsale, then make alias wich read from file how much cars are for sale and how much are total


Offline Cristian

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Question
« Reply #2 on: September 07, 2008, 10:38:12 pm »
I do not understand, and as is the command !forsale?


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Question
« Reply #3 on: September 07, 2008, 10:44:49 pm »
something like:
alias:
Code: [Select]
alias vcmp.forsale.car !return $readini(vcmp.forsale.ini,FORSALE,car)
add in vcmp.forsale.ini:
Code: [Select]
[FORSALE]
cars=Numbers of cars for sale
then add in !buycar:
Code: [Select]
var %forsale = $calc($vcmp.forsale.car - 1)
!writeini -n vcmp.forsale.ini FORSALE car %forsale
NOTE: UNSTESTED

Offline Cristian

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Question
« Reply #4 on: September 07, 2008, 10:53:40 pm »
if I change WSV by VCMP work?

Quote
alias WSV.lockcar {
  var %car = $WSV.vehicle($2)
  if ($WSV.name($2) isin $WSV.carowners(%car)) {
      WSV.setvehiclestatus %car 1
      WSV.msg $2 Your Car is Locked..
  }
}

by

Quote
alias vcmp.lockcar {
  var %car = $vcmp.vehicle($2)
  if ($vcmp.name($2) isin $vcmp.carowners(%car)) {
      vcmp.setvehiclestatus %car 1
      vcmp.msg $2 Your Car is Locked..
  }
}

ahy be changed or something else?

Quote
alias WSV.unlockcar {
  var %car = $WSV.vehicle($2)
  if ($WSV.name($2) isin $WSV.carowners(%car)) {
      WSV.setvehiclestatus %car 0
      WSV.msg $2 Your Car is unLocked..
  }

by

Quote
alias vcmp.unlockcar {
  var %car = $vcmp.vehicle($2)
  if ($vcmp.name($2) isin $vcmp.carowners(%car)) {
      vcmp.setvehiclestatus %car 0
      vcmp.msg $2 Your Car is unLocked..
  }

thank for your reply


szostol

  • Guest
Re: Question
« Reply #5 on: September 07, 2008, 10:55:47 pm »
Nope, it won't work.

Offline Cristian

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Question
« Reply #6 on: September 07, 2008, 11:12:18 pm »
hmmmm ok


szostol

  • Guest
Re: Question
« Reply #7 on: September 07, 2008, 11:23:43 pm »
What script are you basing on? I will do it in defiance of my-self and make it for you if you need it for gus.

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Question
« Reply #8 on: September 08, 2008, 09:24:59 am »
try:
Alias:
Code: [Select]
alias vcmp.lockdoors dll rcondll.dll RconCommand set 3 $1-
Command:
!lock
Code: [Select]
elseif ($2 == !lock) || {
    if ($vcmp.cmdcheck(!lockcar,%id) == fail) !halt
    else {
      vcmp.lockdoors $vcmp.vehicle(%id,id) 4
      vcmp.msg %id You have just locked your vehicle
}
}
!unlock:
Code: [Select]
elseif ($2 == !lock) || {
    if ($vcmp.cmdcheck(!lock,%id) == fail) !halt
    else {
      vcmp.lockdoors $vcmp.vehicle(%id,id) 0
      vcmp.msg %id You have just unlocked your vehicle
}
}


szostol

  • Guest
Re: Question
« Reply #9 on: September 08, 2008, 01:59:38 pm »
My car lock:

Quote
  elseif ($2 == !lockcar) || ($2 == !pmlockcar) {
    if ($vcmp.cmdcheck(!lockcar,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Invalid command useage
    elseif ($3 !isnum) vcmp.msg %id Error - Invalid Vehicle ID
    elseif ($vcmp.carowner($3) != %name) vcmp.msg %id You aren't owner of this vechicle
    else {
      vcmp.lockdoors $3 4
      vcmp.msg %id You have just locked your vehicle
    }
  }

Quote
  elseif ($2 == !unlockcar) || ($2 == !pmunlockcar) {
    if ($vcmp.cmdcheck(!unlockcar,%id) == fail) !halt
    elseif (!$3) vcmp.msg %id Invalid command useage
    elseif ($3 !isnum) vcmp.msg %id Error - Invalid Vehicle ID, $2 <car id>
    elseif ($vcmp.carowner($3) != %name) vcmp.msg %id You aren't owner of this vechicle
    else {
      vcmp.lockdoors $3 0
      vcmp.msg %id You have just unlocked your vehicle
    }
  }
Quote
alias vcmp.lockdoors dll rcondll.dll RconCommand set 3 $1-

Cars count:

1. Crate file vcmp.car.ini
2. Make there [COUNT]
3. Under it write All=how much vehicles are on map
4. Under it write Forsale=how much vehicles are on map

Quote
alias vcmp.forsale !return $iif($readini(vcmp.cars.ini,COUNT,Forsale),$v1,0)
Quote
alias vcmp.allcars !return $iif($readini(vcmp.cars.ini,COUNT,All),$v1,0)

Quote
    elseif ($2 == !forsale) {
    if ($vcmp.cmdcheck(!mycars,%id) == fail) !halt
    else {
       vcmp.msg %id Total vehicles: $vcmp.allcars For sale vehicles: $vcmp.forsale
    }
  }

To buycar add:

Quote
!writeini -n vcmp.cars.ini COUNT Forsale $calc($vcmp.forsale - 1)

To sellcar add:

Quote
!writeini -n vcmp.cars.ini COUNT Forsale $calc($vcmp.forsale +1)

If wouldn't work add change $vcmp.forsale to $vcmp.forsale(%b) and same with $vcmp.allcars

NOTE: Untested

Offline Cristian

  • Wiseguy
  • **
  • Posts: 63
    • View Profile
Re: Question
« Reply #10 on: September 09, 2008, 12:21:38 am »
hmmm, vcmp.cmdcheck work ? because mine is SanSan v3


szostol

  • Guest
Re: Question
« Reply #11 on: September 09, 2008, 04:37:58 pm »
So edit what I did, I thought you're using gus.