[PEDIDO] /rv - em carros nao usados -
[RoXx]Okiinho - 24.01.2012
EU QUERIA O CMD /RV Q DA RESPAWN CAR EM TODOS, EU QUERIA UM CMD SУ DAVA RESPAWN NOS CARROS Q NAO TEM NINGUEM DENTRO. O Q EU USO Й ESSE:
PHP код:
if (strcmp(cmd, "/rv",true) == 0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] > 0){
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, sizeof(string), "(INFO) O Administrador %s (%d) respawnou todos os veiculos.", pname,playerid);
SendClientMessageToAll(tcadm, string);
for(new v; v<MAX_VEHICLES; v++) SetVehicleToRespawn(v);
SendClientMessage(playerid, Verde, "(INFO) Veiculos Respawnados");
proximocarro = 0;
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "carro%d.ini", carro);
if(dini_Exists(string)){
new carroid;
DestroyVehicle(dini_Int(string, "Id"));
carroid = AddStaticVehicle(dini_Int(string, "Modelo"), dini_Float(string, "CordX"), dini_Float(string, "CordY"), dini_Float(string, "CordZ"), dini_Float(string, "Angulo"), dini_Int(string, "Cor1"), dini_Int(string, "Cor2"));
dini_IntSet(string, "Id", carroid);
proximocarro++;
}
}
return 1;
}
}
Re: [PEDIDO] /rv - em carros nao usados -
Cristhian - 24.01.2012
pawn Код:
if(strcmp(cmdtext, "/rc", true) == 0)
{
for(new v = 0; v < MAX_VEHICLES; v++)
{
for(new i = 0; i < GetMaxPlayer(); i++)
{
if(IsPlayerInVehicle(i, v) break;
else continue;
SetVehicleToRespawn(v);
}
}
return 1;
}
nгo sei se funciona, fiz agora... vocк deveria procurar em Cуdigos Ъteis.
Re: [PEDIDO] /rv - em carros nao usados -
Shadoww5 - 24.01.2012
PHP код:
static bool:Veiculo;
for(new j = 1; j < MAX_VEHICLES; j++)
{
if(!GetVehicleModel(j)) continue;
Veiculo = false;
for(new i; i < GetMaxPlayers(); i ++)
{
if(IsPlayerInVehicle(i, j))
{
Veiculo = true;
break;
}
}
if(!Veiculo)
SetVehicleToRespawn(j);
}
Re: [PEDIDO] /rv - em carros nao usados -
[RoXx]Okiinho - 24.01.2012
Vlw, vcs dois mais ate agr nao funcionou :S
Re: [PEDIDO] /rv - em carros nao usados -
Shadoww5 - 24.01.2012
Entгo, vocк nгo sabe usar o cуdigo.
Re: [PEDIDO] /rv - em carros nao usados -
Cristhian - 25.01.2012
pawn Код:
static bool:Veiculo[MAX_VEHICLES];
for(new j = 1; j < MAX_VEHICLES; j++)
{
if(!GetVehicleModel(j)) continue;
Veiculo[j] = false;
for(new i; i < GetMaxPlayers(); i ++)
{
if(IsPlayerInVehicle(i, j))
{
Veiculo[j] = true;
break;
}
}
if(!Veiculo[j])
SetVehicleToRespawn(j);
}
acho que deveria usar assim
@edit
pensando bem, nem precisa...
Re: [PEDIDO] /rv - em carros nao usados -
Mark_Owner - 23.02.2012
no gm do BVB tem
Re: [PEDIDO] /rv - em carros nao usados -
paulor - 23.02.2012
pawn Код:
new bool:vehicle[MAX_VEHICLES];
for(new j = 1; j < GetVehicleModel(j); j++)
{
vehicle[j] = false;
for(new i, p = GetMaxPlayers(); i < p; ++i)
{
if(!IsPlayerInAnyVehicle(i) || !IsPlayerConnected(i)) continue;
if(IsPlayerInVehicle(i, j))
{
vehicle[j] = true;
break;
}
}
if(!vehicle[j]) SetVehicleToRespawn(j);
}