SA-MP Forums Archive
Find House - 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)
+--- Thread: Find House (/showthread.php?tid=656592)



Find House - S3DOx - 19.07.2018

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


Re: Find House - Florin48 - 19.07.2018

How did you try to make the order so far?


Re: Find House - Akeem - 19.07.2018

Код:
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.


Re: Find House - GTLS - 19.07.2018

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


Re: Find House - S3DOx - 19.07.2018

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 ?


Re: Find House - S3DOx - 19.07.2018

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 ?


Re: Find House - Florin48 - 19.07.2018

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.


Re: Find House - AzaMx - 19.07.2018

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;




Re: Find House - S3DOx - 19.07.2018

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


Re: Find House - AzaMx - 19.07.2018

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);