Respawn Vehicles don't respawn spawned cars
#1

Hello,
I've found out that /respawnveh doesn't respawn the spawned vehicles

pawn Code:
CMD:respawnveh(playerid, params[])
{
    CL(playerid);
    if(pInfo[playerid][Admin] >= 4)
    {
        SendClientMessage(playerid, COLOR_GREEN, "You have successfully Respawned all Vehicles!");
        GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Vehicles ~g~Respawned!", 3000, 3);
        for(new cars=0; cars<MAX_VEHICLES; cars++)
        {
            SetVehicleToRespawn(cars);
        }
    }
    else return Error(playerid, 6);
    return 1;
}
How can i fix it?

this is how i do in /car

pawn Code:
foreach(new i : Player)
        {
            if(pCar[playerid] != -1)
            {
                if(IsPlayerInVehicle(i, pCar[playerid])) return 1;
                else
                    DestroyVehicle(pCar[playerid]);
            }
        }
        pCar[playerid] = vehicle;
Reply
#2

You don't have explained which cars in which coordinates respawn all vehicles! you must add

AddStaticVehicle(VEHICLE ID ,X ,Y ,Z , ANGLE ,COLOR 1 ,COLOR 2);

and must be something like this at the end THIS



You can consider using also the AddStaticVehicleEx that automatically every X seconds respawn every car!

see the example here! AddStaticVehicleEx
Reply
#3

I'm not a n00b.
I use CreateVehicle for spawning in /car

If i use /respawnveh. The spawned vehicle disappears.
Reply
#4

Quote:
Originally Posted by _Jake_
View Post
I'm not a n00b.
I use CreateVehicle for spawning in /car

If i use /respawnveh. The spawned vehicle disappears.
I'm not here to tell you are a noob, i'm here to tell you what i should use to do this function, that was my advice, but you are absolutely free to use what you want. Peace
Reply
#5

bump.
Reply
#6

try this

pawn Code:
CMD:respawnveh(playerid, params[])
{
    #pragma unused params
    if(pInfo[playerid][Admin] >= 4)
    {
        SendClientMessage(playerid, COLOR_GREEN, "You have successfully Respawned all Vehicles!");
        GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Vehicles ~g~Respawned!", 3000, 3);
        for(new cars=0; cars<MAX_VEHICLES; cars++)
        {
            if(!VehicleOccupied(cars))
            {
                SetVehicleToRespawn(cars);
            }
        }
        return 1;
    }
    else return Error(playerid, 6);
}
Reply
#7

never mind guys. i forgot that OnVehicleSpawn all spawned vehicles are deleted. Anyway thanks for trying to help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)