Author Topic: .Respawn() doesn't work  (Read 1301 times)

rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
.Respawn() doesn't work
« on: November 06, 2014, 10:19:32 pm »
I have problem with .Respawn();

Code: [Select]
else if (c == "respawnall")
{
for(local a = 0; a < GetVehicleCount(); a ++)
{
local vee = FindVehicle(a);
if(vee) vee.Respawn();
}
}

Error:

Code: [Select]
<06/11/2014 - 22:17:19>
AN ERROR HAS OCCURED [the index 'Respawn' does not exist]

<06/11/2014 - 22:17:19>
CALLSTACK

<06/11/2014 - 22:17:19> *FUNCTION [onPlayerCommand()] ... line [2917]

<06/11/2014 - 22:17:19>
LOCALS

<06/11/2014 - 22:17:19> [plrs] 1

<06/11/2014 - 22:17:19> [a] 1

<06/11/2014 - 22:17:19> [veh] NULL

<06/11/2014 - 22:17:19> [i] NULL

<06/11/2014 - 22:17:19> [plr] INSTANCE

<06/11/2014 - 22:17:19> [c] "respawnall"

<06/11/2014 - 22:17:19> [temp] NULL

<06/11/2014 - 22:17:19> [t] NULL

<06/11/2014 - 22:17:19> [c] "respawnall"

<06/11/2014 - 22:17:19> [p] INSTANCE

<06/11/2014 - 22:17:19> [this] TABLE
« Last Edit: November 07, 2014, 04:13:44 pm by rwwpl »

Merk.

  • Newbie
  • *
  • Posts: 7
  • Karma: +4/-6
  • Give +1 of karma if i help you.
    • View Profile
Re: .Respawn() doesn't work
« Reply #1 on: November 06, 2014, 11:48:24 pm »
Code: [Select]
for(local a = 0; a < GetVehicleCount(); a ++)
to

Code: [Select]
for(local a = 0; a < ( GetVehicleCount() - 1 ); a ++)

rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
Re: .Respawn() doesn't work
« Reply #2 on: November 07, 2014, 04:14:11 pm »
Code: [Select]
for(local a = 0; a < GetVehicleCount(); a ++)
to

Code: [Select]
for(local a = 0; a < ( GetVehicleCount() - 1 ); a ++)

Doesn't work... the same error

Merk.

  • Newbie
  • *
  • Posts: 7
  • Karma: +4/-6
  • Give +1 of karma if i help you.
    • View Profile
Re: .Respawn() doesn't work
« Reply #3 on: November 07, 2014, 07:57:51 pm »
As Vortrex said...

Code: [Select]
Vehicles <- { };

function onServerStart ( ) {

local count = 0;
while ( count <= MAX_VEHICLES ) {

if ( FindVehicle ( count ) != null ) {

Vehicles [ count ] <- FindVehicle ( count );
}

count ++;
}
}

cmd:

Code: [Select]
if ( c == "respawnall" ) {

foreach ( ii, iv in Vehicles ) {

if ( FindVehicle ( ii ) == null ) continue; // jump

Vehicles [ ii ].Respawn ( );
}
}

rwwpl

  • Full Member
  • ***
  • Posts: 126
  • Karma: +18/-6
  • LU-DM Team
    • View Profile
    • LU-DM Team
Re: .Respawn() doesn't work
« Reply #4 on: November 07, 2014, 09:18:46 pm »
I've forgotten about it...

Thanks ;)

 

© Liberty Unleashed Team.