SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 04/08/2011, 02:17 AM   #1
SamyRomafia
Huge Clucker
 
SamyRomafia's Avatar
 
Join Date: Oct 2010
Location: Italia
Posts: 232
Reputation: 3
Default Destroy All Cars

Where i can find a function "Destroyallcars", but this function don't destroy a occupied vehicle.

I have search in the forum but i dont have find any commands.

Sorry for bad eng.
__________________
Hey guys.

I need a good scripter who can help me. I can pay for this work but im not a rich mean, i can pay as much as possible.
I need to configure a server whit a website, and other works, i tried to do this but my attempts have failed.
If you can help me send me a private message and i give you more info.

Thanks for your attention.
SamyRomafia is offline  
Old 04/08/2011, 02:18 AM   #2
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default Re: Destroy All Cars

pawn Code:
for(new i=1;i<=MAX_VEHICLES;i++)
{
    DestroyVehicle(i);
}
__________________
(RETIRED)
=WoR=Varth is offline  
Old 04/08/2011, 02:40 AM   #3
SamyRomafia
Huge Clucker
 
SamyRomafia's Avatar
 
Join Date: Oct 2010
Location: Italia
Posts: 232
Reputation: 3
Default Re: Destroy All Cars

Quote:
Originally Posted by varthshenon View Post
pawn Code:
for(new i=1;i<=MAX_VEHICLES;i++)
{
    DestroyVehicle(i);
}
Thanks, but this destroy all vehicle, i don't want to destroy a occupied vehicle.
__________________
Hey guys.

I need a good scripter who can help me. I can pay for this work but im not a rich mean, i can pay as much as possible.
I need to configure a server whit a website, and other works, i tried to do this but my attempts have failed.
If you can help me send me a private message and i give you more info.

Thanks for your attention.

Last edited by SamyRomafia; 04/08/2011 at 03:25 AM.
SamyRomafia is offline  
Old 04/08/2011, 02:51 AM   #4
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default Re: Destroy All Cars

pawn Code:
for(new i=1;i<=MAX_VEHICLES;i++)
{
    new count = 0;
    for(new a=0;a<MAX_PLAYERS;a++)
    {
        if(IsPlayerConnected(a) && IsPlayerInAnyVehicle(a))
        {
            if(GetPlayerVehicleID(a) == i) count++;
        }
    }
    if(count > 0)
    {
        DestroyVehicle(i);
    }
}
__________________
(RETIRED)
=WoR=Varth is offline  
Old 04/08/2011, 03:26 AM   #5
SamyRomafia
Huge Clucker
 
SamyRomafia's Avatar
 
Join Date: Oct 2010
Location: Italia
Posts: 232
Reputation: 3
Default Re: Destroy All Cars

Quote:
Originally Posted by varthshenon View Post
pawn Code:
for(new i=1;i<=MAX_VEHICLES;i++)
{
    new count = 0;
    for(new a=0;a<MAX_PLAYERS;a++)
    {
        if(IsPlayerConnected(a) && IsPlayerInAnyVehicle(a))
        {
            if(GetPlayerVehicleID(a) == i) count++;
        }
    }
    if(count > 0)
    {
        DestroyVehicle(i);
    }
}
This destory only a occupied vehicle, i don't want to destroy a occupied vehicle and to destroy unoccupied vehicle.
__________________
Hey guys.

I need a good scripter who can help me. I can pay for this work but im not a rich mean, i can pay as much as possible.
I need to configure a server whit a website, and other works, i tried to do this but my attempts have failed.
If you can help me send me a private message and i give you more info.

Thanks for your attention.
SamyRomafia is offline  
Old 04/08/2011, 03:38 AM   #6
=WoR=Varth
High-roller
 
=WoR=Varth's Avatar
 
Join Date: Apr 2011
Location: Indonesia
Posts: 1,988
Reputation: 133
Default Re: Destroy All Cars

pawn Code:
for(new i=1;i<=MAX_VEHICLES;i++)
{
    new count = 0;
    for(new a=0;a<MAX_PLAYERS;a++)
    {
        if(IsPlayerConnected(a) && IsPlayerInAnyVehicle(a))
        {
            if(GetPlayerVehicleID(a) == i) count++;
        }
    }
    if(count == 0)
    {
        DestroyVehicle(i);
    }
}
__________________
(RETIRED)
=WoR=Varth is offline  
Old 04/08/2011, 04:37 AM   #7
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: Destroy All Cars

I would use foreach to do this if I were you.
Scenario is offline  
 

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
Destroy Cars On Server Exit lewismichaelbbc Help Archive 0 05/09/2010 08:40 AM
My car spawning system, How to "Destroy Cars" lewismichaelbbc Help Archive 0 05/09/2010 07:56 AM
Destroy cars command Richie Help Archive 11 23/04/2010 01:37 PM
To destroy car xxjackoxx Help Archive 1 05/03/2010 10:00 AM
Car destroy jaksimaksi Help Archive 2 27/12/2009 06:59 PM


All times are GMT. The time now is 08:08 PM.


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