Car attachment in the sky [REP+]
#1

Okay so my car attachment is up in the sky, above my car.
I want it to be on my car not above it.. Command is made by ZCMD and it is like this:

Код:
CMD:pursuit(playerid, params[])
{
	 new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
	 new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	 if (vehmodel == 541 || vehmodel == 560) SendClientMessage(playerid, 0x2641FEAA, "You've put police light. Go get him!");
	 {
     AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0);
     }
     else
     {
     SendClientMessage(playerid, 0xAA3333AA, "You're not in police pursuit vehicle!");
     }
     return 1;
}
How do I lower it down, do I lower the CreateObject's Z coordinate down or? By the way, can someone show me what is wrong with my ELSE? the error i get is: invalid expression, assumed zero
Reply
#2

Код:
CMD:pursuit(playerid, params[])
{
	 new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
	 new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	 if (vehmodel == 541 || vehmodel == 560) SendClientMessage(playerid, 0x2641FEAA, "You've put police light. Go get him!");
	 {
     AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 0, 0, 0, 0); //try applying 0 instead of 2..
     }
     return 1;
}
Reply
#3

I think it will work if you lower down Z cordinate so instead of 14 lower to 13 or 12 that is work for me once. I hope so that I help you if I'm not then I'm sorry.
Reply
#4

Umm I updated the post, can someone show me what am I missing with this "else"?
Reply
#5

Код:
CMD:pursuit(playerid, params[])
{
	 new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
	 new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	 if (vehmodel == 541 || vehmodel == 560) SendClientMessage(playerid, 0x2641FEAA, "You've put police light. Go get him!");
	 {
     AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0);
     }
     else
     {
     SendClientMessage(playerid, 0xAA3333AA, "You're not in police pursuit vehicle!");
     return 1; //return 1 ?
     }
     return 1;
}
Reply
#6

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Код:
CMD:pursuit(playerid, params[])
{
	 new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
	 new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	 if (vehmodel == 541 || vehmodel == 560) SendClientMessage(playerid, 0x2641FEAA, "You've put police light. Go get him!");
	 {
     AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0);
     }
     else
     {
     SendClientMessage(playerid, 0xAA3333AA, "You're not in police pursuit vehicle!");
     return 1; //return 1 ?
     }
     return 1;
}
2 returns just makes a new warning..?
Reply
#7

No.It will not give you a warning.
Reply
#8

You don't get me. I don't know how to use else, and the code you sent me just makes a new warning in my script, but doesn't fix the error thing....
Reply
#9

Now it will not give you a warning.

Код:
CMD:pursuit(playerid, params[])
{
	 new light = CreateObject(18646,2001.195679, 1547.113892, 14.283400, 0.0, 0.0, 96.0);
	 new vehmodel = GetVehicleModel(GetPlayerVehicleID(playerid));
	 if (vehmodel == 541 || vehmodel == 560) 
	 {
     SendClientMessage(playerid, 0x2641FEAA, "You've put police light. Go get him!");
     AttachObjectToVehicle(light, GetPlayerVehicleID(playerid), 0, 0, 2, 0, 0, 0);
     }
     else
     {
     SendClientMessage(playerid, 0xAA3333AA, "You're not in police pursuit vehicle!");
     }
     return 1;
}
Reply
#10

It doesnt! Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)