Sign in to follow this  
Followers 0
Guest

По воротники на клавиши Num4 and Num6

2 posts in this topic

	new carid = GetPlayerVehicleID(playerid);
	if((newkeys & KEY_ANALOG_LEFT) || (KEY_SPRINT & KEY_ANALOG_LEFT))// Клавиша Num 4
	{
		if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
			switch(Povorotnk[0][carid])
			{
				case false:
				{
                  	Povorotnk[0][carid] = true;
                  	Povor[0] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0,0.0, 0.0,100.0);
                  	Povor[1] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0,0.0, 0.0,100.0);
                  	AttachObjectToVehicle(Povor[0], carid, 0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
                	AttachObjectToVehicle(Povor[1], carid, 0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
				}
				case true:
                {
                	Povorotnk[0][carid] = false;
                	DestroyObject(Povor[0]);
                	DestroyObject(Povor[1]);
                }
			}
		}
	}
	if((newkeys & KEY_ANALOG_RIGHT) || (KEY_SPRINT & KEY_ANALOG_RIGHT))// Клавиша Num 6
	{
		if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
		{
			switch(Povorotnk[1][carid])
			{
				case false:
				{
                    Povorotnk[1][carid] = true;
                    Povor[2] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0,0.0, 0.0,100.0);
                    Povor[3] = CreateObject(19294, 0.0, 0.0, 0.0, 0.0,0.0,  0.0,100.0);
                    AttachObjectToVehicle(Povor[2], carid, -0.9, 2.5, 0.1, 0.0, 0.0, 0.0);
                    AttachObjectToVehicle(Povor[3], carid, -0.9, -2.7, 0.1, 0.0, 0.0, 0.0);
				}
				case true:
				{
                    Povorotnk[1][carid] = false;
                    DestroyObject(Povor[2]);
                    DestroyObject(Povor[3]);
				}
			}
		}
	}

Для начало делаем 2 глобальные переменные 

new bool:Povorotnk[3][MAX_VEHICLES];
new Povor[4];
Далее идём в public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) и вставляем код выше

 

Share this post


Link to post
Share on other sites
  • на num 4 правый поворотник
     
  •  
    а на num 6 левый

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   You have pasted content with formatting.   Remove formatting

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

Loading...
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content