SA-MP Forums Archive
/edit command problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /edit command problem (/showthread.php?tid=72532)



/edit command problem - ultras - 09.04.2009

I have /edit command but i can only edit Level and Price of a house in-game.
Can someone please add me in command so i can edit Discription of house too.

Please help, Thanks...

My /edit command

Код:
	if(strcmp(cmd, "/edit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdmin] < 4)
			{
				SendClientMessage(playerid, COLOR_GREY, "  Niste ovlasteni za koristenje ove komande!");
				return 1;
			}
			new x_job[256];
			x_job = strtok(cmdtext, idx);
			if(!strlen(x_job)) {
				SendClientMessage(playerid, COLOR_BLUE, "|_______ Edit _______|");
				SendClientMessage(playerid, COLOR_GRAD3, "Koristite: /edit [ime] [kolicina]");
				SendClientMessage(playerid, COLOR_GREY, "Imena: Level, Price, Disc");
				SendClientMessage(playerid, COLOR_BLUE, " ");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD3, "Koristite: /edit [ime] [kolicina]");
				return 1;
			}
			new proplev = strval(tmp);
	    //if(strcmp(x_job,"car",true) == 0)
	    for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					format(string, sizeof(string), "Kuca: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							HouseInfo[i][hLevel] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							HouseInfo[i][hValue] = proplev;
						}
					}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
				{
					format(string, sizeof(string), "Biz: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							BizzInfo[i][bLevelNeeded] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							BizzInfo[i][bBuyPrice] = proplev;
						}
					}
				}
			}
			for(new i = 0; i < sizeof(SBizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
				{
					format(string, sizeof(string), "SBiz: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							SBizzInfo[i][sbLevelNeeded] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							SBizzInfo[i][sbBuyPrice] = proplev;
						}
					}
				}
			}
			format(string, sizeof(string), "Namjestili ste: %s.", x_job);
			SendClientMessage(playerid, COLOR_WHITE, string);
			OnPropUpdate();
		}
		return 1;
	}



Re: /edit command problem - Snyper18 - 09.04.2009

Quote:
Originally Posted by ultras
I have /edit command but i can only edit Level and Price of a house in-game.
Can someone please add me in command so i can edit Discription of house too.

Please help, Thanks...

My /edit command

Код:
	if(strcmp(cmd, "/edit", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdmin] < 4)
			{
				SendClientMessage(playerid, COLOR_GREY, " Niste ovlasteni za koristenje ove komande!");
				return 1;
			}
			new x_job[256];
			x_job = strtok(cmdtext, idx);
			if(!strlen(x_job)) {
				SendClientMessage(playerid, COLOR_BLUE, "|_______ Edit _______|");
				SendClientMessage(playerid, COLOR_GRAD3, "Koristite: /edit [ime] [kolicina]");
				SendClientMessage(playerid, COLOR_GREY, "Imena: Level, Price, Disc");
				SendClientMessage(playerid, COLOR_BLUE, " ");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD3, "Koristite: /edit [ime] [kolicina]");
				return 1;
			}
			new proplev = strval(tmp);
	    //if(strcmp(x_job,"car",true) == 0)
	    for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
				{
					format(string, sizeof(string), "Kuca: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							HouseInfo[i][hLevel] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							HouseInfo[i][hValue] = proplev;
						}
					}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
				{
					format(string, sizeof(string), "Biz: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							BizzInfo[i][bLevelNeeded] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							BizzInfo[i][bBuyPrice] = proplev;
						}
					}
				}
			}
			for(new i = 0; i < sizeof(SBizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
				{
					format(string, sizeof(string), "SBiz: %d", i);
					SendClientMessage(playerid, COLOR_GRAD2, string);
					if(proplev > 0)
					{
					  if(strcmp(x_job,"level",true) == 0)
					  {
							SBizzInfo[i][sbLevelNeeded] = proplev;
						}
						else if(strcmp(x_job,"price",true) == 0)
					  {
							SBizzInfo[i][sbBuyPrice] = proplev;
						}
					}
				}
			}
			format(string, sizeof(string), "Namjestili ste: %s.", x_job);
			SendClientMessage(playerid, COLOR_WHITE, string);
			OnPropUpdate();
		}
		return 1;
	}
Ask in the GodFather thread -.-


Re: /edit command problem - ultras - 09.04.2009

Please help here, no1 answers there...


Re: /edit command problem - ICECOLDKILLAK8 - 09.04.2009

Too bad, Ask in the Godfather topic


Re: /edit command problem - ultras - 09.04.2009

damn


Re: /edit command problem - ultras - 10.04.2009

bump... no1 answers in GF topic... pls guys!