Adress house problem -
Adrianos - 09.02.2016
Hello . I have problems in script . I want to create a adresss for houses . this is the line . i want to use GetPlayer2DZone , but i don't now how is use .
in this line .
Код:
format(string,sizeof(string)," {0099FF}Owner: {FFFFFF}%s \n {0099FF}Adress: {FFFFFF}%d \n {0099FF}Description: {FFFFFF}%s",ApartmentInfo[s][sOwner],GetPlayer2DZone, ApartmentInfo[s][sDescription]);
ApartmentLabel[s] = Create3DTextLabel(string ,0x00FFFFFF,ApartmentInfo[s][sEnterx], ApartmentInfo[s][sEntery], ApartmentInfo[s][sEnterz]+0.5,35, 0, 1);
helpp
Re: Adress house problem -
Adrianos - 09.02.2016
helpp
Re: Adress house problem -
ikey07 - 09.02.2016
GetPlayer2DZone usage is like this
new zone[32],string[64];
GetPlayer2DZone(playerid,zone,sizeof(zone));
format(string,sizeof(string),"You are in %s",zone);
SendClientMessage(playerid,0xFFFFFFFF,string);
Re: Adress house problem -
Adrianos - 09.02.2016
i want to introduce adress in this script but i dont know .
Код:
for(new s = 0; s < sizeof(ApartmentInfo); s++)
{
new zone[32];
GetPlayer2DZone(playerid,zone,sizeof(zone));
new gFile[35];
format(gFile, 35, "Apartments/%d.ini" ,s);
INI_ParseFile(gFile, "LoadApartments", .bExtra = true, .extra = s);
if(ApartmentInfo[s][sCreated] == 1)
{
if(ApartmentInfo[s][sOwned] == 0)
{
format(string,sizeof(string),"{0099FF}For Sale! \n {0099FF}Adress: {FFFFFF}%d \n {0099FF}Price: {FFFFFF}$%d\n {0099FF}Level: {FFFFFF}%d \n {0099FF}Description: {FFFFFF}%s",zone, ApartmentInfo[s][sPrice],ApartmentInfo[s][sLevel], ApartmentInfo[s][sDescription]);
ApartmentLabel[s] = Create3DTextLabel(string ,0x00FFFFFF,ApartmentInfo[s][sEnterx], ApartmentInfo[s][sEntery], ApartmentInfo[s][sEnterz]+0.5,35, 0, 1);
ApartmentPickup[s] = CreateDynamicPickup(1273, 1, ApartmentInfo[s][sEnterx], ApartmentInfo[s][sEntery], ApartmentInfo[s][sEnterz]);
}
if(ApartmentInfo[s][sOwned] == 1)
{
format(string,sizeof(string)," {0099FF}Owner: {FFFFFF}%s \n {0099FF}Adress: {FFFFFF}%d \n {0099FF}Description: {FFFFFF}%s",ApartmentInfo[s][sOwner],zone, ApartmentInfo[s][sDescription]);
ApartmentLabel[s] = Create3DTextLabel(string ,0x00FFFFFF,ApartmentInfo[s][sEnterx], ApartmentInfo[s][sEntery], ApartmentInfo[s][sEnterz]+0.5,35, 0, 1);
ApartmentPickup[s] = CreateDynamicPickup(1239, 1, ApartmentInfo[s][sEnterx], ApartmentInfo[s][sEntery], ApartmentInfo[s][sEnterz]);
}
}
}
Re: Adress house problem -
ikey07 - 09.02.2016
You want address to be numeric or just location(zone) where its located?
On my server, I used that address is 3001+Houseid
example format(string,sizeof(string),"Address: %d",3001+s);
which would output "Address: 3001" for house id 0 and "Address: 3002" for house id 1 and so on, it looks nice and player can use GPS by an address, not entering house id or something, like /gps [address] >> /gps 3001 , then in the cmd gpsid = [user input - 3001] and it will enable GPS to house id 0.
I hope it made a sense.