Liberty Unleashed

Scripting => Script Help => Topic started by: silent_218 on March 11, 2011, 09:15:55 pm

Title: How to do many spheres? Pls help
Post by: silent_218 on March 11, 2011, 09: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;
}
Title: Re: How to do many spheres? Pls help
Post by: Force on March 11, 2011, 09: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
}
Title: Re: How to do many spheres? Pls help
Post by: silent_218 on March 11, 2011, 10:52:45 pm
lol it's more easy than i think.. thanks alot it works  :)
Title: Two more questios...
Post by: silent_218 on March 12, 2011, 08: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)
Title: Re: Two more questios...
Post by: Juppi on March 14, 2011, 01: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.
Title: pickups
Post by: silent_218 on March 15, 2011, 03:04:11 pm
I see, thx for the info..