Como ago que esto aga efecto ...
#1

Hola e esta revisando cosas con el vl-rp ...

Y vi que cuando uno quiere comprar un local
...

Se pone /comprarlocal

Pero resulta que al ponerlo no sirver noce porque .... sale como si el comdo no existiera ...

Miren como esta ..

Код:
 if(strcmp(cmd, "/comprarlocal", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
		{
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      if(PlayerInfo[playerid][pPbiskey] != 255)
			{
				SendClientMessage(playerid, COLOR_WHITE, "  Ya tienes un negocio en tu propiedad, escriba /venderlocal para venderlo.");
				return 1;
			}
			if(BizzInfo[idx][bOwned]==1)
		  		 {
		      SendClientMessage(playerid, COLOR_GREY, "No puedes comprar este Negocio, Ya tiene dueсo.");
		      return 1;
			 }
			for(new b = 0; b < sizeof(SBizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
					{
						format(string, sizeof(string), "Nesesitas ser Nivel %d Para comprar esta propiedad",SBizzInfo[b][sbLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey] = b+100;
						SBizzInfo[b][sbOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
						SafeGivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
						PlayerPlayMusic(playerid);
						SendClientMessage(playerid, COLOR_WHITE, "Felicitaciones por su nueva compra.");
						SendClientMessage(playerid, COLOR_WHITE, "esciba /ayuda para ver los comandos de negocios");
            DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdate(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "No tienes suficiente dinero");
						return 1;
					}
				}
			}
			for(new b = 0; b < sizeof(BizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
					{
						format(string, sizeof(string), "Debes ser Nivel %d para comprar esta propiedad",BizzInfo[b][bLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey] = b;
						BizzInfo[b][bOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
						SafeGivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
						GameTextForPlayer(playerid, "~w~Bienvenido~n~Hacercate a la puerta y escribe /salir para salir", 5000, 3);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						PlayerInfo[playerid][pLocal] = b ;
						SendClientMessage(playerid, COLOR_WHITE, "Felicitaciones por su nueva compra.");
						SendClientMessage(playerid, COLOR_WHITE, "Escriba /ayuda para ver los comandos de negocios.");
            DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdate(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "No tienes suficiente dinero");
						return 1;
					}
				}
			}
		}
		return 1;
	}
Reply
#2

En el comando , al parecer, usan el "if(" entonces, si no cumples uno de los requisitos para usar ese comando, regresara como "Unknown command"
Reply
#3

Quote:
Originally Posted by HuRRiCaNe.
En el comando , al parecer, usan el "if(" entonces, si no cumples uno de los requisitos para usar ese comando, regresara como "Unknown command"
Entonces se quitaria el "if"?
Reply
#4

Amm no entendi ...

Decis que devo quitar el if(??
Reply
#5

Toma este
pawn Код:
//----------------------------------[BIZZ]-----------------------------------------------
    if(strcmp(cmd, "/buybiz", true) == 0)
    {
      if(IsPlayerConnected(playerid))
        {
            new Float:oldposx, Float:oldposy, Float:oldposz;
            GetPlayerName(playerid, playername, sizeof(playername));
            GetPlayerPos(playerid, oldposx, oldposy, oldposz);
      if(PlayerInfo[playerid][pPbiskey] != 255)
            {
                SendClientMessage(playerid, COLOR_WHITE, "  You already own a business, type /sellbiz if you want to buy this one.");
                return 1;
            }
            for(new b = 0; b < sizeof(SBizzInfo); b++)
            {
                if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
                {
                    if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
                    {
                        format(string, sizeof(string), "You Must Be Level %d To Purchase This",SBizzInfo[b][sbLevelNeeded]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(GetPlayerMoney(playerid) > SBizzInfo[b][sbBuyPrice])
                    {
                        PlayerInfo[playerid][pPbiskey] = b+100;
                        SBizzInfo[b][sbOwned] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
                        SafeGivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
                        PlayerPlayMusic(playerid);
                        SendClientMessage(playerid, COLOR_WHITE, "Congratulations, On Your New Purchase.");
                        SendClientMessage(playerid, COLOR_WHITE, "Type /Ayuda to review the new business help section.");
            DateProp(playerid);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
                        return 1;
                    }
                }
            }
            for(new b = 0; b < sizeof(BizzInfo); b++)
            {
                if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
                {
                    if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
                    {
                        format(string, sizeof(string), "You Must Be Level %d To Purchase This",BizzInfo[b][bLevelNeeded]);
                        SendClientMessage(playerid, COLOR_GRAD5, string);
                        return 1;
                    }
                    if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
                    {
                        PlayerInfo[playerid][pPbiskey] = b;
                        BizzInfo[b][bOwned] = 1;
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
                        SafeGivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
                        PlayerPlayMusic(playerid);
                        SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
                        PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
                        SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
                        GameTextForPlayer(playerid, "~w~Bienbenido~n~You can exit at any time by moving to this door and typing /Salir", 5000, 3);
                        PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
                        PlayerInfo[playerid][pLocal] = b ;
                        SendClientMessage(playerid, COLOR_WHITE, "Felicidades Por Su Nueva Compra");
                        SendClientMessage(playerid, COLOR_WHITE, "Usa /ayuda para ver los comandos");
            DateProp(playerid);
                        OnPropUpdate();
                        OnPlayerUpdate(playerid);
                        return 1;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "No Tienes Dinero Suficiente");
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#6

Roymer a mi me pasaba lo mismo, puse lo tuyo y me funciona pero al poner /open abro el negocio pongo /entrar y no puedo entrar.....sabes que pasa?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)