[pomoc] Lock

Započeo GLADIATOR, Avgust 06, 2012, 18:44:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

skripta koju koristim:GTARP
deo skripte :
Citatnew keycar = PlayerInfo[playerid][pPcarkey] || PlayerInfo[playerid][pPcarkey2] || [PlayerInfo[playerid][pPcarkey3])
                if(keycar != 999)
                {
                    if(CarInfo[keycar][cLock] == 1)
                    {
                       for(new i = 0; i < MAX_PLAYERS; i++)
                  {
                     if (IsPlayerConnected(i))
                     {
                        SetVehicleParamsForPlayer(keycar,i,0,0);
                     }
                  }
                  format(string, sizeof(string), "~b~Otkljuceno");
                  GameTextForPlayer(playerid, string, 4000, 3);
                  CarInfo[keycar][cLock] = 0;
                  OnPropUpdate();
                  return 1;
               }
               else if(CarInfo[keycar][cLock] == 0)
               {
                   for(new i = 0; i < MAX_PLAYERS; i++)
                  {
                     if (IsPlayerConnected(i))
                     {
                        SetVehicleParamsForPlayer(keycar,i,0,1);
                     }
                  }
                  format(string, sizeof(string), "~r~Zakluceno");
                  GameTextForPlayer(playerid, string, 4000, 3);
                  CarInfo[keycar][cLock] = 1;
                  OnPropUpdate();
                  return 1;
               }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, " Nemate auto.");
                    return 1;
                }
           }
slike/vidoe: /
problem:Ovako sad Imam ovo za zaklucavanja ali ovde 1 avto samo zakljucava a ja imam ono dialog i max 3 avta sad udzem u avto /auto pisem iskoci dialog idem lock i ono zakluci samo ono prvo jel zna neko kako da uradim neku cmd Kad ide u dialog lock u koje auto je u to da se zakluci hvala ;D
GLADIATOR RPG MACEDONIA

Ovo sam ja nesto pokusavao, e sad koliko to radi ja ti nemogu reci.

new keycar[3];
keycar[0] = PlayerInfo[playerid][pPcarkey];
keycar[1] = PlayerInfo[playerid][pPcarkey2];
keycar[2] = PlayerInfo[playerid][pPcarkey3];
if(IsAnOwnableCar(vehicleid))

{
	if(keycar[0] == vehicleid || keycar[1] == vehicleid || keycar[2] == vehicleid)
	
	{
		ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST, "Lock", "Otkljcaj\nZakljucaj", "Selektuj", "Odustani");
		
	}
	
}


OnDialogResponse:

if(dialogid == 333)

{
	new keycar[3];
	keycar[0] = PlayerInfo[playerid][pPcarkey];
	keycar[1] = PlayerInfo[playerid][pPcarkey2];
	keycar[2] = PlayerInfo[playerid][pPcarkey3];
	new vehicle = GetPlayerVehicleID(playerid);
	if(listitem == 0)

	{
		if(keycar[0] == vehicle)

		{
			if(CarInfo[vehicle][cLock] == 1)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[0],i,0,0);

					}

				}
				format(string, sizeof(string), "~b~Otkljuceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[0]][cLock] = 0;
				OnPropUpdate();

			}

		}
		else if(keycar[1] == vehicle)

		{
			if(CarInfo[vehicle][cLock] == 1)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[1],i,0,0);

					}

				}
				format(string, sizeof(string), "~b~Otkljuceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[1]][cLock] = 0;
				OnPropUpdate();

			}

		}
		else if(keycar[2] == vehicle)

		{
			if(CarInfo[vehicle][cLock] == 1)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[2],i,0,0);

					}

				}
				format(string, sizeof(string), "~b~Otkljuceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[2]][cLock] = 0;
				OnPropUpdate();

			}

		}

	}
	if(listitem == 1)

	{
		if(keycar[0] == vehicle)

		{
			if(CarInfo[keycar[0]][cLock] == 0)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[0],i,0,1);

					}

				}
				format(string, sizeof(string), "~r~Zakluceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[0]][cLock] = 1;
				OnPropUpdate();

			}

		}
		else if(keycar[1] == vehicle)

		{
			if(CarInfo[keycar[1]][cLock] == 0)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[1],i,0,1);

					}

				}
				format(string, sizeof(string), "~r~Zakluceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[1]][cLock] = 1;
				OnPropUpdate();

			}

		}
		else if(keycar[2] == vehicle)

		{
			if(CarInfo[keycar[2]][cLock] == 0)

			{
				for(new i = 0; i < MAX_PLAYERS; i++)

				{
					if (IsPlayerConnected(i))

					{
						SetVehicleParamsForPlayer(keycar[2],i,0,1);

					}

				}
				format(string, sizeof(string), "~r~Zakluceno");
				GameTextForPlayer(playerid, string, 4000, 3);
				CarInfo[keycar[2]][cLock] = 1;
				OnPropUpdate();

			}

		}

	}

}