XYZ House Interior -
AnonScripter - 19.10.2013
how to add the XYZ coordinates of the interior in the /createhouses CMD ? any idea ?
pawn Код:
enum hInfo
{
Float:hEnterX,
Float:hEnterY,
Float:hEnterZ,
Float:hExitX,
Float:hExitY,
Float:hExitZ,
hInsideInt,
hOutsideInt,
hInsideVW,
hOutsideVW,
hOwned,
hOwner,
hPrice,
hCheckpoint,
hIcon,
hID,
}
new HouseInfo[MAX_HOUSES][hInfo];
new HouseEnterCP[MAX_HOUSES];
CMD:createhouse(playerid, params[])
{
new HID, HVW, HPrice, HInt,string[128], houseid;
new Float:x,Float:y,Float:z;
if(sscanf(params, "iiii", HID, HInt, HVW, HPrice)) return SendClientMessage(playerid, COLOR_WHITE, "/createhouse [House ID] [interior] [VW] [price]");
HouseInfo[houseid][hID] = HID;
HouseInfo[houseid][hInsideInt] = HInt;
HouseInfo[houseid][hInsideVW] = HVW;
HouseInfo[houseid][hPrice] = HPrice;
HouseInfo[houseid][hEnterX] = x;
HouseInfo[houseid][hEnterY] = y;
HouseInfo[houseid][hEnterZ] = z;
HouseInfo[houseid][hOwned] = 0;
GetPlayerPos(playerid,x,y,z);
HouseEnterCP[houseid] = CreateDynamicCP(x,y,z,1.0,-1,-1,-1,50.0);
format(string, sizeof(string), "House ID: %i\nOwner: No Owner\nPrice: $%i", HID, HPrice);
CreateDynamic3DTextLabel(string,COLOR_WHITE,x,y,z,50.0);
return 1;
}
Re: XYZ House Interior -
Scrillex - 19.10.2013
Use GetPlayerPos(playerid, X, Y, Z);
Look at my post about house help in on public how I did.
HERE
Re: XYZ House Interior -
AnonScripter - 19.10.2013
well your method doesn't show how u put the XYZ of the interior,
i want it for OnPlayerEnterDynamicCP callback
SetPlayerPos(playerid, XYZ); //of the interior
SetPlayerInterior(playerid, interior);
Re: XYZ House Interior -
rickisme - 20.10.2013
Use tools or make a command to teleport into interior you want and make command save it
like this :
pawn Код:
enum hInfo
{
Float:hEnterX,
Float:hEnterY,
Float:hEnterZ,
Float:hExitX,
Float:hExitY,
Float:hExitZ,
hInsideInt,
hOutsideInt,
hInsideVW,
hOutsideVW,
hOwned,
hOwner,
hPrice,
hCheckpoint,
hIcon,
hID,
HouseEnterCP,
HouseExitCP,
}
new HouseInfo[MAX_HOUSES][hInfo];
CMD:createhouse(playerid, params[])
{
new HID, HVW, HPrice, HInt,string[128], houseid;
new Float:x,Float:y,Float:z;
if(sscanf(params, "ii", HID, HPrice)) return SendClientMessage(playerid, COLOR_WHITE, "/createhouse [House ID] [price]");
if(HID > MAX_HOUSES) return SendClientMessage(playerid, COLOR_WHITE, "ERROR");
GetPlayerPos(playerid,x,y,z);
HouseInfo[houseid][hID] = HID;
HouseInfo[houseid][hPrice] = HPrice;
HouseInfo[houseid][hEnterX] = x;
HouseInfo[houseid][hEnterY] = y;
HouseInfo[houseid][hEnterZ] = z;
HouseInfo[houseid][hOwned] = 0;
/*
Wait ... But what/where is "houseid" ???!!! this command totally wrong (:
*/
HouseInfo[houseid][HouseEnterCP] = CreateDynamicCP(x,y,z,1.0,-1,-1,-1,50.0);
format(string, sizeof(string), "House ID: %i\nOwner: No Owner\nPrice: $%i", HID, HPrice);
CreateDynamic3DTextLabel(string,COLOR_WHITE,x,y,z,50.0);
return 1;
}
CMD:edithouseinterior(playerid, params[])
{
new HID, Float:x,Float:y,Float:z;
if(sscanf(params, "i", HID)) return SendClientMessage(playerid, COLOR_WHITE, "/edithouseinterior [House ID]");
for(new h = 0; h < MAX_HOUSES; h++)
{
if(HouseInfo[h][hID] == HID)
{
GetPlayerPos(playerid,x,y,z);
HouseInfo[h][hInsideInt] = GetPlayerInterior(playerid);
HouseInfo[h][hInsideVW] = h;
HouseInfo[h][hExitX] = x;
HouseInfo[h][hExitY] = y;
HouseInfo[h][hExitZ] = z;
HouseInfo[h][HouseExitCP] = CreateDynamicCP(x,y,z,1.0,-1,-1,-1,50.0);
}
}
return 1;
}
Re: XYZ House Interior -
TehMiles - 20.10.2013
GetPlayerInterior?
Lol.
Re: XYZ House Interior -
rickisme - 20.10.2013
Quote:
Originally Posted by TehMiles
GetPlayerInterior?
Lol.
|
What you mean ? i said teleport into interior you want and use
/edithouseinterior
command name is
/edithouseinterior not
/sethouseinterior
also if you want smart thing:
pawn Код:
CMD:sethouseinterior(playerid, params[])
{
new HID, int, Float:x,Float:y,Float:z;
if(sscanf(params, "ifffd", HID, x, y, z, int)) return SendClientMessage(playerid, COLOR_WHITE, "/sethouseinterior [House ID] [x] [y] [z] [interior]");
for(new h = 0; h < MAX_HOUSES; h++)
{
if(HouseInfo[h][hID] == HID)
{
HouseInfo[h][hInsideInt] = int;
HouseInfo[h][hInsideVW] = h;
HouseInfo[h][hExitX] = x;
HouseInfo[h][hExitY] = y;
HouseInfo[h][hExitZ] = z;
HouseInfo[h][HouseExitCP] = CreateDynamicCP(x,y,z,1.0,-1,-1,-1,50.0);
}
}
return 1;
}