SA-MP Forums Archive
/duty makes 3 objects turn 90° (+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: /duty makes 3 objects turn 90° (+rep) (/showthread.php?tid=326189)



[SOLVED] /duty makes 3 objects turn 90° (+rep) - Outlaaw - 16.03.2012

As i write /duty to be on duty as cop
3 gates turn 90°, but only for the first time so next /dutys dont do anything
I m using midostream, but simple createobjects turned too
Please help!
I didn't notice any TURNING with other commands, i m totally clueless

Код:
	if(strcmp(cmd, "/duty", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(Player[playerid][PD_Job] == 1)
			{
				if (PlayerToPoint(3, playerid,1547.130493, -1669.448730, 13.566784))
				{
					if(OnDuty[playerid]==0)
			        {
				    	format(string, sizeof(string), "* Officer %s took a Badge and a Gun from his locker.", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						GivePlayerWeapon(playerid, 24, 70);
						GivePlayerWeapon(playerid, 3, 0);
						GivePlayerWeapon(playerid, 29, 1000);
						OnDuty[playerid] = 1;
						SetPlayerColor(playerid,COLOR_BLUEE);
						new rskin = 280+random(3);
						SetPlayerSkin(playerid,rskin);
					}
					else if(OnDuty[playerid]==1)
					{
						format(string, sizeof(string), "* Officer %s places his Badge and Gun in his locker.", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						GivePlayerWeapon(playerid, 23, 150);
						GivePlayerWeapon(playerid, 5, 0);
						OnDuty[playerid] = 0;
						SetPlayerColor(playerid,COLOR_WHITE);
						SetPlayerSkin(playerid,Player[playerid][PD_Skin]);
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_RED, "   You are not in a locker room !");
					return 1;
				}
			}
 		}
		return 1;
    }
objects which turn 90°
Код:
pdgate1 = CreateStreamObject(971, 1544.788574, -1627.786987, 12.402758, 0.0000, 0.0000, 270.0000,250.0);
//pdgate2 doesnt turn
pdgate2 = CreateStreamObject(971, 1588.683228, -1638.276245, 12.507904, 0.0000, 0.0000, 180.0000,250.0);
jailgate1 = CreateStreamObject(987, 2436, 122.19999694824, 25.200000762939, 0, 0, 179.99450683594, 250.0);
jailgate2 = CreateStreamObject(987, 2416.8999023438, 143.89999389648, 24.89999961853, 0, 0, 89.994506835938, 250.0);



AW: /duty makes 3 objects turn 90° (+rep) - Blunt P - 16.03.2012

try to renew your compiler and includes, i saw that happening when someone compiled with 0.3C includes and used that on a 0.3d Server.


Re: /duty makes 3 objects turn 90° (+rep) - Outlaaw - 16.03.2012

Problem solved

i ignored Moveobject having 3 additional arguments of rotations