if ( dialogid == DIALOG_HOUSE_CONFIG && response )
{
if ( p_InHouse[ playerid ] == -1 ) return SendError( playerid, "You're not inside any house." );
if ( !strmatch( g_houseData[ p_InHouse[ playerid ] ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
DeletePVar( playerid, "gate_edititem" ); // Definitely not in the gate dialog lol
switch( listitem )
{
case 0: ShowPlayerDialog( playerid, DIALOG_HOUSE_TITLE, DIALOG_STYLE_INPUT, "{FFFFFF}Set House Title", ""COL_WHITE"Input the house title you want to change with:", "Confirm", "Back" );
case 2: ShowPlayerDialog( playerid, DIALOG_HOUSE_SET_PW, DIALOG_STYLE_INPUT, "{FFFFFF}Set House Password", ""COL_WHITE"Enter your desired house password below.\n\n"COL_GREY"Note:"COL_WHITE" You can disable it by typing \"N/A\" (without the quotation marks).", "Confirm", "Back" );
case 3: ShowHouseWeaponStorage( playerid );
case 4: ShowPlayerDialog( playerid, DIALOG_FURNITURE, DIALOG_STYLE_LIST, "{FFFFFF}Furniture", "Purchase Furniture\nSelect Furniture Easily\nSelect Furniture Manually\nSelect Furniture Nearest\n"COL_RED"Remove All Furniture", "Confirm", "Back" );
}
}
else if ( dialogid == DIALOG_HOUSE_WEAPONS )
{
if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this while you're in jail." );
if ( response )
{
if ( p_InHouse[ playerid ] == -1 ) return SendError( playerid, "You're not inside any house." );
if ( !strmatch( g_houseData[ p_InHouse[ playerid ] ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
if ( listitem > 2 && p_VIPLevel[ playerid ] < VIP_REGULAR ) return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
p_HouseWeaponAddSlot{ playerid } = listitem;
ShowPlayerDialog( playerid, DIALOG_HOUSE_WEAPONS_ADD, DIALOG_STYLE_MSGBOX, "{FFFFFF}House Weapon Storage", "{FFFFFF}Would you like to insert your current weapon into this slot?", "Insert", "Back" );
}
}
else cmd_h( playerid, "config" );
}
else if ( dialogid == DIALOG_HOUSE_WEAPONS_ADD )
{
if ( response )
{
if ( IsPlayerJailed( playerid ) ) return SendError( playerid, "You cannot use this while you're in jail." );
if ( p_InHouse[ playerid ] == -1 ) return SendError( playerid, "You're not inside any house." );
if ( !strmatch( g_houseData[ p_InHouse[ playerid ] ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
if ( IsMeleeWeapon( GetPlayerWeapon( playerid ) ) )
SendServerMessage( playerid, "You have inserted your "COL_GREY"%s"COL_WHITE" into your weapon storage.", ReturnWeaponName( current_weapon ) );
RemovePlayerWeapon( playerid, current_weapon );
SaveHouseWeaponStorage( p_InHouse[ playerid ] );
ShowHouseWeaponStorage( playerid );
}
else ShowHouseWeaponStorage( playerid );
}
else if ( dialogid == DIALOG_HOUSE_SET_PW )
{
if ( response )
{
if ( p_InHouse[ playerid ] == -1 ) return SendError( playerid, "You're not inside any house." );
else if ( !strmatch( g_houseData[ p_InHouse[ playerid ] ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
SendError( playerid, "Your password must vary between 0 and 4 characters." );
ShowPlayerDialog( playerid, DIALOG_HOUSE_SET_PW, DIALOG_STYLE_INPUT, "{FFFFFF}Set House Password", ""COL_WHITE"Enter your desired house password below.\n\n"COL_GREY"Note:"COL_WHITE" You can disable it by typing \"N/A\" or \"NULL\" (without the quotation marks).", "Confirm", "Back" );
SendServerMessage( playerid, "You have purchased a %s for "COL_GOLD"%s"COL_WHITE". This has been applied to the House ID %d.", g_houseInteriors[ intid ] [ E_NAME ], number_format( g_houseInteriors[ intid ] [ E_COST ] ), houseid );
else
SendServerMessage( playerid, "You have successfully reset your interior to the default interior." );
return SendError( playerid, "You are not the owner of this house." );
if ( ! ( 1 <= strlen( inputtext ) <= 30 ) )
return ShowPlayerDialog( playerid, DIALOG_HOUSE_TITLE, DIALOG_STYLE_INPUT, "{FFFFFF}Set House Title", ""COL_WHITE"Input the house title you want to change with:\n\n"COL_RED"Must be between 1 and 30 characters.", "Confirm", "Back" );
if ( textContainsIP( inputtext ) )
return SendError( playerid, "We do not condone advertising." );
SendServerMessage( playerid, "You have successfully changed the name of your house." );
cmd_h( playerid, "config" );
}
else cmd_h( playerid, "config" );
}
else if ( dialogid == DIALOG_HOUSE_PW && response )
{
new i = p_PasswordedHouse[ playerid ];
if ( !strlen( inputtext ) || strlen( inputtext ) > 4 || strmatch( inputtext, "N/A" ) || !strmatch( inputtext, g_houseData[ i ] [ E_PASSWORD ] ) ) ShowPlayerDialog( playerid, DIALOG_HOUSE_PW, DIALOG_STYLE_PASSWORD, "{FFFFFF}House Authentication", ""COL_GREEN"This house is password locked!\n"COL_WHITE"You may only enter this house if you enter the correct password.\n\n"COL_RED"Incorrect Password!", "Enter", "Cancel" );
else
{
if ( !IsPlayerInRangeOfPoint( playerid, 3.0, g_houseData[ i ] [ E_EX ], g_houseData[ i ] [ E_EY ], g_houseData[ i ] [ E_EZ ] ) ) return SendError( playerid, "You are not near the house entrance!" );
SendServerMessage( playerid, "Password correct. Access has been granted." );
p_InHouse[ playerid ] = i;
SetPlayerPos( playerid, g_houseData[ i ] [ E_TX ], g_houseData[ i ] [ E_TY ], g_houseData[ i ] [ E_TZ ] );
SetPlayerVirtualWorld( playerid, g_houseData[ i ] [ E_WORLD ] );
SetPlayerInterior( playerid, g_houseData[ i ] [ E_INTERIOR_ID ] );
}
}
return 1;
}
/* ** Commands ** */
CMD:bruteforce( playerid, params[ ] )
{
/* ** ANTI SPAM ** */
if ( GetPVarInt( playerid, "last_bruteforce" ) > g_iTime ) return SendError( playerid, "You must wait 30 seconds before using this command again." );
/* ** END OF ANTI SPAM ** */
if ( p_Class[ playerid ] != CLASS_POLICE ) return SendError( playerid, "This command is restricted for F.B.I agents." );
return SendError( playerid, "Please renew your V.I.P or sell this home to match your house allocated limit (/h sell)." );
}
new
ID = p_InHouse[ playerid ],
query[ 140 ]
;
if ( strmatch( params, "spawn" ) )
{
SendServerMessage( playerid, "We have changed the command to simply "COL_GREY"/spawn"COL_WHITE"." );
return ShowPlayerSpawnMenu( playerid );
}
else if ( strmatch( params, "config" ) )
{
if ( ID == -1 ) return SendError( playerid, "You're not in any house." );
else if ( !strmatch( g_houseData[ ID ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
else
{
ShowPlayerDialog( playerid, DIALOG_HOUSE_CONFIG, DIALOG_STYLE_LIST, "{FFFFFF}House Configuration", "Set House Title\nUpgrade Interior\nSet House Password\nWeapon Storage\nFurniture", "Select", "Cancel" );
}
return 1;
}
else if ( strmatch( params, "buy" ) )
{
if ( p_OwnedHouses[ playerid ] >= GetPlayerHouseSlots( playerid ) ) return SendError( playerid, "You cannot purchase any more houses, you've reached the limit." );
if ( GetPlayerScore( playerid ) < 200 ) return SendError( playerid, "You need at least 200 score to buy a house." );
foreach ( new i : houses )
{
if ( IsPlayerInDynamicCP( playerid, g_houseData[ i ] [ E_CHECKPOINT ] [ 0 ] ) || ( ID != -1 && ID == i ) )
{
if ( strmatch( g_houseData[ i ] [ E_OWNER ], "No-one" ) )
{
if ( GetPlayerCash( playerid ) < g_houseData[ i ] [ E_COST ] )
return SendError( playerid, "You don't have enough money to purchase this house." );
if ( g_houseData[ i ] [ E_COST ] == 1337 && !p_VIPLevel[ playerid ] )
return SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
SendServerMessage( playerid, "You have bought this home for "COL_GOLD"%s"COL_WHITE"!", number_format( g_houseData[ i ] [ E_COST ] ) );
SetHouseOwner( i, ReturnPlayerName( playerid ) );
p_OwnedHouses[ playerid ] ++;
return 1;
}
else return SendError( playerid, "This house isn't for sale." );
}
}
return SendError( playerid, "You are not around any house entrances." );
}
else if ( strmatch( params, "sell" ) )
{
if ( ID == -1 ) return SendError( playerid, "You're not in any house." );
else if ( !strmatch( g_houseData[ ID ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
g_houseData[ ID ] [ E_CHECKPOINT ] [ 1 ] = CreateDynamicCP( g_houseData[ ID ] [ E_TX ], g_houseData[ ID ] [ E_TY ], g_houseData[ ID ] [ E_TZ ], 1.0, g_houseData[ ID ] [ E_WORLD ], g_houseData[ ID ] [ E_INTERIOR_ID ], -1, 50.0 );
SetPlayerPos( playerid, g_houseData[ ID ] [ E_EX ], g_houseData[ ID ] [ E_EY ], g_houseData[ ID ] [ E_EZ ] );
DestroyDynamicMapIcon( g_houseData[ ID ] [ E_MAP_ICON ] );
SetPlayerInterior( playerid, 0 );
SetPlayerVirtualWorld( playerid, 0 );
SendServerMessage( playerid, "You have successfully sold your house for "COL_GOLD"%s", number_format( ( g_houseData[ ID ] [ E_COST ] / 2 ) ) );
}
return 1;
}
else if ( strmatch( params, "offer cancel" ) )
{
new
bool: bResults = false;
foreach(new i : Player)
{
if ( p_HouseOfferer[ i ] == playerid )
{
bResults = true;
p_HouseOfferer [ i ] = INVALID_PLAYER_ID;
p_HouseOfferTicks [ i ] = 0;
p_HouseSellingID [ i ] = 0;
p_HouseSellingPrice [ i ] = 0;
}
}
if ( bResults )
return SendServerMessage( playerid, "You have successfully canceled all house offers you have made to players." );
return SendError( playerid, "You have not made any house offers to anybody." );
}
else if ( strmatch( params, "offer take" ) )
{
new
houseid = p_HouseSellingID[ playerid ],
sellerid = p_HouseOfferer[ playerid ],
sellingprice = p_HouseSellingPrice[ playerid ]
;
if ( !IsPlayerConnected( sellerid ) ) SendError( playerid, "The person who offered you a house is no longer online." );
else if ( p_HouseOfferTicks[ playerid ] < g_iTime ) SendError( playerid, "This house offer has expired %d seconds ago.", g_iTime - p_HouseOfferTicks[ playerid ] );
else if ( GetPlayerCash( playerid ) < p_HouseSellingPrice[ playerid ] ) SendError( playerid, "You do not have enough money to accept this offer (%s).", number_format( p_HouseSellingPrice[ playerid ] ) );
else if ( g_houseData[ houseid ] [ E_COST ] <= 1337 && !p_VIPLevel[ playerid ] ) SendError( playerid, "You are not a V.I.P, to become one visit "COL_GREY"donate.sfcnr.com" );
else if ( p_OwnedHouses[ playerid ] >= GetPlayerHouseSlots( playerid ) ) SendError( playerid, "You cannot purchase any more houses, you've reached the limit." );
SendServerMessage( sellerid, "You have successfully sold your house for "COL_GOLD"%s"COL_WHITE" to %s(%d)!", number_format( p_HouseSellingPrice[ playerid ] ), ReturnPlayerName( playerid ), playerid );
SendServerMessage( playerid, "You have successfully bought %s(%d)'s home for "COL_GOLD"%s"COL_WHITE"!", ReturnPlayerName( sellerid ), sellerid, number_format( p_HouseSellingPrice[ playerid ] ) );
if ( ID == -1 ) return SendError( playerid, "You're not in any house." );
else if ( !strmatch( g_houseData[ ID ] [ E_OWNER ], ReturnPlayerName( playerid ) ) ) return SendError( playerid, "You are not the owner of this house." );
else if ( !IsPlayerConnected( offerid ) ) return SendError( playerid, "This player is not connected." );
else if ( offerid == playerid ) return SendError( playerid, "You cannot make a house offer to yourself." );
else if ( price > 30000000 ) return SendError( playerid, "The maximum amount you can sell a house for is $30,000,000." );
else if ( price < g_houseData[ ID ] [ E_COST ] / 2 ) return SendError( playerid, "You cannot sell your house to somebody for less than half its cost." );
else if ( GetDistanceBetweenPlayers( playerid, offerid ) > 4.0 ) return SendError( playerid, "You cannot send offers to players who are not near you." );
else if ( p_HouseOfferTicks[ offerid ] > g_iTime ) return SendError( playerid, "Please wait %d seconds to make an house price offer to this player again.", p_HouseOfferTicks[ offerid ] - g_iTime );
else if ( g_houseData[ ID ] [ E_COST ] <= 1337 && !p_VIPLevel[ offerid ] ) return SendError( playerid, "You cannot offer V.I.P homes to sell to regular players." );
else if ( p_OwnedHouses[ offerid ] >= GetPlayerHouseSlots( offerid ) ) return SendError( playerid, "This player cannot purchase any more houses, they have reached the limit." );
else
{
// Cannot sell to non vip vip homes k
p_HouseOfferer[ offerid ] = playerid;
p_HouseOfferTicks[ offerid ] = g_iTime + 15;
p_HouseSellingID[ offerid ] = ID;
p_HouseSellingPrice[ offerid ] = price;
SendServerMessage( offerid, "%s(%d) wishes to offer his house (id %d) for %s to you. Use "COL_GREY"/h offer take"COL_WHITE" to take the offer.", ReturnPlayerName( playerid ), playerid, ID, number_format( price ) );
SendServerMessage( playerid, "You have offered %s(%d) %s for your house (id %d), cancel the offer with "COL_GREY"/h offer cancel"COL_WHITE".", ReturnPlayerName( offerid ), offerid, number_format( price ), ID );