Help! [REP+++]Automatic Vehicle Respawn System -
xxxSpeedxxx - 12.03.2016
Here is the code,
PHP код:
#define RESPAWN_TIME 20 // Twenty minutes
public OnGameModeInit() {
SetTimer("VehicleRespawn", RESPAWN_TIME * 60000, 1);
return 1;
}
forward VehicleRespawn();
public VehicleRespawn() {
for(new i = 0; i < MAX_VEHICLES; i ++ ) {
for(new o = 0; o < GetMaxPlayers(); o ++ ) {
if(!IsPlayerConnected(o)) continue;
if(IsAnyBodyInVehicle(i)) continue;
SetVehicleToRespawn(i);
}
}
return 1;
}
stock IsAnyBodyInVehicle(vid) {
for(new i = 0; i < GetMaxPlayers(); i ++ ) {
if(IsPlayerInVehicle(i, vid)) 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...
Re: Help! [REP+++]Automatic Vehicle Respawn System -
Joron - 12.03.2016
Quote:
Originally Posted by xxxSpeedxxx
Here is the code,
PHP код:
#define RESPAWN_TIME 20 // Twenty minutes
public OnGameModeInit() {
SetTimer("VehicleRespawn", RESPAWN_TIME * 60000, 1);
return 1;
}
forward VehicleRespawn();
public VehicleRespawn() {
for(new i = 0; i < MAX_VEHICLES; i ++ ) {
for(new o = 0; o < GetMaxPlayers(); o ++ ) {
if(!IsPlayerConnected(o)) continue;
if(IsAnyBodyInVehicle(i)) continue;
SetVehicleToRespawn(i);
}
}
return 1;
}
stock IsAnyBodyInVehicle(vid) {
for(new i = GetVehiclePoolSize(); i > 0; i--)
{
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
Re: Help! [REP+++]Automatic Vehicle Respawn System -
LovelySoomro - 12.03.2016
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(522, 1282.1232, 1493.1703, 10.3681, 271.3320, -1, -1, 10);
use this on gamemodeinit or onfilterscriptinit
Re: Help! [REP+++]Automatic Vehicle Respawn System -
xxxSpeedxxx - 12.03.2016
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.
Re: Help! [REP+++]Automatic Vehicle Respawn System -
LovelySoomro - 12.03.2016
PHP код:
public OnGameModeInit()
{
CreateVehicle(522, 1282.1232, 1493.1703, 10.3681, 271.3320, -1, -1, 10);
return 1;
}
do this
Re: Help! [REP+++]Automatic Vehicle Respawn System -
xxxSpeedxxx - 12.03.2016
Quote:
Originally Posted by LovelySoomro
PHP код:
public OnGameModeInit()
{
CreateVehicle(522, 1282.1232, 1493.1703, 10.3681, 271.3320, -1, -1, 10);
return 1;
}
do this
|
Dude this wont help me with respawning vehicles that people buy...If i wanted to use this i would.
Re: Help! [REP+++]Automatic Vehicle Respawn System -
xxxSpeedxxx - 12.03.2016
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.