Jump to content
  • 0

Problema /open


AndrewTG01

Question

Problema intalnita (descriere):Am o problema, eu cand vreau sa dau /open la o casa sau biz spune ca nu am cheie.
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu): 
if(strcmp(cmd, "/open", 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]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) || HouseInfo[i][hVW] == GetPlayerVirtualWorld(playerid))
				{
					if(PlayerInfo[playerid][pPhousekey] == i)
					{
						if(HouseInfo[i][hLock] == 1)
						{
							HouseInfo[i][hLock] = 0;
							GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(HouseInfo[i][hLock] == 0)
						{
							HouseInfo[i][hLock] = 1;
							GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]) || BizzInfo[i][bVW] == GetPlayerVirtualWorld(playerid))
				{
					if(PlayerInfo[playerid][pPbiskey] == i)
					{
						if(BizzInfo[i][bLocked] == 1)
						{
							BizzInfo[i][bLocked] = 0;
							GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(BizzInfo[i][bLocked] == 0)
						{
							BizzInfo[i][bLocked] = 1;
							GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
			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+100)
					{
						if(SBizzInfo[i][sbLocked] == 1)
						{
							SBizzInfo[i][sbLocked] = 0;
							GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(SBizzInfo[i][sbLocked] == 0)
						{
							SBizzInfo[i][sbLocked] = 1;
							GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
	    }
	    return 1;
	}

 

if(strcmp(cmd, "/buyhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			for(new h = 0; h < sizeof(HouseInfo); h++)
			{
				if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
					{
						format(string, sizeof(string), "   You must be Level %d to purchase this !", HouseInfo[h][hLevel]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
					{
						SendClientMessage(playerid, COLOR_WHITE, "   You already own a house, type /sellhouse if you want to buy this one !");
						return 1;
					}
					if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
					{
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
						PlayerPlayMusic(playerid);
						SetPlayerVirtualWorld(playerid,HouseInfo[h][hVW]);
						SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
						TogglePlayerControllable(playerid,0);
						SetTimerEx("FreezeTimer",3000,0,"d",playerid);
						HouseEntered[playerid] = h;
						GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
						PlayerInfo[playerid][pLocal] = h;
						SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new Purchase !");
						SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new property help section !");
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateEx(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
						return 1;
					}
				}
			}
		}
		return 1;
	}


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Da

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

modifica din asta

 for(new i = 0; i < sizeof(HouseInfo); i++)
			{
				if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) || HouseInfo[i][hVW] == GetPlayerVirtualWorld(playerid))
				{
					if(PlayerInfo[playerid][pPhousekey] == i)
					{

 

in asta

for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) || HouseInfo[i][hVW] == GetPlayerVirtualWorld(playerid)) { if(PlayerInfo[playerid][pPhousekey] == i)

{
	

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
5 minutes ago, AndrewTG01 said:

cand adaug asta primesc erori

nu trebuie sa adaugi ci sa inlocuiesti am spus clar inlocuiest asta cu asta,

 

 

 

 

 

 

 

 

 

 

 

Esti sigur ca primesti mesajul you don't have a key?

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

pai da , am inlocuit si primesc erori

for(new i = 0; i < sizeof(HouseInfo); i++) { if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) || HouseInfo[i][hVW] == GetPlayerVirtualWorld(playerid)) { if(PlayerInfo[playerid][pPhousekey] == i)
            {
					if(PlayerInfo[playerid][pPhousekey] == i)
					{
						if(HouseInfo[i][hLock] == 1)
						{
							HouseInfo[i][hLock] = 0;
							GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(HouseInfo[i][hLock] == 0)
						{
							HouseInfo[i][hLock] = 1;
							GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
			}

 

E:\servere\Real Gaming\gamemodes\gf.pwn(1684) : error 004: function "IsAnOwnableCar" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1756) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1760) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1772) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1776) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1780) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1784) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1788) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1792) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1796) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1800) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1812) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1816) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1828) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1832) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1836) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1840) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1844) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1856) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1868) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(1872) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(3634) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(3639) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(3649) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(3660) : error 004: function "PlayerToPoint" is not implemented
E:\servere\Real Gaming\gamemodes\gf.pwn(3665) : error 004: function "PlayerToPoint" is not implemented

 

da , primesc mesajul ala  si am bizul/casa

