PD Door not opening and closing right...
#1

My police door does not open and close right... Like the door faces the wrong direction (see picture). Whats wrong in my script... this is what I have:

Код:
			else if(IsPlayerInRangeOfPoint(playerid, 2,246.228,72.4962,1003.04))
			{
			    if(lspd2 == 0)
			    {
		      		MoveDynamicObject(lspddoor2, 246.228,72.4962,1000.63, 4.5000);
		      		SendClientMessage(playerid, COLOR_BLUE,"SAPD door is open, please close it!");
		      		GetPlayerName(playerid, sendername, sizeof(sendername));
		      		format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
		      		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		      		lspd2 = 1;
				}
	      		else
				{
				    MoveDynamicObject(lspddoor2, 246.228,72.4962,1003.04, 4.5000);
		      		SendClientMessage(playerid, COLOR_BLUE,"SAPD Control door is closed, thank you!");
		      		GetPlayerName(playerid, sendername, sizeof(sendername));
		      		format(string, sizeof(string), "* %s takes his/her remote control and Closes the door.", sendername);
		      		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		      		lspd2 = 0;
				}
			}
http://i.imgur.com/ninfn.jpg
Reply
#2

The coordinates changed in 0.3e, the code is based on 0.3d (I think). Update the "MoveDynamicObject" code based on:
pawn Код:
native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
Reply
#3

Wait so what exactly should I replace MoveDynamicObject(lspddoor2, 246.228,72.4962,1000.63, 4.5000);
with?
Reply
#4

Uhhh. Try this.
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 2,246.228,72.4962,1003.04))
            {
                if(lspd2 == 0)
                {
                    MoveDynamicObject(lspddoor2, 246.228,72.4962,1000.63, 4.5000, 0.0, 0.0, 90.0);
                    SendClientMessage(playerid, COLOR_BLUE,"SAPD door is open, please close it!");
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    lspd2 = 1;
                }
                else
                {
                    MoveDynamicObject(lspddoor2, 246.228,72.4962,1003.04, 4.5000, 0.0, 0.0, 90.0);
                    SendClientMessage(playerid, COLOR_BLUE,"SAPD Control door is closed, thank you!");
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s takes his/her remote control and Closes the door.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    lspd2 = 0;
                }
            }
Reply
#5

Thanks will try... +1 REP both of you guys
Reply
#6

With
Код:
 MoveDynamicObject(lspddoor2, 246.228,72.4962,1000.63, 4.5000, 0.0, 0.0, 90.0);
the door doesn't work at all... What should I put?
Reply
#7

Anyone know?
Reply
#8

Hmm, try using:
pawn Код:
SetDynamicObjectPos(objectid, Float:x, Float:y, Float:z);
So:
pawn Код:
else if(IsPlayerInRangeOfPoint(playerid, 2,246.228,72.4962,1003.04))
            {
                if(lspd2 == 0)
                {
                    SetDynamicObjectPos(lspddoor2, 246.228,72.4962,1000.63);
                    SendClientMessage(playerid, COLOR_BLUE,"SAPD door is open, please close it!");
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    lspd2 = 1;
                }
                else
                {
                    SetDynamicObjectPos(lspddoor2, 246.228,72.4962,1003.04);
                    SendClientMessage(playerid, COLOR_BLUE,"SAPD Control door is closed, thank you!");
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s takes his/her remote control and Closes the door.", sendername);
                    ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                    lspd2 = 0;
                }
            }
Also avoid bumping the topic so early.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)