Help Respawn all cars automatically
#1

Hi guys, I want to ask you for a code to respawn all cars automatically after a specified time. I'm Bulgarian and don't speak english perfectly.
Reply
#2

After how long you wont cars to be restore

* sled kolko vreme da se restorant ?
Reply
#3

Use this code
pawn Код:
forward respawncars();
//Under OnPlayerConnect
SetTimer("respawnallcars", 1000/*change the 1000 to the time you want in milliseconds*/, false);
//NOT under OnPlayerConnect..OUTSIDE ANY callback
public respawnallcars()
{
for(new i = 1; i <= MAX_VEHICLES; i++)
{
    SetVehicleToRespawn(i);
}
return 1;
}
Reply
#4

Quote:
Originally Posted by doreto
Посмотреть сообщение
After how long you wont cars to be restore

* sled kolko vreme da se restorant ?
60 seconds
Reply
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Use this code
pawn Код:
forward respawncars();
//Under OnPlayerConnect
SetTimer("respawnallcars", 1000/*change the 1000 to the time you want in milliseconds*/, false);
//NOT under OnPlayerConnect..OUTSIDE ANY callback
public respawnallcars()
{
for(new i = 1; i <= MAX_VEHICLES; i++)
{
    SetVehicleToRespawn(i);
}
return 1;
}
This code don't work

pawn Код:
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 017: undefined symbol "respawncars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 017: undefined symbol "respawnallcars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1115) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#6

Do you want the cars respawning after every 60 seconds?
If not(only once after the server starts) you can use the code i posted above and change 1000 to 60000
Reply
#7

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Do you want the cars respawning after every 60 seconds?
If not(only once after the server starts) you can use the code i posted above and change 1000 to 60000
Your pawn code don't work and have 4 errors



pawn Код:
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 017: undefined symbol "respawncars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 017: undefined symbol "respawnallcars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1115) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

Srry..My Bad..use this
pawn Код:
forward respawnallcars();
//Under OnPlayerConnect
SetTimer("respawnallcars", 1000/*change the 1000 to the time you want in milliseconds*/, false);
//NOT under OnPlayerConnect..OUTSIDE ANY callback
public respawnallcars()
{
for(new i = 1; i <= MAX_VEHICLES; i++)
{
    SetVehicleToRespawn(i);
}
return 1;
}
Sorry..Silly Mistake :P
Reply
#9

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Srry..My Bad..use this
pawn Код:
forward respawnallcars();
//Under OnPlayerConnect
SetTimer("respawnallcars", 1000/*change the 1000 to the time you want in milliseconds*/, false);
//NOT under OnPlayerConnect..OUTSIDE ANY callback
public respawnallcars()
{
for(new i = 1; i <= MAX_VEHICLES; i++)
{
    SetVehicleToRespawn(i);
}
return 1;
}
Sorry..Silly Mistake :P
pawn Код:
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1089) : error 017: undefined symbol "c"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1102) : error 017: undefined symbol "respawnallcars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 029: invalid expression, assumed zero
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1106) : error 017: undefined symbol "respawnallcars"
C:\Desktop\server samp\Gang-GTA\Se7 Server\Se7 Server\gamemodes\se7.pwn(1114) : warning 225: unreachable code
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
:S
Reply
#10

That should't be there..
Did you read the comments i have written. Are you sure you put the code in the correct place?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)