Author Topic: Ramdom Location...  (Read 4314 times)

0 Members and 1 Guest are viewing this topic.

Offline Darkness

  • Wiseguy
  • **
  • Posts: 53
    • View Profile
Ramdom Location...
« on: March 26, 2009, 07:54:33 pm »
Hi , i need set ramdom-location... but how to create this ...
Example :
Code: [Select]
}
elseif ($3 == 432) {
  vcmp.setlocation %id $rand(-856.195 516.973 16.16,-772.914 471.326 58.243,-1035.027 1331.481 16.795)
}

is this right?
when isn't right please give me th correct command ..

P.D:Sorry my bad english  :'(  :(


Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Ramdom Location...
« Reply #1 on: March 26, 2009, 09:57:12 pm »
It's not right,
Try something like:
Code: [Select]
elseif ($3 == 432) {
var %rand = $rand(1,3),%loc
if (%rand == 1) %loc = -856.195 516.973 16.16
elseif (%rand == 2) %loc = -772.914 471.326 58.243
elseif (%rand == 3) %loc = -1035.027 1331.481 16.795
  vcmp.setlocation %id %loc
}

Offline Darkness

  • Wiseguy
  • **
  • Posts: 53
    • View Profile
Re: Ramdom Location...
« Reply #2 on: March 26, 2009, 10:17:23 pm »
ok , now i go to try . Thank you thijn

Edit : Whats happen with VC-MP  i cant see my server and another one... :S
« Last Edit: March 26, 2009, 10:19:52 pm by Darkness »

Offline Darkness

  • Wiseguy
  • **
  • Posts: 53
    • View Profile
Re: Ramdom Location...
« Reply #3 on: March 26, 2009, 10:27:32 pm »
mmm work , but i need some... 40 ramdoms spawns how to make this?

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Ramdom Location...
« Reply #4 on: March 26, 2009, 10:38:50 pm »
just add every coords at scripts, And for every coord u need to add:
Code: [Select]
elseif (%a == 1 till 40) %loc = coords
and u need to change the $rand(1,3) to $rand(1,40)

Offline Darkness

  • Wiseguy
  • **
  • Posts: 53
    • View Profile
Re: Ramdom Location...
« Reply #5 on: March 26, 2009, 10:48:17 pm »
aa ok , thank u very much Thijn :)

Offline thijn

  • LU testers
  • VC:MP Veteran
  • *
  • Posts: 667
  • Im proud to be pro.
    • View Profile
    • Vice Underdogs
Re: Ramdom Location...
« Reply #6 on: March 27, 2009, 12:07:14 am »
No problem ;)