Author Topic: How to do many spheres? Pls help  (Read 3394 times)

silent_218

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
How to do many spheres? Pls help
« on: March 11, 2011, 10:15:55 pm »
I want to do more than one sphere... but all are teleport player to the one point.. i fink need to set sphere.id or "if sphere.pos".. and then they will teleport to the needed coordinates.. but it is too hard to get it by myself.. can help me anyone with it?

example

function onScriptLoad()
{
   CreateSphere( Vector ( 89.51, -1548.7, 28.34 ), 3.00, Colour( 0, 0, 255 ) )
        CreateSphere( Vector ( 351.501, -328.052, 173.163 ), 3.00, Colour( 0, 0, 255 ) )

   return 1;  
}


function onPlayerEnterSphere( pPlayer, sphere )
{      
   if (Sphere.Pos = Vector ( 89.51, -1548.7, 28.34 ))
   {
       pPlayer.Pos = Vector( 116.93, -1545.4, 244.58 )
   }

   if (Sphere.Pos = Vector ( 351.501, -328.052, 173.163 ))
   {
       pPlayer.Pos = Vector( 374.1, -327.9, 173.16 );
   }

   return 1;
}

Force

  • Developer
  • Full Member
  • *****
  • Posts: 204
  • Karma: +6/-2
    • View Profile
Re: How to do many spheres? Pls help
« Reply #1 on: March 11, 2011, 10:48:43 pm »
Ok, for a start 'Sphere' is reserved by Squirrel, if you look at your script, you have:

Code: [Select]
function onPlayerEnterSphere( pPlayer, sphere )
So what you should be doing is..

Code: [Select]
function onPlayerEnterSphere( pPlayer, sphere )
{
if ( sphere.ID == 0 ) // do stuff
else if ( sphere.ID == 1 ) // etc
}
Quote
[Tue - 20:09:35] <&VRocker> CRAP!
[Tue - 20:09:43] <&VRocker> i think i just followed through...
Quote
[Sat - 22:11:56] <~Smapy> [R3V]breSt12 killed [R3V]Jack_Bauer. (Splat)

silent_218

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: How to do many spheres? Pls help
« Reply #2 on: March 11, 2011, 11:52:45 pm »
lol it's more easy than i think.. thanks alot it works  :)

silent_218

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Two more questios...
« Reply #3 on: March 12, 2011, 09:18:04 am »
1. I can help with "scripting help topic" - will write all what i know for other players, don't you mind? :-) Where can i do it - here or at one place or need topic for each script?
2. How to create 5000 hidden packages if it limited by "331 on screen"? Cus i tryed create 332 in random places of LC, and can't see the last of them..
P.s. Thanks for position saver script, i change it for saving packages and it much easyer to write them on the map)

Juppi

  • Developer
  • Jr. Member
  • *****
  • Posts: 86
  • Karma: +3/-1
    • View Profile
    • Kuslahden alaste GTA:MP clan
Re: Two more questios...
« Reply #4 on: March 14, 2011, 02:30:24 pm »
2. How to create 5000 hidden packages if it limited by "331 on screen"? Cus i tryed create 332 in random places of LC, and can't see the last of them..

The pickups beyond ID 330 should spawn, so that might be a bug with the pickup streamer, someone will take a look at it later.

silent_218

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
pickups
« Reply #5 on: March 15, 2011, 04:04:11 pm »
I see, thx for the info..

 

© Liberty Unleashed Team.