Help with respawning a particular set of vehicles.
#1

Hi, so I am making a command which is /fvr, it respawns all the cars of that faction. You would probably understand it below.

pawn Код:
if(strcmp(cmd, "/fvr", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pLeader] <= 0 || PlayerInfo[playerid][pRank] <= 5)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Only leaders/sub-leaders can use this command.");
                return 1;
            }
            if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 && PlayerInfo[playerid][pRank] >= 6)
            {
                new bool:unwanted[CAR_AMOUNT];
                for(new player=0; player<MAX_PLAYERS; player++)
                {
                    if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                }
                new car = 17; car = 36; car = 37; car = 34; car = 35; car = 22; car = 31; car = 29; car = 30; car = 23; car = 18; car = 19; car = 20; car = 21; car = 24; car = 25; car = 26; car = 32; car = 33; car = 356; car = 357;
                {
                    if(!unwanted[car]) SetVehicleToRespawn(car);
                }
                SendClientMessage(playerid, COLOR_WHITE, "Your faction cars have been respawned.");
                return 1;
            }
        }
        return 1;
    }
The problem is that, when I go in game and I use /fvr, it doesn't respawn any of the cars stated, it just shows the SendClientMessage and that's all.

Any help would be appreciated.
Reply


Messages In This Thread
Help with respawning a particular set of vehicles. - by DanishHaq - 08.08.2013, 19:21
Re: Help with respawning a particular set of vehicles. - by arjanforgames - 08.08.2013, 20:13
Re: Help with respawning a particular set of vehicles. - by DanishHaq - 08.08.2013, 20:16
Re: Help with respawning a particular set of vehicles. - by Konstantinos - 08.08.2013, 20:24

Forum Jump:


Users browsing this thread: 1 Guest(s)