Reset Cars
#6

Quote:
Originally Posted by Hashski
Посмотреть сообщение
Saw my mistake was tired last nighte HERE, get foreach.
pawn Код:
if(strcmp(cmd, "/resetcars", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 4)
            {
                format(string, sizeof(string), "INFO: All unused vehicles have been respawned.");
                for(new i; i<MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i) == 1)
                    {
                        SendClientMessage(i, COLOR_LIGHTBLUE, string);
                    }
                }
                new bool:unwanted[CAR_AMOUNT];
                foreach (Player,player)
                {
                    if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
                }
                for(new car = 0; car < MAX_VEHICLES; car++)
                {
                    if(!unwanted[car])
                    {
                        RespawnAllCars(car);
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "WARNING: You do not have access to this command");
                return 1;
            }
        }
        return 1;
    }
Thanks it works
Reply


Messages In This Thread
Reset Cars - by Sepelin - 06.03.2011, 23:08
Re: Reset Cars - by Hashski - 07.03.2011, 01:21
Re: Reset Cars - by Sepelin - 07.03.2011, 13:09
Re: Reset Cars - by Davz*|*Criss - 07.03.2011, 14:47
Re: Reset Cars - by Hashski - 07.03.2011, 14:57
Re: Reset Cars - by Sepelin - 07.03.2011, 17:31

Forum Jump:


Users browsing this thread: 1 Guest(s)