Respawn all cars Command with dcmd
#1

Hello, I'm using dcmd and I want to create a command that respawns all unused cars in the server, like this one:
Код:
if(strcmp(cmd, "/respawnallcars", true) == 0) {
            new bool:vehicleused[MAX_VEHICLES];
            for(new i=0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
                {
                    vehicleused[GetPlayerVehicleID(i)] = true;
                }
            }
            for(new i=1; i < MAX_VEHICLES; i++)
            {
                if(!vehicleused[i])
                {
                    SetVehicleToRespawn(i);
                }
            }
            SendClientMessage(playerid, 0x32CD32, "balba!");
            SendClientMessageToAll(0x32CD32, "sth!");
        return 1;
        }
can someone transform it for dcmd for me?

Is that correct? :
Код:
dcmd_respawnallcars(playerid,params[])
	{
	#pragma unused params
	new bool:vehicleused[MAX_VEHICLES];
            for(new i=0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
                {
                    vehicleused[GetPlayerVehicleID(i)] = true;
                }
            }
            for(new i=1; i < MAX_VEHICLES; i++)
            {
                if(!vehicleused[i])
                {
                    SetVehicleToRespawn(i);
                }
            }
            SendClientMessage(playerid, 0x32CD32, "balba!");
            SendClientMessageToAll(0x32CD32, "sth!");
	return 1;
	}
Reply


Messages In This Thread
Respawn all cars Command with dcmd - by bobsona - 14.09.2014, 09:53
Re: Respawn all cars Command with dcmd - by Thogy - 14.09.2014, 10:03
Re: Respawn all cars Command with dcmd - by bobsona - 14.09.2014, 11:04

Forum Jump:


Users browsing this thread: 1 Guest(s)