[Pomoc] Svadba


Započeo kim3205, Decembar 02, 2014, 20:39:35 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:LS
Detaljan opis problema:Kako da napravim na mod i dodam CMD na lokaciji (koju ja oc) da moze /propose i /witnes za svadbu da zaprosi mladu i da uzmem kuma i kumicu
Dio skripte: Meni treba
Neke slike/video za lakse dobivanje pomoci(neobavezno)://

i am king!

Ako sam te dobro razumeo ti hoces da sredis da se te 2 komande mogu koristiti samo na nekoj lokaciji ?
Ako je tako onda samo u komandu dodas nesto tipa

if (!IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z)) return SCM (playerid, -1, "Text");


http://wiki.sa-mp.com/wiki/IsPlayerInRangeOfPoint
Poslednja Izmena: Decembar 02, 2014, 20:48:13 POSLE PODNE od â–… â–† â–ˆ Rudimental â–ˆ â–† â–…

mozda sam nerazuman xD hocu da dodam u modu CMD /propose i /witnes i na stats da se vidim sa kim je u vezi

i am king!

A to te zanima :D sto odma tako ne kazes :P
To bi ovako od prilike izgledala linija kojom bi se upisivalo ime
strmid(PlayerInfo[playerid][pMarried], GetName(id), 0, strlen(GetName(id)), 255);

Citat: â–... â–† â–ˆ Rudimental â–ˆ â–† â–... poslato Decembar 02, 2014, 22:13:21 POSLE PODNE
A to te zanima :D sto odma tako ne kazes :P
To bi ovako od prilike izgledala linija kojom bi se upisivalo ime
strmid(PlayerInfo[playerid][pMarried], GetName(id), 0, strlen(GetName(id)), 255);


hahahaha jel ti to mene zsmejavas ? kazem hocu da dodam CMD:propose i CMD:witnes kako bih se parovi spojili i pisalo u stats s kim je u vezi

i am king!

Pinki nemam sad vremenasutra ujutro cu ti poslat  witness propose I accept za to

Citat: luka2223 poslato Decembar 02, 2014, 23:54:22 POSLE PODNE
Pinki nemam sad vremenasutra ujutro cu ti poslat  witness propose I accept za to

Vazi ti postavi ovde il spremi u pastebin i javi mi na fb https://www.facebook.com/pacinop
kako os

i am king!


xaxaxa lopove ok videdcu :D

i am king!

Evo ti ovo:
YCMD:propose(playerid, params[], help)
{
	if(help) return SCM(playerid, COLOR_GREY, "Not supported");

	if(IsPlayerConnected(playerid))
	{
		if(GetPlayerMoney(playerid) < 20000)
		{
			SCM(playerid, COLOR_GREY, "   The Marriage & Reception costs $20000 !");
			return 1;
		}
		if(PlayerInfo[playerid][pMarried] > 0)
		{
			SCM(playerid, COLOR_GREY, "   You are already Married !");
			return 1;
		}
		if(PlayerInfo[playerid][pPhousekey] == 9999)
		{
			SCM(playerid, COLOR_GREY, "   You don't have a House to let your Wife / Husband live somewhere !");
			return 1;
		}
		new string[256], giveplayerid;
		if(sscanf(params, "u", giveplayerid))
		{
			SCM(playerid, COLOR_WHITE, "USAGE: /propose [Playerid/PartOfName]");
			return 1;
		}
		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if(PlayerInfo[giveplayerid][pMarried] > 0)
				{
					SCM(playerid, COLOR_GREY, "   That player is already Married !");
					return 1;
				}
				if(PlayerInfo[giveplayerid][pPhousekey] != 9999)
				{
					SCM(playerid, COLOR_GREY, "   That player has a House, can't be Married !");
					return 1;
				}
				if(PlayerInfo[giveplayerid][pPbiskey] != 9999)
				{
					SCM(playerid, COLOR_GREY, "   That player has a Business, can't be Married !");
					return 1;
				}
				if (ProxDetectorS(8.0, playerid, giveplayerid))
				{
					if(giveplayerid == playerid) { SCM(playerid, COLOR_GREY, "You cannot Propose to yourself!"); return 1; }
					format(string, sizeof(string), "* You proposed to %s.", GetPlayerNameEx(giveplayerid));
					SCM(playerid, COLOR_WHITE, string);
					format(string, sizeof(string), "* %s just proposed to you (type /accept marriage) to accept.", GetPlayerNameEx(playerid));
					SCM(giveplayerid, COLOR_WHITE, string);
					ProposeOffer[giveplayerid] = playerid;
				}
				else
				{
					SCM(playerid, COLOR_GREY, "   That player is not near you !");
					return 1;
				}
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "   That player is Offline !");
			return 1;
		}
	}
	return 1;
}

