Ayuda comandos compartidos
#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


Messages In This Thread
Ayuda comandos compartidos - by Jeree10 - 01.07.2014, 16:42
Respuesta: Ayuda comandos compartidos - by unuky - 01.07.2014, 16:50
Re: Ayuda comandos compartidos - by Jeree10 - 01.07.2014, 17:13
Respuesta: Ayuda comandos compartidos - by Maflow - 01.07.2014, 18:08

Forum Jump:


Users browsing this thread: 1 Guest(s)