Author Topic: Like Patriot playground...  (Read 2010 times)

Trot

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-1
    • View Profile
Like Patriot playground...
« on: March 18, 2011, 07:52:56 pm »
Hi!That's already 4 o'clock I'm trying to make a coherent chain of checkpoints. Here is my script. I just do not understand what I am wrong.

function onPlayerEnterSphere( pPlayer, sphere )
{
if ( sphere.ID == 8 )
{
CreateCheckpoint( Vector( -869, -751.9, 10.49 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -818.6, -870.1, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -907.7, -882.3, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -972.2, -882.1, 10.76 ), 5.0, Colour( 0, 0, 0 ) );
}
return 1;
}


function onPlayerEnterCheckpoint( pPlayer, checkpoint )
{
   if ( checkpoint.ID == 0 )
   {
   CreateCheckpoint( Vector( -818.6, -870.1, 10.76 ), 5.0, Colour( 0, 0, 0 ) );
   checkpoint.Type = MARKER_TYPE_VEHICLE;
   checkpoint.Remove();
   }

   else if ( checkpoint.ID == 1 )
   {
   CreateCheckpoint( Vector( -818.6, -870.1, 10.76 ), 5.0, Colour( 0, 0, 0 ) );
   checkpoint.Type = MARKER_TYPE_VEHICLE;
   checkpoint.Remove();
   }

   else if ( checkpoint.ID == 2 )
   {
   CreateCheckpoint( Vector( -907.7, -882.3, 10.76 ), 5.0, Colour( 0, 0, 0 ) );
   checkpoint.Type = MARKER_TYPE_VEHICLE;
   checkpoint.Remove();
   }
   
   else if ( checkpoint.ID == 3 )
   {
   CreateCheckpoint( Vector( -972.2, -882.1, 10.76 ), 5.0, Colour( 0, 0, 0 ) );
   checkpoint.Type = MARKER_TYPE_VEHICLE;
   checkpoint.Remove();
   }       
return 1;
}

Force

  • Developer
  • Full Member
  • *****
  • Posts: 204
  • Karma: +6/-2
    • View Profile
Re: Like Patriot playground...
« Reply #1 on: March 18, 2011, 08:10:21 pm »
Your setting the type of the checkpoint that your deleting for a start. :P

Obviously with more players the checkpoint IDs will differ, so this is just a basic explanation to try and help you out.

Code: (squirrel) [Select]
function onPlayerEnterCheckpoint( pPlayer, pCheckpoint )
{
local iCheckpoint = pCheckpoint.ID, pNextCheckpoint;
switch ( iCheckpoint )
{
case 0:
{
// If they entered checkpoint ID 0
// Create the new checkpoint and set it's type
pNextCheckpoint = CreateCheckpoint( ... );
if ( pNextCheckpoint )
{
// If the checkpoint was created successfully.
pNextCheckpoint.Type = MARKER_TYPE_VEHICLE;
}
// Remove the current checkpoint (Uncomment if needed)
//pCheckpoint.Remove();
}
break;
case 1:
{
// If they entered checkpoint ID 1
// Create the new checkpoint and set it's type
if ( pNextCheckpoint )
{
pNextCheckpoint.Type = MARKER_TYPE_VEHICLE;
}
pNextCheckpoint.Type = MARKER_TYPE_VEHICLE;
// Remove the current checkpoint (Uncomment if needed)
//pCheckpoint.Remove();
}
break;
}

return 1;
}
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)

Trot

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-1
    • View Profile
Re: Like Patriot playground...
« Reply #2 on: March 18, 2011, 08:41:54 pm »
Thanks. But I'm trying, and it is still doesn't work. Second sphere not disable.
« Last Edit: March 18, 2011, 09:58:55 pm by Trot »

Trot

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-1
    • View Profile
Re: Like Patriot playground...
« Reply #3 on: March 19, 2011, 12:27:33 pm »
I make that script

function onPlayerEnterSphere( pPlayer, sphere )
{
if ( sphere.ID == 8 )
{
BigMessage( pPlayer"~y~Take all checkpoints!", 3000, 2 );
CreateCheckpoint( Vector( -869, -751.9, 10.49 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -818.6, -870.1, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -907.7, -882.3, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -972.2, -882.1, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1093.7, -877.7, 10.76 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1180.1, -828, 10.77 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1263.6, -770.2, 10.77 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1348.9, -703.1, 10.77 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1369.9, -623.8, 16.87 ), 5.0, Colour( 0, 245, 0 ) );
CreateCheckpoint( Vector( -1354.1, -503.6, 10.77 ), 5.0, Colour( 255, 0, 0 ) );
}
return 1;
}

function onPlayerEnterCheckpoint( player, cp )
{
cp.Remove();
     return 1;
}

But when i cross last checkpoint, it all begin enabled random. How i can make disable all script, when i cross last checkpoint? And how i can add money for each one cp?

Trot

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-1
    • View Profile
Re: Like Patriot playground...
« Reply #4 on: March 23, 2011, 03:23:29 am »
Your setting the type of the checkpoint that your deleting for a start. :P
Obviously with more players the checkpoint IDs will differ, so this is just a basic explanation to try and help you out.

where the need is to insert?

Trot

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-1
    • View Profile
Re: Like Patriot playground...
« Reply #5 on: March 23, 2011, 04:17:46 am »

where the need is to insert?.....................................
[/quote]

Oh, I knew you must have created the project for scholars of nuclear physicists. Or post-graduate mathematical schools. In this case, I understand your reluctance to help.

 

© Liberty Unleashed Team.