Link to comment
Share on other sites

  • 0

adauga o verificare la comanda unde e forul pentru  house, la else dupa acest mesaj


						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);

 

adauga asa

	new str22[120];
	format(str22,120,"Hosue owned by %s id %d, player house %d si %d",HouseInfo[h][hOwner], h, PlayerInfo[playerid][pPhousekey],PlayerInfo[ReturnUser(HouseInfo[h][hOwner])][pPhousekey]);
	SendClientMessage(playerid,-1,str22);
	

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
17 minutes ago, AndrewTG01 said:

cand dau /open acum scrie unknown command

deci tot ce ai avut de facut a fost sa adaugi 3 linii asa

if(strcmp(cmd, "/open", 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]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]) || HouseInfo[i][hVW] == GetPlayerVirtualWorld(playerid))
				{
					if(PlayerInfo[playerid][pPhousekey] == i)
					{
						if(HouseInfo[i][hLock] == 1)
						{
							HouseInfo[i][hLock] = 0;
							GameTextForPlayer(playerid, "~w~Door ~g~Unlocked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(HouseInfo[i][hLock] == 0)
						{
							HouseInfo[i][hLock] = 1;
							GameTextForPlayer(playerid, "~w~Door ~r~Locked", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
                                                 	new str22[120];
	format(str22,120,"Hosue owned by %s id %d, player house %d si %d",HouseInfo[h][hOwner], h, PlayerInfo[playerid][pPhousekey],PlayerInfo[ReturnUser(HouseInfo[h][hOwner])][pPhousekey]);
	SendClientMessage(playerid,-1,str22);
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (PlayerToPoint(3, playerid,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]) || PlayerToPoint(3, playerid,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]) || BizzInfo[i][bVW] == GetPlayerVirtualWorld(playerid))
				{
					if(PlayerInfo[playerid][pPbiskey] == i)
					{
						if(BizzInfo[i][bLocked] == 1)
						{
							BizzInfo[i][bLocked] = 0;
							GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(BizzInfo[i][bLocked] == 0)
						{
							BizzInfo[i][bLocked] = 1;
							GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
			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+100)
					{
						if(SBizzInfo[i][sbLocked] == 1)
						{
							SBizzInfo[i][sbLocked] = 0;
							GameTextForPlayer(playerid, "~w~Bussiness ~g~Open", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
						if(SBizzInfo[i][sbLocked] == 0)
						{
							SBizzInfo[i][sbLocked] = 1;
							GameTextForPlayer(playerid, "~w~Bussiness ~r~Closed", 5000, 6);
							PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
							return 1;
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You Dont Have A Key", 5000, 6);
						return 1;
					}
				}
			}
	    }
	    return 1;
	}

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0
41 minutes ago, AndrewTG01 said:

ok deci fii atent, modifica comanda /buyhous cu asta si spune acum ce iti da  in mesaj dupa ce ai cumparat o casa cu noua comanda

 

if(strcmp(cmd, "/buyhouse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			for(new h = 1; h < sizeof(HouseInfo); h++)
			{
				if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel])
					{
						format(string, sizeof(string), "   You must be Level %d to purchase this !", HouseInfo[h][hLevel]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(PlayerInfo[playerid][pPhousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
					{
						SendClientMessage(playerid, COLOR_WHITE, "   You already own a house, type /sellhouse if you want to buy this one !");
						return 1;
					}
					if(GetPlayerMoney(playerid) > HouseInfo[h][hValue])
					{
						PlayerInfo[playerid][pPhousekey] = h;
						HouseInfo[h][hOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoney(playerid,-HouseInfo[h][hValue]);
						PlayerPlayMusic(playerid);
						SetPlayerVirtualWorld(playerid,HouseInfo[h][hVW]);
						SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]);
						TogglePlayerControllable(playerid,0);
						SetTimerEx("FreezeTimer",3000,0,"d",playerid);
						HouseEntered[playerid] = h;
						GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door and typing /exit", 5000, 3);
						PlayerInfo[playerid][pLocal] = h;
						SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new Purchase !");
						SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new property help section !");
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateEx(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "   You don't have the cash for that !");
						return 1;
					}
				}
			}
		}
		return 1;
	}

 

 

 

 

 

 

EDIT:   vreau poza cand dai lock :|

 

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.