SA-MP Forums Archive
[PEDIDO] /rv - em carros nao usados - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [PEDIDO] /rv - em carros nao usados (/showthread.php?tid=313104)



[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(playeridanameMAX_PLAYER_NAME);
format(filesizeof(file), PASTA_CONTASaname);
if(
pAdmin[playerid] > 0){
new 
pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
format(stringsizeof(string), "(INFO) O Administrador %s (%d) respawnou todos os veiculos."pname,playerid);
SendClientMessageToAll(tcadmstring);
for(new 
vv<MAX_VEHICLESv++) SetVehicleToRespawn(v);
SendClientMessage(playeridVerde"(INFO) Veiculos Respawnados");
proximocarro 0;
for(new 
carro 0carro MAX_CARROScarro++)
{
format(stringsizeof(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 
1MAX_VEHICLESj++)
{
    if(!
GetVehicleModel(j)) continue;
    
Veiculo false;
    for(new 
iGetMaxPlayers(); ++)
    {
        if(
IsPlayerInVehicle(ij))
        {
            
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);
}