[Pomoc] dialog stan hitno molim vas


Započeo [GU:RP] Ivica, Mart 26, 2013, 19:13:52 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

evo cmd enter:

if(strcmp(cmd, "/enter", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
					{
						SetPlayerInterior(playerid,HouseInfo[i][hInt]);
						SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
						GameTextForPlayer(playerid, "~w~kuca", 5000, 1);
						PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
						PlayerInfo[playerid][pLocal] = i;
						HouseEntered[playerid] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
					}
				}
			}
//-----------------------kuca1-------------------//
			for(new i = 0; i < sizeof(KucaInfo); i++)
			{
				if (PlayerToPoint(3, playerid,KucaInfo[i][hEntrancex], KucaInfo[i][hEntrancey], KucaInfo[i][hEntrancez]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPhousekey1] == i || KucaInfo[i][hLock] == 0)
					{
						SetPlayerInterior(playerid,KucaInfo[i][hInt]);
						SetPlayerPos(playerid,KucaInfo[i][hExitx],KucaInfo[i][hExity],KucaInfo[i][hExitz]);
						GameTextForPlayer(playerid, "~w~kuca", 5000, 1);
						PlayerInfo[playerid][pInt] = KucaInfo[i][hInt];
						PlayerInfo[playerid][pLocal] = i;
						HouseEntered[playerid] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
					}
				}
			}
//-----------------novo stan-------------------//
			for(new i = 0; i < sizeof(StanInfo); i++)
			{
				if(PlayerToPoint(2.0, playerid, StanInfo[i][stPozicijaX], StanInfo[i][stPozicijaY], StanInfo[i][stPozicijaZ]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pStan] == i || StanInfo[i][stLock] == 0)
					{
						SetPlayerInterior(playerid,StanInfo[i][stInterier]);
						SetPlayerVirtualWorld(playerid,i);
						ustanu[playerid]=i;
						SetPlayerPos(playerid, StanInfo[i][stiPozicijaX], StanInfo[i][stiPozicijaY], StanInfo[i][stiPozicijaZ]);
						GameTextForPlayer(playerid, "~w~stan", 5000, 1);
					}
					else
					{
						GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
					}
				}
			}
