Help! [REP+++]Automatic Vehicle Respawn System
#1

Here is the code,

PHP код:
#define RESPAWN_TIME 20 // Twenty minutes 
  
public OnGameModeInit() { 
     
SetTimer("VehicleRespawn"RESPAWN_TIME 600001); 
     return 
1

  
forward VehicleRespawn(); 
public 
VehicleRespawn() { 
    for(new 
0MAX_VEHICLES++ ) { 
         for(new 
0GetMaxPlayers(); ++ ) { 
              if(!
IsPlayerConnected(o)) continue; 
              if(
IsAnyBodyInVehicle(i)) continue; 
              
SetVehicleToRespawn(i); 
         } 
    } 
    return 
1

  
stock IsAnyBodyInVehicle(vid) { 
  for(new 
0GetMaxPlayers(); ++ ) { 
       if(
IsPlayerInVehicle(ivid)) return 1
  } 
  return 
0

My problem:

When it respawns the vehicles it respawns trailers that are being used at the moment and connected to a truck.I need the script to check if the trailer is connected to a truck,if not respawn it,if yes no respawn.I have no idea how to make this.Can someone help me out with this? PLEASE !!! I need this really bad on my server! I'will rep+1 anyone who helps me out with this...
Reply
#2

Quote:
Originally Posted by xxxSpeedxxx
Посмотреть сообщение
Here is the code,

PHP код:
#define RESPAWN_TIME 20 // Twenty minutes 
  
public OnGameModeInit() { 
     
SetTimer("VehicleRespawn"RESPAWN_TIME 600001); 
     return 
1

  
forward VehicleRespawn(); 
public 
VehicleRespawn() { 
    for(new 
0MAX_VEHICLES++ ) { 
         for(new 
0GetMaxPlayers(); ++ ) { 
              if(!
IsPlayerConnected(o)) continue; 
              if(
IsAnyBodyInVehicle(i)) continue; 
              
SetVehicleToRespawn(i); 
         } 
    } 
    return 
1

  
stock IsAnyBodyInVehicle(vid) { 
  for(new 
GetVehiclePoolSize(); 0i--)
{
    
SetVehicleToRespawn(i);
  } 
  return 
0

My problem:

When it respawns the vehicles it respawns trailers that are being used at the moment and connected to a truck.I need the script to check if the trailer is connected to a truck,if not respawn it,if yes no respawn.I have no idea how to make this.Can someone help me out with this? PLEASE !!! I need this really bad on my server! I'will rep+1 anyone who helps me out with this...
Try This. and tell me the outcome
Reply
#3

stop wasting your time with this shit
do this easy way
vehicleid,x,y,z position,facing angle,virtual world,interrior id,time sec for respawn vehicle auto;
PHP код:
CreateVehicle(5221282.12321493.170310.3681271.3320, -1, -110); 
use this on gamemodeinit or onfilterscriptinit
Reply
#4

C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(185) : error 017: undefined symbol "GetVehiclePoolSize"
C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(184) : warning 203: symbol is never used: "vid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#5

PHP код:
public OnGameModeInit()
{
    
CreateVehicle(5221282.12321493.170310.3681271.3320, -1, -110);
    return 
1;

do this
Reply
#6

Quote:
Originally Posted by LovelySoomro
Посмотреть сообщение
PHP код:
public OnGameModeInit()
{
    
CreateVehicle(5221282.12321493.170310.3681271.3320, -1, -110);
    return 
1;

do this
Dude this wont help me with respawning vehicles that people buy...If i wanted to use this i would.
Reply
#7

Quote:
Originally Posted by Joron
Посмотреть сообщение
Try This. and tell me the outcome
C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(185) : error 017: undefined symbol "GetVehiclePoolSize"
C:\Users\Freeware Sys\Documents\srw\gamemodes\NG.pwn(184) : warning 203: symbol is never used: "vid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)