YCMD:witness(playerid, params[], help)
{
	if(help) return SCM(playerid, COLOR_GREY, "Not supported");

	if(IsPlayerConnected(playerid))
	{
		new string[256], giveplayerid;
		if(sscanf(params, "u", giveplayerid))
		{
			SCM(playerid, COLOR_WHITE, "USAGE: /witness [Playerid/PartOfName]");
			return 1;
		}
		if(IsPlayerConnected(giveplayerid))
		{
			if(giveplayerid != INVALID_PLAYER_ID)
			{
				if (ProxDetectorS(8.0, playerid, giveplayerid))
				{
					if(giveplayerid == playerid) { SCM(playerid, COLOR_GREY, "You cannot Propose to yourself!"); return 1; }
					format(string, sizeof(string), "* You requested %s to be your Marriage Witness.", GetPlayerNameEx(giveplayerid));
					SCM(playerid, COLOR_WHITE, string);
					format(string, sizeof(string), "* %s just requested you to be his Marriage Witness (type /accept witness) to accept.", GetPlayerNameEx(playerid));
					SCM(giveplayerid, COLOR_WHITE, string);
					MarryWitnessOffer[giveplayerid] = playerid;
				}
				else
				{
					SCM(playerid, COLOR_GREY, "   That player is not near you !");
					return 1;
				}
			}
		}
		else
		{
			SCM(playerid, COLOR_GREY, "   That player is Offline !");
			return 1;
		}
	}
	return 1;
}

Imas ovo kao za accept
else if(strcmp(x_job,"witness",true) == 0)
		{
			if(MarryWitnessOffer[playerid] < 999)
			{
				if(IsPlayerConnected(MarryWitnessOffer[playerid]))
				{
					if(ProxDetectorS(10.0, playerid, MarryWitnessOffer[playerid]))
					{
						GetPlayerName(MarryWitnessOffer[playerid], giveplayer, sizeof(giveplayer));

						format(string, sizeof(string), "* You have accepted %s's request to be his Marriage Witness.", giveplayer);
						SCM(playerid, COLOR_WHITE, string);
						format(string, sizeof(string), "* %s has accepted your request to be your Marriage Witness.", sendername);
						SCM(MarryWitnessOffer[playerid], COLOR_WHITE, string);
						MarryWitness[MarryWitnessOffer[playerid]] = playerid;
						MarryWitnessOffer[playerid] = 999;
						return 1;
					}
					else
					{
						SCM(playerid, COLOR_GREY, "   The player that requested you to be his Marriage Witness is not near you !");
						return 1;
					}
				}
			}
			else
			{
				SCM(playerid, COLOR_GREY, "   No-one asked you to be his Marriage Witness !");
				return 1;
			}
		}
		else if(strcmp(x_job,"marriage",true) == 0)
		{
			if(ProposeOffer[playerid] < 999)
			{
				if(!IsPlayerInRangeOfPoint(playerid, 10, 2232.3047,-1333.1543,23.9815))
				{
					SCM(playerid, COLOR_GREY, "   You are not at the Church in Jefferson !");
					return 1;
				}
				if(IsPlayerConnected(ProposeOffer[playerid]))
				{
					if(ProxDetectorS(10.0, playerid, ProposeOffer[playerid]))
					{
						if(MarryWitness[ProposeOffer[playerid]] == 999)
						{
							SCM(playerid, COLOR_GREY, "   The proposer doesn't have a Marriage Witness !");
							return 1;
						}
						if(IsPlayerConnected(MarryWitness[ProposeOffer[playerid]]))
						{
							if(ProxDetectorS(12.0, ProposeOffer[playerid], MarryWitness[ProposeOffer[playerid]]))
							{
								GetPlayerName(ProposeOffer[playerid], giveplayer, sizeof(giveplayer));

								format(string, sizeof(string), "* You have accepted %s's request to be your Husband.", giveplayer);
								SCM(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s has accepted your request to be your Wife.", sendername);
								SCM(ProposeOffer[playerid], COLOR_WHITE, string);
								format(string, sizeof(string), "Priest: %s do you take %s as your lovely Husband? (type 'yes', anything else will reject the Marriage)", sendername, giveplayer);
								SCM(playerid, COLOR_WHITE, string);
								MarriageCeremoney[playerid] = 1;
								ProposedTo[ProposeOffer[playerid]] = playerid;
								GotProposedBy[playerid] = ProposeOffer[playerid];
								MarryWitness[ProposeOffer[playerid]] = 999;
								ProposeOffer[playerid] = 999;
								return 1;
							}
							else
							{
								SCM(playerid, COLOR_GREY, "   The Marriage Witness is not near your proposer !");
								return 1;
							}
						}
						return 1;
					}
					else
					{
						SCM(playerid, COLOR_GREY, "   The player that proposed to you is not near you !");
						return 1;
					}
				}
			}
			else
			{
				SCM(playerid, COLOR_GREY, "   No-one Proposed to you !");
				return 1;
			}
		}

Varijable:
new DivorceOffer[MAX_PLAYERS];
new MarriageCeremoney[MAX_PLAYERS];
new ProposeOffer[MAX_PLAYERS];
new ProposedTo[MAX_PLAYERS];
new GotProposedBy[MAX_PLAYERS];
new MarryWitness[MAX_PLAYERS];
new MarryWitnessOffer[MAX_PLAYERS];