[Help]/despawnsystemveh
#1

Well, Basically i'm struggling to make this command, This is what i have so far but it despawns ALL the vehicles in the server, And Heres the hard part, Making it despawn all the vehicles that the FS has currently spawned.


If anyone can help, I'll be hugely great-full

Heres the Code
CODE


pawn Код:
COMMAND:despawnallveh(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
            new string[64], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string, sizeof string, "~b~Admin: ~g~%s ~r~has despawned all vehicles", pName);
            GameTextForAll(string, 5000, 5);
            DestroyVehicle(i);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED,"You do not have access to this command");
    }
    return 1;
}
Reply
#2

pawn Код:
COMMAND:despawnallveh(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
            new string[64], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string, sizeof string, "~b~Admin: ~g~%s ~r~has despawned all vehicles", pName);
            GameTextForAll(string, 5000, 5);
            SetVehicleToRespawn(i);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED,"You do not have access to this command");
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Raimis_R
Посмотреть сообщение
pawn Код:
COMMAND:despawnallveh(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
            new string[64], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string, sizeof string, "~b~Admin: ~g~%s ~r~has despawned all vehicles", pName);
            GameTextForAll(string, 5000, 5);
            SetVehicleToRespawn(i);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED,"You do not have access to this command");
    }
    return 1;
}
Thanks for posting the code but it didn't work, It despawns EVERY Vehicle on the server.
Reply
#4

Well count how many cars do you have in your GameMode and do THIS :
pawn Код:
CMD:despawnallveh( playerid )
{
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < NUMBER_OF_VEHICLES; i++)
        {
            new string[64], pName[MAX_PLAYER_NAME];
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string, sizeof string, "~b~Admin: ~g~%s ~r~has despawned all vehicles", pName);
            GameTextForAll(string, 5000, 5);
            SetVehicleToRespawn(i);
        }
    }
    else SendClientMessage(playerid, COLOR_RED,"You do not have access to this command");

    return 1;
}
You can add a define: #define NUMBER_OF_VEHICLES (Your number of Vehicles)
Reply
#5

I don't know exactly what are you talking about. Despawning? On your script it's destroying all vehicles and on Raimis' it's respawning all. So, I would do the same like Raimis', so that's why I don't understand you...

Well, if you said on your FS, are there any more cars in GM or other FS'?
Reply
#6

Well he want to respawn all the Gamemode's Vehicles( Not the vehicles that are in the FSs )....
Reply
#7

So, if he want all, Raimis did this correctly. Why did he anwsered then it respawns EVERY vehicle? Every = all
Reply
#8

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
So, if he want all, Raimis did this correctly. Why did he anwsered then it respawns EVERY vehicle? Every = all
Both of you are wrong, I want it to DESTROY = DESPAWN all the vehicles in the running FS i've made.

NOT The GameMode Vehicles
Reply
#9

Well, in your command you've added respawning all vehicle that are here (0-1999). They are also in Gamemode.

I'll help you. Add this on top the FS' script:

Код:
new bool:Vehicle[MAX_VEHICLES];
where Vehicle is an example of vehicle name.

When you are creating a vehicle, add true parameter (for example vehicle spawner, like /car)

Код:
vehicleid = GetPlayerVehicleID(playerid);
Vehicle[vehicleid] = true;
That would make if the bool is true. And, in the despawning system, after the loop add checking, is current vehicle have true parameter

Код:
if(Vehicle[i] == true)
Reply
#10

Quote:
Originally Posted by Libra_PL
Посмотреть сообщение
Well, in your command you've added respawning all vehicle that are here (0-1999). They are also in Gamemode.

I'll help you. Add this on top the FS' script:

Код:
new bool:Vehicle[MAX_VEHICLES];
where Vehicle is an example of vehicle name.

When you are creating a vehicle, add true parameter (for example vehicle spawner, like /car)

Код:
vehicleid = GetPlayerVehicleID(playerid);
Vehicle[vehicleid] = true;
That would make if the bool is true. And, in the despawning system, after the loop add checking, is current vehicle have true parameter

Код:
if(Vehicle[i] == true)
Sorry but there isn't any respawning system allocated inside my FS, I just need a command that DESPAWNS all the vehicles that the Filterscript has created Not inside the GM
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)