Ayuda comandos compartidos
#1

Hola gente tengo unos comandos que se comparte entre facciones por ejemplo: /luces que lo poseen las facciones sapd y fbi Yo quiero saber como dejar ese comando solo para SApd:
Acб el comando:

Код:
CMD:luces(playerid, params[])
{
	if(Team_SAPD(playerid) || Team_FBI(playerid)){
		if(IsPlayerInAnyVehicle(playerid)){
		    new vehicleid = GetPlayerVehicleID(playerid);
		    if(!LSPD_IsACopCar(vehicleid) && !FBI_Vehicle(vehicleid)) return SendClientMessageEx(playerid, -1, "Debes estar en un vehiculo de SAPD o FBI.");
		    if(Lamp[vehicleid] == 0)
			{
				for(new i=0; i<sizeof(Offsets); i++){
                	if(Offsets[i][getID] == 560 && GetVehicleModel(vehicleid) == 560)
					{
                    	Lamp[vehicleid] = 1;
                    	SendClientMessageEx(playerid, -1, "Luces activadas correctamente.");
						light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
						AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
						return 1;
                	}
                	if(Offsets[i][getID] == 415 && GetVehicleModel(vehicleid) == 415){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 421 && GetVehicleModel(vehicleid) == 421){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 426 && GetVehicleModel(vehicleid) == 426){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 579 && GetVehicleModel(vehicleid) == 579){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 402 && GetVehicleModel(vehicleid) == 402){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 461 && GetVehicleModel(vehicleid) == 461){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 521 && GetVehicleModel(vehicleid) == 521){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 506 && GetVehicleModel(vehicleid) == 506){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
				}
            	SendClientMessageEx(playerid, -1, "ERROR: Modelos compatibles:");
            	return SendClientMessageEx(playerid, -1, "Sultan, Cheetah, Washington, Premier, Huntley, Buffalo, PCJ 600, FCR 900, Super Gt");
            }
			else
			{
            	DestroyObject(light[vehicleid]);
                Lamp[vehicleid] = 0;
                SendClientMessageEx(playerid, -1, "Luces desactivadas correctamente.");
                return 1;
			}
		}
		else return SendClientMessageEx(playerid, -1, "Debes estar en un vehiculo.");
	}
	else SendClientMessageEx(playerid, -1, "No puedes usar este comando. (No eres Agente)");
	return 1;
}
Reply
#2

Lo indica la tercera la lнnea:

pawn Код:
if(Team_SAPD(playerid) || Team_FBI(playerid)){
Esa lнnea quiere decir: Si el jugador es de SAPD o de FBI, hacer lo suguiente...

Para hacer lo que quieres simplemente quitas a Team_FBI, dejбndolo de la siguiente manera:

pawn Код:
if(Team_SAPD(playerid)){
Reply
#3

Gracias solucionado
Reply
#4

Asi te deberia funcionar.

Код:
CMD:luces(playerid, params[])
{
	if(Team_SAPD(playerid)){
		if(IsPlayerInAnyVehicle(playerid)){
		    new vehicleid = GetPlayerVehicleID(playerid);
		    if(!LSPD_IsACopCar(vehicleid)) return SendClientMessageEx(playerid, -1, "Debes estar en un vehiculo de SAPD.");
		    if(Lamp[vehicleid] == 0)
			{
				for(new i=0; i<sizeof(Offsets); i++){
                	if(Offsets[i][getID] == 560 && GetVehicleModel(vehicleid) == 560)
					{
                    	Lamp[vehicleid] = 1;
                    	SendClientMessageEx(playerid, -1, "Luces activadas correctamente.");
						light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
						AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
						return 1;
                	}
                	if(Offsets[i][getID] == 415 && GetVehicleModel(vehicleid) == 415){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 421 && GetVehicleModel(vehicleid) == 421){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 426 && GetVehicleModel(vehicleid) == 426){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 579 && GetVehicleModel(vehicleid) == 579){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 402 && GetVehicleModel(vehicleid) == 402){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 461 && GetVehicleModel(vehicleid) == 461){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 521 && GetVehicleModel(vehicleid) == 521){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
                	if(Offsets[i][getID] == 506 && GetVehicleModel(vehicleid) == 506){
                    Lamp[vehicleid] = 1;
					light[vehicleid] = CreateObject(18646,Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 96.0);
					AttachObjectToVehicle(light[vehicleid], vehicleid, Offsets[i][vvvX], Offsets[i][vvvY], Offsets[i][vvvZ], 0.0, 0.0, 0.0);
					return 1;
                	}
				}
            	SendClientMessageEx(playerid, -1, "ERROR: Modelos compatibles:");
            	return SendClientMessageEx(playerid, -1, "Sultan, Cheetah, Washington, Premier, Huntley, Buffalo, PCJ 600, FCR 900, Super Gt");
            }
			else
			{
            	DestroyObject(light[vehicleid]);
                Lamp[vehicleid] = 0;
                SendClientMessageEx(playerid, -1, "Luces desactivadas correctamente.");
                return 1;
			}
		}
		else return SendClientMessageEx(playerid, -1, "Debes estar en un vehiculo.");
	}
	else SendClientMessageEx(playerid, -1, "No puedes usar este comando. (No eres Agente)");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)