SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 19/05/2013, 08:34 AM   #1
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,707
Reputation: 489
Default Respawn Vehicles don't respawn spawned cars

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;
__________________
Discord: Cipher#7353
__________________


Server IP: Click me | Discord: Click me

You challenged us, What you want is what you get.
JaKe Elite is offline   Reply With Quote
Old 19/05/2013, 11:30 AM   #2
VanillaRain
Big Clucker
 
VanillaRain's Avatar
 
Join Date: Apr 2012
Location: Modena - Italy
Posts: 188
Reputation: 17
Default Re: Respawn Vehicles don't respawn spawned cars

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
VanillaRain is offline   Reply With Quote
Old 19/05/2013, 11:34 AM   #3
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,707
Reputation: 489
Default Re: Respawn Vehicles don't respawn spawned cars

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

If i use /respawnveh. The spawned vehicle disappears.
__________________
Discord: Cipher#7353
__________________


Server IP: Click me | Discord: Click me

You challenged us, What you want is what you get.
JaKe Elite is offline   Reply With Quote
Old 19/05/2013, 11:50 AM   #4
VanillaRain
Big Clucker
 
VanillaRain's Avatar
 
Join Date: Apr 2012
Location: Modena - Italy
Posts: 188
Reputation: 17
Default Re: Respawn Vehicles don't respawn spawned cars

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
VanillaRain is offline   Reply With Quote
Old 20/05/2013, 06:03 AM   #5
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,707
Reputation: 489
Default Re: Respawn Vehicles don't respawn spawned cars

bump.
__________________
Discord: Cipher#7353
__________________


Server IP: Click me | Discord: Click me

You challenged us, What you want is what you get.
JaKe Elite is offline   Reply With Quote
Old 20/05/2013, 07:13 AM   #6
Guest123
Huge Clucker
 
Guest123's Avatar
 
Join Date: Mar 2013
Location: Malaysia
Posts: 313
Reputation: 3
Default Re: Respawn Vehicles don't respawn spawned cars

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);
}
__________________
..
Guest123 is offline   Reply With Quote
Old 20/05/2013, 07:17 AM   #7
JaKe Elite
High-roller
 
JaKe Elite's Avatar
 
Join Date: Apr 2012
Location: Philippines
Posts: 3,707
Reputation: 489
Default Re: Respawn Vehicles don't respawn spawned cars

never mind guys. i forgot that OnVehicleSpawn all spawned vehicles are deleted. Anyway thanks for trying to help me
__________________
Discord: Cipher#7353
__________________


Server IP: Click me | Discord: Click me

You challenged us, What you want is what you get.
JaKe Elite is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with respawn vehicles sniperwars Scripting Help 7 24/02/2012 11:51 PM
Spawned Vehicles - Respawn? Rolyy Help Archive 9 27/02/2011 12:44 PM
How can i make /v spawned vehs. dont respawn Majataka Help Archive 8 30/03/2010 04:00 PM
Respawn all vehicles BP13 Help Archive 5 10/12/2009 03:39 PM
Vehicles don't respawn PoWerZ Help Archive 0 08/04/2009 08:48 AM


All times are GMT. The time now is 11:13 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.