/rac(Respawn all cars) it works but I wanna add smth simple to it
#1

Hey guys, I have scripted a "Respawn All cars" command, so, what I wanna add into the command is

1) If a player is in a vehicle, his vehicle doesn't get respawned
2) Only the unoccupied/unused vehicles get respawned.

pawn Код:
CMD:rac(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_RED,".:: You are not authorized to use this command ::.");
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        SetVehicleToRespawn(i);
    }
    new string[128];
    new pName[24];
    GetPlayerName(playerid,pName,24);
    format(string,sizeof string,""#COL_ORANGE"[SERVER]"#COL_LRED"%s has respawned all the server's vehicles!",pName);
    SendClientMessageToAll(COLOR_GREEN, string);
    return 1;
}
Reply
#2

Код:
CMD:rac(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 2)
	{
		new string[128];
		new bool:unwanted[MAX_VEHICLES];
		for(new player=0; player<MAX_PLAYERS; player++)
     	{
            if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
     	}
		for(new car = 1; car <= 1850; car++)
		{
			if(!unwanted[car]) SetVehicleToRespawn(car);
		}
		SendClientMessageEx(playerid, COLOR_GREY, "You have respawned all unused vehicles.");
		format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has just respawned all unused cars.", GetPlayerNameEx(playerid));
		ABroadCast(COLOR_YELLOW, string, 1);
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply
#3

It's working, thank you, I've added some reputation points to you. I really needed this, thank you again! However, I really need some people like you to help me out, please add me on xFire " justinallica "!
Reply
#4

I've never liked, XFire. Any other communication programs?

i.e Skype?

XxLight_AngelxX
Reply
#5

Yup I've got skype, I will be adding you, it's justinallica too!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)