Help with /find command
#1

I maked some changes on /find command and i add this :
Код:
for(new h = 0; h < sizeof(HouseInfo); h++)
					{
				    	if(PlayerInfo[playerid][pIsAtHouse] == 0)
						{
							new Float:X,Float:Y,Float:Z;
							GetPlayerPos(giveplayerid, X,Y,Z);
							SetPlayerCheckpoint(playerid, X,Y,Z, 6);
						}
						else if(PlayerInfo[playerid][pIsAtHouse] >= 1)
						{
							SetPlayerCheckpoint(giveplayerid, HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex], 6);
      					}
      				}
if player is in house the checkpoint appear at the entranceX,Y,Z and if player is not in house the player appear normaly. But i have a problem the normal way works but when im in house the checkpoint appear wrong. I need this fast....
Reply
#2

up...
Reply
#3

I assume the house ID the player is in is stored in PlayerInfo[playerid][pIsAtHouse]?

Then you don't need a loop!
pawn Код:
if(!PlayerInfo[playerid][pIsAtHouse])
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerCheckpoint(playerid, X,Y,Z, 6);
}
else
{
    new h = PlayerInfo[playerid][pIsAtHouse];
    SetPlayerCheckpoint(playerid, HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex], 6);
}
Or, I don't understand what you mean at all
Reply
#4

Well, or you just can check if player2 is not in the same interior as the player that has executed the /find command.

pawn Код:
if(GetPlayerInterior(playerid) == GetPlayerInterior(playerid2))
{
   return SendClientMessage(playerid, COLOR_RED, "This player is currently inside a store or apartment.");
}
Change the (playerid2) into the variable in which the second playerid is saved.
Reply
#5

Quote:
Originally Posted by AndreT
Посмотреть сообщение
I assume the house ID the player is in is stored in PlayerInfo[playerid][pIsAtHouse]?

Then you don't need a loop!
pawn Код:
if(!PlayerInfo[playerid][pIsAtHouse])
{
    new Float:X,Float:Y,Float:Z;
    GetPlayerPos(giveplayerid, X,Y,Z);
    SetPlayerCheckpoint(playerid, X,Y,Z, 6);
}
else
{
    new h = PlayerInfo[playerid][pIsAtHouse];
    SetPlayerCheckpoint(playerid, HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex],HouseInfo[h][hEntrancex], 6);
}
Or, I don't understand what you mean at all
I assume the house ID the player is in is stored in PlayerInfo[playerid][pIsAtHouse] - True... but is not working when im in a house the checkpoint appear in LV Airport and the entrace of the house is in LS..

Quote:
Originally Posted by Improvement™
Посмотреть сообщение
Well, or you just can check if player2 is not in the same interior as the player that has executed the /find command.

pawn Код:
if(GetPlayerInterior(playerid) == GetPlayerInterior(playerid2))
{
   return SendClientMessage(playerid, COLOR_RED, "This player is currently inside a store or apartment.");
}
Change the (playerid2) into the variable in which the second playerid is saved.
I don't understand that :-s i want to put a checkpoint of the entrance if player is in house, not sendclientmessage...
Reply
#6

up... no one can help me ?
Reply
#7

I don't understand you, why would you even want to find a person in a home, just make it return SendClientMessage(playerid, 0xFFFFFF, "This person is inside a home.");
It's never going to give you a good accurate position if they're inside an interior.
Reply
#8

I wanna make it for cops.. when a player have wanted and he enter in house and the cops have /ram command and if the checkpoint appear at house entrance this will be more easy for cops...
Reply
#9

Do you have ID for your each house?
Reply
#10

hmm no, but the id i think can be IsAtHouse or Virtual World
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)