SA-MP Forums Archive
Respawn private car - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Respawn private car (/showthread.php?tid=650288)



Respawn private car - dzonymontana - 24.02.2018

egards, I have a problem, the command /rac works only on vehicles from organizations or from jobs, that is, if you use a private vehicle, you are respawn and you are thrown out of the vehicle, while in vehicles for organizations everything works properly, since the command works fine on other modes, does anyone know what the word is?


Re: Respawn private car - KDyer - 24.02.2018

Could you include the command /rac for us to look at?


Re: Respawn private car - kingmk - 25.02.2018

Try this.

Код:
CMD:rac(playerid, params[])
{
       for(new v = 1; v < MAX_VEHICLES; v++)
       {
              SetVehicleToRespawn(v);
       }
       return 1;
}
I hope i helped u.


Re: Respawn private car - dzonymontana - 25.02.2018

Quote:
Originally Posted by KDyer
Посмотреть сообщение
Could you include the command /rac for us to look at?
You can get a chance to get it, of course, I just do not know if you will understand it because it's in Serbian.
Код:
YCMD:rac(playerid, params[], help)
{
    #pragma unused help
    if(UlogovanProvera[playerid] == 0) return SendErrorMessage(playerid, "Nisi ulogovan/a ili nisi registrovan/a!");
	if(PI[playerid][Admin] < 1) return SendErrorMessage(playerid, "Niste ovlasceni da koristite ovu komandu.");
	if(RespawnVozila) return SCM(playerid, COLORSET, "Respawn je vec pokrenut.");
	new string[128];
	RespawnVozila = 1;
	format(string, sizeof(string), "[RESPAWN]{FFFFFF} Pokrenut je respawn. Sva vozila ce biti respawnovana za 20 sekudni! (Admin: %s)", Ime_Igraca(playerid));
    SendClientMessageToAll(SRPLAVA, string);
    format(nellys, sizeof(nellys), "{FBE204}[INFO] Admin %s je pokrenuo respawn", Ime_Igraca(playerid));
	AdminPoruka(COLOR_WHITE, nellys);
	SetTimer("Respawn", 20000, false);
	return 1;
}

forward Respawn();
public Respawn()
{
	new bool:unwanted[MAX_VOZILA];
    foreach(new i : Player)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            unwanted[GetPlayerVehicleID(i)]=true;
            if(GetPlayerVehicleID(i) == 403 || GetPlayerVehicleID(i) == 514 || GetPlayerVehicleID(i) == 515)
            {
                new vehicleid = GetPlayerVehicleID(i);
                if(IsTrailerAttachedToVehicle(vehicleid)) return 0;
            }
        }
    }
    for(new car = 0; car < MAX_VOZILA; car++)
    {
        if(!unwanted[car]) SetVehicleToRespawn(car);
    }
    return 1;
}
Quote:
Originally Posted by kingmk
Посмотреть сообщение
Try this.

Код:
CMD:rac(playerid, params[])
{
       for(new v = 1; v < MAX_VEHICLES; v++)
       {
              SetVehicleToRespawn(v);
       }
       return 1;
}
I hope i helped u.
It does not work again: D Again respawned vehicles used