SA-MP Forums Archive
Adding street name - 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: Adding street name (/showthread.php?tid=619024)



Adding street name - IndependentGaming - 12.10.2016

Hello, I would like to add an option if you change the exterior to add a street name how can I add here:

PHP код:
new string[128], choice[32], houseidamount;
    if(
sscanf(params"s[32]dD"choicehouseidamount))
    {
        
SendClientMessage(playeridCOLOR_WHITE"USAGE: /hedit [name] [houseid] [(Optional)amount]");
        
SendClientMessage(playeridCOLOR_GREY"Available names: Exterior, Interior, CustomInterior, CustomExterior, Level, Price");
        return 
1;
    } 
That I'm able to add a street name only by "exterior" ?

See option exterior:

PHP код:
else if(strcmp(choice"exterior"true) == 0)
    {
        
GetPlayerPos(playeridHouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]);
        
GetPlayerFacingAngle(playeridHouseInfo[houseid][hExteriorA]);
        
SendClientMessage(playeridCOLOR_WHITE"You have changed the exterior!");
        
DestroyPickup(HouseInfo[houseid][hPickupID]);
        
SaveHouses();
        
format(stringsizeof(string), "%s has edited HouseID %d's Exterior."GetPlayerNameEx(playerid), houseid);
        
Log("logs/hedit.log"string);
        if(
HouseInfo[houseid][hOwned] ==0)
        {
            
DestroyPickup(HouseInfo[houseid][hPickupID]);
            
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
            
format(stringsizeof(string), "This house is for sale!\n Level: %d\nID: %d\nPrice: $%d\nTo buy this house type /buyhouse",HouseInfo[houseid][hLevel],houseid,HouseInfo[houseid][hValue]);
            
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(stringCOLOR_HOUSEGREENHouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0, -1, -1, -110.0);
            
HouseInfo[houseid][hPickupID] = CreatePickup(1952423HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
        }
        else
        {
            if(
HouseInfo[houseid][hRentable] == 0)
            {
                
DestroyPickup(HouseInfo[houseid][hPickupID]);
                
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
                
format(stringsizeof(string), "House owner: %s\nLevel: %d\nID: %d",HouseInfo[houseid][hOwner],HouseInfo[houseid][hLevel],houseid);
                
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(string,COLOR_HOUSEGREEN,HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0, -1, -1, -110.0);
                
HouseInfo[houseid][hPickupID] = CreatePickup(1952223HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
            }
            else
            {
                
DestroyPickup(HouseInfo[houseid][hPickupID]);
                
DestroyDynamic3DTextLabel(HouseInfo[houseid][hTextID]);
                
format(stringsizeof(string), "House owner: %s\nLevel: %d\nID: %d\nRent: $%d\nType /rentroom to rent a room",HouseInfo[houseid][hOwner],HouseInfo[houseid][hLevel],houseid,HouseInfo[houseid][hRentFee]);
                
HouseInfo[houseid][hTextID] = CreateDynamic3DTextLabel(string,COLOR_HOUSEGREEN,HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ]+0.5,20.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0, -1, -1, -110.0);
                
HouseInfo[houseid][hPickupID] = CreatePickup(1952323HouseInfo[houseid][hExteriorX], HouseInfo[houseid][hExteriorY], HouseInfo[houseid][hExteriorZ], -1);
            }
        }
    } 
Also, how can I make a new option to only edit the street name ?


Re: Adding street name - IndependentGaming - 12.10.2016

anyone ?


Re: Adding street name - IndependentGaming - 13.10.2016

bump


Re: Adding street name - IceBilizard - 13.10.2016

PHP код:
new string[128], choice[32], houseidamount;
if(
sscanf(params"s[32]dD"choicehouseidamount))
{
    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /hedit [name] [houseid] [(Optional)amount]");
    
SendClientMessage(playeridCOLOR_GREY"Available names: Exterior, Interior, CustomInterior, CustomExterior, Level, Price, StreetName");
    return 
1;
}
else if(
strcmp(choice"StreetName"true) == 0)
{
     
//Do street stuff




IceBilizard - IndependentGaming - 13.10.2016

Quote:
Originally Posted by IceBilizard
Посмотреть сообщение
PHP код:
new string[128], choice[32], houseidamount;
if(
sscanf(params"s[32]dD"choicehouseidamount))
{
    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /hedit [name] [houseid] [(Optional)amount]");
    
SendClientMessage(playeridCOLOR_GREY"Available names: Exterior, Interior, CustomInterior, CustomExterior, Level, Price, StreetName");
    return 
1;
}
else if(
strcmp(choice"StreetName"true) == 0)
{
     
//Do street stuff

I dont have any street stuff thats kinda the problem..

anyone ?

Is there anyone who can help me with this ? I'm currently stuck..


Re: Adding street name - Mencent - 13.10.2016

Hello!

First: You should not spam the forum with your "anyone?" or something else. When you push your thread one time per day it's enough.

To your problem:
Do you want to give the house a street name which is showing then in the 3D Text label?
Then you should post your enum of HouseInfo.

When you don't know hou you save / load the street name then you should post this code too.


Re: Adding street name - IndependentGaming - 13.10.2016

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

First: You should not spam the forum with your "anyone?" or something else. When you push your thread one time per day it's enough.

To your problem:
Do you want to give the house a street name which is showing then in the 3D Text label?
Then you should post your enum of HouseInfo.

When you don't know hou you save / load the street name then you should post this code too.
I know sorry, How can I define this I have downloaded a few house filterscripts and I can't find anything how I can define it


Re: Adding street name - Mencent - 13.10.2016

Look into the filterscript and search something with "enum". When you find this and it is for the house system then show us this.
And show there if you find something about the loading and saving.


Re: Adding street name - IndependentGaming - 13.10.2016

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Look into the filterscript and search something with "enum". When you find this and it is for the house system then show us this.
And show there if you find something about the loading and saving.
Okay, I need to know where I need to define the street names I know I can define "HAddress" enum


PHP код:
enum hInfo
{
    
hOwned,
    
hLevel,
    
hHInteriorWorld,
    
hCustomInterior,
    
//hDescription[8],
    
hOwner[MAX_PLAYER_NAME],
    
FloathExteriorX,
    
FloathExteriorY,
    
FloathExteriorZ,
    
FloathExteriorR,
    
FloathExteriorA,
    
FloathInteriorX,
    
FloathInteriorY,
    
FloathInteriorZ,
    
FloathInteriorR,
    
FloathInteriorA,
    
hLock,
    
hRentable,
    
hRentFee,
    
hValue,
    
hSafeMoney,
    
hPot,
    
hCrack,
    
hMaterials,
    
hWeapons[5],
    
hGLUpgrade,
    
hPickupID,
    
Text3DhTextID,
    
hCustomExterior,
};
new 
HouseInfo[MAX_HOUSES][hInfo];