Dialog help!
#1

Hi!

I have a problem...I have a CO and when u r buying a car u buy it with enter or F and choose a car with left & right arrow! Now i want to remowe that and make it to buy a car in a dialog! If you can't make that nobody can!

So i want this to have in DIALOG! That when you type /dealership you get a dialog with listed cars and prices and when you choose a car just klick and you buyed it!

Код:
public CarSelect(playerid)
{
if(IsPlayerConnected(playerid))
	{
	if(BuyCar[playerid] == true)
		{
		new string[128];
		new ime[24];
	    new Keys, ud, lr;
	    GetPlayerKeys(playerid, Keys, ud, lr);
	    	GetPlayerName(playerid, ime, sizeof(ime));
			if(lr > 0)
				{
					AutoModel++;
					if(AutoModel > NUMBER_OFSELLED_MODELS-1) {AutoModel = 0;}
					DestroyVehicle(IzlozbenoVozilo);
					IzlozbenoVozilo = CreateVehicle(Modeli_vozila[AutoModel][0], 1129.2640,-1454.3809,15.7969,181.4425, Mboja[0], Mboja[1], 30000);
					format(string,sizeof(string),"~h~~h~~b~Cjena: %d~n~~n~~h~~h~~y~< ~g~dalje ~h~~h~~y~>",Modeli_vozila[AutoModel][1]);
					TextDrawSetString(MotoTextDraw[playerid],string);
				}
				else if(lr < 0)
				{
					AutoModel--;
					if (AutoModel < 0) {AutoModel = BROJ_PRODAJNIH_MODELA-1;}
					DestroyVehicle(IzlozbenoVozilo);
					IzlozbenoVozilo = CreateVehicle(Modeli_vozila[AutoModel][0], 1129.2640,-1454.3809,15.7969,181.4425, Mboja[0], Mboja[1], 30000);
					format(string,sizeof(string),"~h~~h~~b~Cjena: %d~n~~n~~h~~h~~y~< ~g~prethodno ~h~~h~~y~>",Modeli_vozila[AutoModel][1]);
					TextDrawSetString(MotoTextDraw[playerid],string);
				}
				else if(Keys & KEY_SECONDARY_ATTACK)
				{
				if(PlayerInfo[playerid][pCar1] == 255 || PlayerInfo[playerid][pCar2] == 255 || PlayerInfo[playerid][pCar1] == 255 && PlayerInfo[playerid][pCar2] == 255)
				{
				if(GetPlayerMoney(playerid) >= Modeli_vozila[AutoModel][1])
				{
				for(new i = 1; i < sizeof(Vozila); i++ )
					{
					if(Vozila[i][mX] == 0 && Vozila[i][mY] == 0 && Vozila[i][mZ] == 0 && Vozila[i][mKoristen] == 0)
					{
					// vozilo RESET KLJUCA
				PlayerInfo[playerid][pCar1] = GetMyCar1(playerid); //auto 1
				PlayerInfo[playerid][pCar2] = GetMyCar2(playerid); //auto 2

				if(PlayerInfo[playerid][pCar1] == 255 && PlayerInfo[playerid][pCar2] == 255)
				{PlayerInfo[playerid][pCar1] = i;
				Vozila[i][mBroj] = 1;}
    			else if(PlayerInfo[playerid][pCar2] == 255 && PlayerInfo[playerid][pCar1] != 255)
			 	{PlayerInfo[playerid][pCar2] = i;
				 Vozila[i][mBroj] = 2;}
	    		 else if(PlayerInfo[playerid][pCar2] != 255 && PlayerInfo[playerid][pCar1] == 255)
				 {PlayerInfo[playerid][pCar1] = i;
				 Vozila[i][mBroj] = 1;}
				 PlayerInfo[playerid][pMainKey] = i;

				SendClientMessage(playerid, COLOR_GREEN, "Kupili ste vozilo! Za pomoc koriste /vehhelp !");
				GivePlayerMoney(playerid,-Modeli_vozila[AutoModel][1]);
				Vozila[i][mKoristen] = 1;
				Vozila[i][mModel] = Modeli_vozila[AutoModel][0];
				Vozila[i][mX] = 1106.5691;
				Vozila[i][mY] = -1428.4077;
				Vozila[i][mZ] = 16.0969;
				Vozila[i][mA] = 265.0799;
				Vozila[i][mpBoja] = Mboja[0];
				Vozila[i][mdBoja] = Mboja[1];
				Vozila[i][mZakljucan] = 0;
				strmid(Vozila[i][mVlasnik], ime, 0, strlen(ime), 999);
          		TogglePlayerControllable(playerid, 1);
          		Vozila[i][mOsobno] = CreateVehicle(Modeli_vozila[AutoModel][0], Vozila[i][mX],Vozila[i][mY],Vozila[i][mZ],Vozila[i][mA], Vozila[i][mpBoja], Vozila[i][mdBoja], 30000);
          		KillTimer(Mtimer[playerid]);
          		KupnjaVozila[playerid] = false;
          		HMotoText(playerid);
          		SetCameraBehindPlayer(playerid);
          		UpdateVozilo(i);
          		break;
          		    }
          		   }
          		}
          		else
          		{
          		format(string,sizeof(string),"Nemas dosta novaca! Ovo vozilo stoji %d dolara!",Modeli_vozila[AutoModel][1]);
				SendClientMessage(playerid,COLOR_LIGHTRED,string);
				}
	    		}
	    		else
	    		{
	    		SendClientMessage(playerid,COLOR_LIGHTRED,"Vec imate vozilo!");
	    		}
	    		}
	    		else if (Keys &  KEY_HANDBRAKE || Keys &  KEY_JUMP )
	    		{
	    		KillTimer(Mtimer[playerid]);
	    		TogglePlayerControllable(playerid, 1);
	    		SendClientMessage(playerid, COLOR_LIGHTBLUE, "Odustali ste od kupnje vaseg vozila...");
	    		KupnjaVozila[playerid] = false;
    			HMotoText(playerid);
    			SetCameraBehindPlayer(playerid);
	    		}
			}
		}
	return 1;
}
Reply


Messages In This Thread
Dialog help! - by xXx:FireBlade - 14.10.2012, 21:25
Re: Dialog help! - by 0utLaW_ - 15.10.2012, 09:15
Re: Dialog help! - by xXx:FireBlade - 15.10.2012, 09:19
Re: Dialog help! - by xXx:FireBlade - 15.10.2012, 09:33
Re: Dialog help! - by 0utLaW_ - 15.10.2012, 10:08

Forum Jump:


Users browsing this thread: 1 Guest(s)