17.05.2011, 17:50
olб
como fazer o veiculo se deletar se ele ficar 1 minuto sem ocupante ?
thx
como fazer o veiculo se deletar se ele ficar 1 minuto sem ocupante ?
thx
#define QUANTIDADE_CARROS 101 // Todos os veнculos do servidor + 1
#define RESPAWN_CARROS MAX_VEHICLES-1
new bool:destruir[QUANTIDADE_CARROS]; // Topo do GM.
forward 60s();
public OnGameModeInit()
{
SetTimer("60s", 60000, false);
return 1;
}
public 60s()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i)) { destruir[GetPlayerVehicleID(i)]=true; }
}
for(new x = 1; x <= RESPAWN_CARROS; x++)
{
if(!destruir[x]) DestroyVehicle(x);
}
return 1;
}
AddStaticVehicleEx ( 520, 2109.1763, 1503.0453, 32.2887, 82.2873, 0, 1, 60);
O ultimo parametro do AddStaticVehicleEx serve para isto, Adriano499. Entгo se vocк quiser que o veiculo seja respawnado em 1 minuto vocк pode fazer assim:
OBS: Este parametro deve estar em segundos, segundo a SA-MP Wiki. PHP код:
|
O ultimo parametro do AddStaticVehicleEx serve para isto, Adriano499. Entгo se vocк quiser que o veiculo seja respawnado em 1 minuto vocк pode fazer assim:
OBS: Este parametro deve estar em segundos, segundo a SA-MP Wiki. PHP код:
|
pawn Код:
pawn Код:
pawn Код:
|
C:(49) : error 010: invalid function or declaration
C:(2578) : error 001: expected token: "-identifier-", but found "6"
C:(2580) : error 010: invalid function or declaration
C:(2582) : error 010: invalid function or declaration
C:(2584) : error 010: invalid function or declaration
C:(2586) : error 010: invalid function or declaration
C:(2588) : error 010: invalid function or declaration
C:(2590) : warning 203: symbol is never used: "destruir"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
forward 60s(); // 49
public 60s() //2578
{
for(new i=0; i<MAX_PLAYERS; i++)//2580
{
if(IsPlayerInAnyVehicle(i)) { destruir[GetPlayerVehicleID(i)]=true; }//2582
}
for(new x = 1; x <= RESPAWN_CARROS; x++)//2584
{
if(!destruir[x]) DestroyVehicle(x);//2586
}
return 1; //2588
}
//nao tem 2590!
public 60s()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerInAnyVehicle(i))
{
destruir[GetPlayerVehicleID(i)]=true;
}
}
for(new x = 1; x <= RESPAWN_CARROS; x++)
{
if(!destruir[x])
{
DestroyVehicle(x);
}
}
return 1;
}
forward 60s();
public 60s()
forward DV();
public DV()
new bool:Falso[MAX_VEHICLES];
forward CarCount();
public CarCount()
{
for (new x = 1; x <= MAX_VEHICLES; x++)
if (Falso[x]) {
DestroyVehicle(x);
}
}
for (new x; x < MAX_PLAYERS; x ++) {
if (!IsPlayerInAnyVehicle(x)) {
Falso[x] = true;
}
else {
Falso[x] = false;
}
}
return false;
}