SA-MP Forums Archive
[Ajuda]Respawn de veiculos desocupados - 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: [Ajuda]Respawn de veiculos desocupados (/showthread.php?tid=284908)



[Ajuda]Respawn de veiculos desocupados - DrTHE - 21.09.2011

bem acho q nem preciso explicar mt ^^
alguem tem um cmd assim?


Re: [Ajuda]Respawn de veiculos desocupados - WLSF - 21.09.2011

Preguiзa de usar search? https://sampforum.blast.hk/showthread.php?tid=284836
Acabaram de criar um tуpico assim ontem '-'


Re: [Ajuda]Respawn de veiculos desocupados - Hardware - 21.09.2011

Para respawnar somente os desocupados, use isso:

pawn Код:
if(!IsVehicleOccupied(v)) SetVehicleToRespawn(v);



Re: [Ajuda]Respawn de veiculos desocupados - Lуs - 21.09.2011

pawn Код:
stock ResetarCarros()
{
    new string[ 200 ];
    for( new v = 0; v < MAX_VEHICLES; v++ )
    {
        if(!IsVehicleOccupied(v)) return SetVehicleToRespawn(v);
    }
    SendClientMessageToAll(-1, "OS CARROS INUTILIZADOS FORГO RESETADOS.");
    return 1;
}
pawn Код:
stock IsVehicleOccupied(vehicleid)
{
    for( new i = 0; i < MAX_VEHICLES; i++ )
    {
        if(IsPlayerInAnyVehicle(i))
        {
            if(GetPlayerVehicleID(i)==vehicleid)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
    return 1;
}



Re: [Ajuda]Respawn de veiculos desocupados - [O.z]Caroline - 21.09.2011

pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/rc", cmdtext, true))
    {
        SendClientMessageToAll(-1, "Algum administrador resetool todos os veiculos!");
        return 1;
    }
    return 0;
}


stock ResetarCarros() //Creditos: thegarfield
{
    static bool:inVeh;
    for(new i; i < MAX_VEHICLES; i++ )
    {
        inVeh = false;
        for(new j; j < GetMaxPlayers(); j++ )
        {
            if(IsPlayerInVehicle( j, i ))
            inVeh = true;
            break;
        }
        if(!inVeh) SetVehicleToRespawn(i);
   }
}



Re: [Ajuda]Respawn de veiculos desocupados - WLSF - 21.09.2011

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/rc", cmdtext, true))
    {
        SendClientMessageToAll(-1, "Algum administrador resetool todos os veiculos!");
        return 1;
    }
    return 0;
}


stock ResetarCarros() //Creditos: thegarfield
{
    static bool:inVeh;
    for(new i; i < MAX_VEHICLES; i++ )
    {
        inVeh = false;
        for(new j; j < GetMaxPlayers(); j++ )
        {
            if(IsPlayerInVehicle( j, i ))
            inVeh = true;
            break;
        }
        if(!inVeh) SetVehicleToRespawn(i);
   }
}
Carol este seu comando nгo respawna em hmm


Re: [Ajuda]Respawn de veiculos desocupados - [O.z]Caroline - 21.09.2011

Quote:
Originally Posted by Willian_Luigi
Посмотреть сообщение
Carol este seu comando nгo respawna em hmm
ah sim, nгo tinha visto:
pawn Код:
#include <a_samp>

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/rc", cmdtext, true))
    {
        SendClientMessageToAll(-1, "Algum administrador resetool todos os veiculos!");
        ResetarCarros();
        return 1;
    }
    return 0;
}


stock ResetarCarros() //Creditos: thegarfield
{
    static bool:inVeh;
    for(new i; i < MAX_VEHICLES; i++ )
    {
        inVeh = false;
        for(new j; j < GetMaxPlayers(); j++ )
        {
            if(IsPlayerInVehicle( j, i ))
            inVeh = true;
            break;
        }
        if(!inVeh) SetVehicleToRespawn(i);
   }
}



Re: [Ajuda]Respawn de veiculos desocupados - Nake01 - 21.09.2011

#EDIT
TУPICO ERRADO :S


Re: [Ajuda]Respawn de veiculos desocupados - Exwinzy_Pushing - 22.09.2011

Код:
		if(strcmp(cmd, "/resetarcarros", true) == 0 || strcmp(cmd, "/rc", true) == 0) // by Ellis
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] < 3)
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando.");
			    return 1;
			}
			new bool:unwanted[CAR_AMOUNT];
			for(new player=0; player<MAX_PLAYERS; player++)
     		{
            	if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
     		}
			for(new car = 1; car <= 268; car++)
			{
				if(!unwanted[car]) SetVehicleToRespawn(car);
			}
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "|ADMIN| %s resetou os carros inutilizados.", sendername);
			BroadCast(COLOR_WHITE,string);
		}
		return 1;
	}



Re: [Ajuda]Respawn de veiculos desocupados - [O.z]Caroline - 22.09.2011

tenta:
http://forum.sa-mp.com/showpost.php?...97&postcount=5