Find House
#1

Hello,
I Have Make A Dynamic House System Thats Create A House with enter and exit + furniture system + house storage system but i have get a problem with creating a cmd thats locate the house like /findhouse <ID>

Just to let you know thats there is a pickup and labels created in the house Exterior

If You Can Help me with thats i will be soo Glad
Reply
#2

How did you try to make the order so far?
Reply
#3

Код:
CMD:findhouse(playerid,params[])
{
New id;
If(scanf....);
CreateCP(houseinfo[id][x], ...[y], ...[z]);
Return 1;
}
Sorry for shortening my stuff I'm using my phone to make this post. Your command should look something like that.
Reply
#4

Just Get the Coordinates of the house Exterior using the House ID and simply just create a checkpoint at the position.
Reply
#5

Quote:
Originally Posted by Akeem
Посмотреть сообщение
Код:
CMD:findhouse(playerid,params[])
{
New id;
If(scanf....);
CreateCP(houseinfo[id][x], ...[y], ...[z]);
Return 1;
}
Sorry for shortening my stuff I'm using my phone to make this post. Your command should look something like that.
Sorry But I Haven't Understand What I Need To Put In The .... More Help Please
Quote:
Originally Posted by GTLS
Посмотреть сообщение
Just Get the Coordinates of the house Exterior using the House ID and simply just create a checkpoint at the position.
How Can I Get The Coordinations of the house Exterior ?
Reply
#6

i will give you some parts thats will help

Quote:

forward OnAdminCreateHouse(playerid, houseid, type, Float, Float:y, Float:z, Float:angle);
public OnAdminCreateHouse(playerid, houseid, type, Float, Float:y, Float:z, Float:angle)
{
strcpy(HouseInfo[houseid][hOwner], "Nobody", MAX_PLAYER_NAME);

HouseInfo[houseid][hExists] = 1;
HouseInfo[houseid][hID] = cache_insert_id(connectionID);
HouseInfo[houseid][hOwnerID] = 0;
HouseInfo[houseid][hType] = type;
HouseInfo[houseid][hPrice] = houseInteriors[type][intPrice];
HouseInfo[houseid][hRentPrice] = 0;
HouseInfo[houseid][hLevel] = 1;
HouseInfo[houseid][hLocked] = 0;
HouseInfo[houseid][hPosX] = x;
HouseInfo[houseid][hPosY] = y;
HouseInfo[houseid][hPosZ] = z;
HouseInfo[houseid][hPosA] = angle;
HouseInfo[houseid][hIntX] = houseInteriors[type][intX];
HouseInfo[houseid][hIntY] = houseInteriors[type][intY];
HouseInfo[houseid][hIntZ] = houseInteriors[type][intZ];
HouseInfo[houseid][hIntA] = houseInteriors[type][intA];
HouseInfo[houseid][hInterior] = houseInteriors[type][intID];
HouseInfo[houseid][hWorld] = HouseInfo[houseid][hID] + 1000000;
HouseInfo[houseid][hOutsideInt] = GetPlayerInterior(playerid);
HouseInfo[houseid][hOutsideVW] = GetPlayerVirtualWorld(playerid);
HouseInfo[houseid][hCash] = 0;
HouseInfo[houseid][hMaterials] = 0;
HouseInfo[houseid][hWeed] = 0;
HouseInfo[houseid][hCocaine] = 0;
HouseInfo[houseid][hMeth] = 0;
HouseInfo[houseid][hPainkillers] = 0;
HouseInfo[houseid][hHPAmmo] = 0;
HouseInfo[houseid][hPoisonAmmo] = 0;
HouseInfo[houseid][hFMJAmmo] = 0;
HouseInfo[houseid][hLabels] = 0;
HouseInfo[houseid][hText] = Text3D:INVALID_3DTEXT_ID;
HouseInfo[houseid][hPickup] = -1;

Soo How Can We Get The hPickup Coordinations ?
Reply
#7

PHP код:
CMD:findhouse(playeridparams[])
{
    new 
houseid;
    if(
sscanf(params,"i",houseid)) return SendClientMessage(playerid, -1"Use: /findhouse [id]");
    
SetPlayerCheckpoint(playeridHouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ] , 5.0)
    return 
1;

you can improve your order if you need to display something else.
it's not tested.
Reply
#8

Not tested but give it a try.

PHP код:
COMMAND:findhouse(playeridparams[])
{
    new 
fhouse;
    if( 
sscanf params"d"fhouse)) return SCP(playerid"[house ID]");
    
SetPlayerCheckpoint(playeridHouseInfo[fhouse][hPosX], HouseInfo[fhouse][hPosY], HouseInfo[fhouse][hPosZ], 2);
    
SendClientMSG(playeridCOLOR_YELLOW"Marker has been set to house with the number %d."fhouse);
    return 
1;

Reply
#9

Thanks And About SCP How I Need To Define it ?
#Define SCP ?
Reply
#10

SCP isjust like SendClientMessage.

You can change it to

PHP код:
return SendClientMessage(playerid, -1"[house ID]"); 
or add this to your script

PHP код:
stock SCP(_id_param[], _command[] = "")
{
    
format(iStrsizeof(iStr), "[Command]: /%s {9c9a9c}%s"_command_param);
    return 
SendPlayerMessage(_id0x6A696AFFiStr"[Command]: / {9c9a9c}"128);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)