SA-MP Forums Archive
Car attachment in the sky [REP+] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car attachment in the sky [REP+] (/showthread.php?tid=516053)



Car attachment in the sky [REP+] - Bek_Loking - 29.05.2014

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


Re: Car attachment in the sky [REP+] - Rittik - 29.05.2014

Код:
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;
}



Re: Car attachment in the sky [REP+] - Luca12 - 29.05.2014

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.


Re: Car attachment in the sky [REP+] - Bek_Loking - 29.05.2014

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


Re: Car attachment in the sky [REP+] - Rittik - 29.05.2014

Код:
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;
}



Re: Car attachment in the sky [REP+] - Bek_Loking - 29.05.2014

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..?


Re: Car attachment in the sky [REP+] - Rittik - 29.05.2014

No.It will not give you a warning.


Re: Car attachment in the sky [REP+] - Bek_Loking - 29.05.2014

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....


Re: Car attachment in the sky [REP+] - Rittik - 29.05.2014

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;
}



Re: Car attachment in the sky [REP+] - Bek_Loking - 29.05.2014

It doesnt! Thanks!