//------------novo vikendica---------------------------------
			for(new i = 0; i < sizeof(VikendicaInfo); i++)
			{
				if(PlayerToPoint(2.0, playerid, VikendicaInfo[i][vPozicijaX], VikendicaInfo[i][vPozicijaY],VikendicaInfo[i][vPozicijaZ]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pVikendica] == i || VikendicaInfo[i][vLock] == 0)
					{
						SetPlayerInterior(playerid,VikendicaInfo[i][vInterier]);
						SetPlayerVirtualWorld(playerid,i);
						uvikendici[playerid]=i;
						SetPlayerPos(playerid,VikendicaInfo[i][viPozicijaX],VikendicaInfo[i][viPozicijaY],VikendicaInfo[i][viPozicijaZ]);
						GameTextForPlayer(playerid, "~w~vikendica", 5000, 1);
					}
					else
					{
						GameTextForPlayer(playerid, "~r~zakljucano!", 5000, 1);
					}
				}
			}
			//-------------------------
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
					{
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(BizzInfo[i][bLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(BizzInfo[i][bProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
							//format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
							BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
							ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
							BizzInfo[i][bProducts]--;
							OnPropUpdate();
							//GameTextForPlayer(playerid, string, 5000, 3);
						}
						SetPlayerInterior(playerid,BizzInfo[i][bInterior]);
						SetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
						PlayerInfo[playerid][pInt] = BizzInfo[i][bInterior];
						PlayerInfo[playerid][pLocal] = i+99;
						new dood[MAX_PLAYER_NAME];
						GetPlayerName(playerid, dood, sizeof(dood));
						format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
						printf("%s", string);
						PayLog(string);
						//PlayerInfo[playerid][pLocal] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
					}
				}
			}
			//--------[ FIRMA ULAZ 1 ]---------------------------------//
			for(new i = 0; i < sizeof(BizInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizInfo[i][bzEntranceX], BizInfo[i][bzEntranceY], BizInfo[i][bzEntranceZ]))
				{
					//printf("Found House :%d",i);
					if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizInfo[i][bzEntranceCost])
					{
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(BizInfo[i][bzLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(BizInfo[i][bzProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							GivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
							//format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
							BizInfo[i][bzTill] += BizInfo[i][bzEntranceCost];
							ExtortionBiz(i, BizInfo[i][bzEntranceCost]);
							BizInfo[i][bzProducts]--;
							OnPropUpdate();
							//GameTextForPlayer(playerid, string, 5000, 3);
						}
						SetPlayerInterior(playerid,BizInfo[i][bzInterior]);
						SetPlayerPos(playerid,BizInfo[i][bzExitX],BizInfo[i][bzExitY],BizInfo[i][bzExitZ]);
						PlayerInfo[playerid][pInt] = BizInfo[i][bzInterior];
						PlayerInfo[playerid][pLocal] = i+99;
						new dood[MAX_PLAYER_NAME];
						GetPlayerName(playerid, dood, sizeof(dood));
						format(string, sizeof(string), "%s payed $%d to enter biz %d", dood, BizzInfo[i][bEntranceCost], i);
						printf("%s", string);
						PayLog(string);
						//PlayerInfo[playerid][pLocal] = i;
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
					}
				}
			}
			if (PlayerToPoint(4, playerid,1024.5957,-1024.5645,31.6625))
			{ // Pay & Spray
			    if(GetPlayerState(playerid) == 2)
			    {
			        if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
			        {
			            if(SBizzInfo[14][sbProducts] > 0)
			            {
           					new tmpcar = GetPlayerVehicleID(playerid);
							SetVehiclePos(tmpcar, 1024.5957,-1024.5645,31.6625);
			        		SetVehicleZAngle(tmpcar, 90);
			        		GivePlayerMoney(playerid, - SBizzInfo[14][sbEntranceCost]);
			        		SBizzInfo[14][sbTill] += SBizzInfo[14][sbEntranceCost];
			        		SBizzInfo[14][sbProducts]--;
			        		SetTimerEx("AfterSpray1", 5000, false, "i", playerid);
						}
						else
						{
						    GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
					}
			    }
			}
			if (PlayerToPoint(4, playerid,1024.9756,-1030.7930,32.0257))
			{ // Pay & Spray
			    if(GetPlayerState(playerid) == 2)
			    {
			        if(GetPlayerMoney(playerid) > SBizzInfo[5][sbEntranceCost] + 100)
			        {
			            if(SBizzInfo[5][sbProducts] > 0)
			            {
           					new tmpcar = GetPlayerVehicleID(playerid);
							SetVehiclePos(tmpcar, 1024.9763,-1021.8850,32.1016);
			        		SetVehicleZAngle(tmpcar, 0);
			        		GivePlayerMoney(playerid, - SBizzInfo[5][sbEntranceCost]);
			        		SBizzInfo[5][sbTill] += SBizzInfo[5][sbEntranceCost];
			        		SBizzInfo[5][sbProducts]--;
			        		SetTimerEx("AfterSpray2", 5000, false, "i", playerid);
						}
						else
						{
						    GameTextForPlayer(playerid, "~r~Nemamo vise zaliha", 5000, 1);
						}
					}
					else
					{
					    SendClientMessage(playerid, COLOR_GREY, "Nemate dovoljno novca da udjete u Pay & Spray.");
					}
			    }
			}
			for(new i = 0; i < sizeof(SBizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
				{
					if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= SBizzInfo[i][sbEntranceCost])
					{
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(SBizzInfo[i][sbLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(SBizzInfo[i][sbProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							if(i == 10)
							{
							    PaintballPlayers ++;
							    PlayerPaintballing[playerid] = 1;
							    new rand = random(sizeof(PaintballSpawns));
								SetPlayerPos(playerid, PaintballSpawns[rand][0], PaintballSpawns[rand][1], PaintballSpawns[rand][2]);
								TogglePlayerControllable(playerid, 0);
							}
							else if(i == 11)
							{
							    PlayerKarting[playerid] = 1;
							    SendClientMessage(playerid, ZELENA, "You can now parcipitate in a Karting Race, grab a Kart.");
							}
							else
							{
							    return 1;
							}
							GivePlayerMoney(playerid,-SBizzInfo[i][sbEntranceCost]);
							gSpentCash[playerid] = GetPlayerMoney(playerid);
							SBizzInfo[i][sbProducts]--;
							SBizzInfo[i][sbTill] += SBizzInfo[i][sbEntranceCost];
							ExtortionSBiz(i, SBizzInfo[i][sbEntranceCost]);
							new dood[MAX_PLAYER_NAME];
							GetPlayerName(playerid, dood, sizeof(dood));
							format(string, sizeof(string), "%s payed $%d to enter sbiz %d", dood, SBizzInfo[i][sbEntranceCost], i);
							printf("%s", string);
							PayLog(string);
							OnPropUpdate();
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~Nemate novaca", 5000, 1);
					}
				}
			}
		}
		return 1;
	}


evo ulaz dialog:

for(new i = 0; i < sizeof(StanInfo); i++)
	{
		if(PlayerToPoint(3.0, playerid, StanInfo[i][stPozicijaX], StanInfo[i][stPozicijaY], StanInfo[i][stPozicijaZ]))
		{
 			if(StanInfo[i][stStanje] == 1)
			{
				new mesage1[1148];
				new stan[1148];
				format(mesage1, sizeof(mesage1), "Kliknite {00C0FF}Ulaz da udjete u stan {FFFFFF}da udjete ili {F3FF02}Odustani {FFFFFF}da odustanete!");
				format(stan, 713," %s",mesage1);
				ShowPlayerDialog(playerid,STAN_ULAZD,DIALOG_STYLE_MSGBOX,"{00C0FF}Ulaz",stan,"Ulaz","Odustani");
			}
		}
	}