Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //==============================================================================
- #include <a_samp>
- #include <dini>
- #include <streamer>
- #include <zcmd>
- #include <sscanf>
- //==============================================================================
- #define MAX_HOUSES 500
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define loop(%0,%1,%2) for(new %0 = %2; %0 < %1; %0++)
- //==============================================================================
- enum Info {
- Target,
- Owner[MAX_PLAYERS],
- Price,
- Pickup,
- Text3D:Label,
- Mapicon
- }
- //------------------------------------------------------------------------------
- new House[MAX_HOUSES][Info];
- new Float:Entrance[MAX_HOUSES][3],
- Float:Extrance[MAX_PLAYERS][3],
- Inside[MAX_HOUSES][2],
- Outside[MAX_HOUSES][2],
- Home[MAX_PLAYERS];
- new HouseCount[MAX_PLAYERS];
- //==============================================================================
- public OnFilterScriptInit()
- {
- //--------------------------------------------------------------------------
- CreateDynamicPickup(1318, 1, 2282.9744, -1140.2855, 1050.8984, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2196.8511, -1204.3903, 1049.0234, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2233.6482, -1115.2621, 1050.8828, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2218.4036, -1076.2433, 1050.4844, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2496.0659, -1692.0844, 1014.7422, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2365.2371, -1135.5989, 1050.8826, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2317.7810, -1026.7635, 1050.2178, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 2324.41, -1149.54, 1050.71, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 140.28, 1365.92, 1083.85, -1, -1, -1);
- CreateDynamicPickup(1318, 1, 1260.6603, -785.4005, 1091.9063, -1, -1, -1);
- //--------------------------------------------------------------------------
- new file[MAX_PLAYERS], string[MAX_PLAYERS];
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- format(file, sizeof(file), "Houses/%d.ini", i);
- if(!fexist(file)) return 0;
- Entrance[i][0] = dini_Float(file, "Enter_House_One");
- Entrance[i][1] = dini_Float(file, "Enter_House_Two");
- Entrance[i][2] = dini_Float(file, "Enter_House_Three");
- Inside[i][0] = dini_Int(file, "Inside_House_One");
- Inside[i][1] = dini_Int(file, "Inside_House_Two");
- Outside[i][0] = dini_Int(file, "Outside_House_One");
- Outside[i][1] = dini_Int(file, "Outside_House_Two");
- House[i][Target] = dini_Int(file, "Target_Of_House");
- // strcat(House[i][Owner], dini_Get(file, "Owner_Of_House"));
- format(House[i][Owner], MAX_PLAYER_NAME, "%s", dini_Get(file, "Owner_Of_House"));
- House[i][Price] = dini_Int(file, "Price_Of_House");
- if(House[i][Target] >= 1)
- {
- House[i][Pickup] = CreateDynamicPickup(19522, 1, Entrance[i][0], Entrance[i][1], Entrance[i][2], -1, -1, -1, 50.0);
- format(string, sizeof(string), "{FFFFFF}Owner: %s\nPrice: $%d\nLevel: %d\nHouse: %d", House[i][Owner], House[i][Price], Inside[i][0], i);
- House[i][Label] = CreateDynamic3DTextLabel(string, 0xFFFFFFAA, Entrance[i][0], Entrance[i][1], Entrance[i][2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 10.0);
- House[i][Mapicon] = CreateDynamicMapIcon(Entrance[i][0], Entrance[i][1], Entrance[i][2], 32, -1, -1, -1, -1, 100.0);
- } else {
- House[i][Pickup] = CreateDynamicPickup(1273, 1, Entrance[i][0], Entrance[i][1], Entrance[i][2], -1, -1, -1, 50.0);
- format(string, sizeof(string), "{FFFFFF}Owner: Unknown\nPrice: $%d\nLevel: %d\nHouse: %d", House[i][Price], Inside[i][0], i);
- House[i][Label] = CreateDynamic3DTextLabel(string, 0xFFFFFFAA, Entrance[i][0], Entrance[i][1], Entrance[i][2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 10.0);
- House[i][Mapicon] = CreateDynamicMapIcon(Entrance[i][0], Entrance[i][1], Entrance[i][2], 31, -1, -1, -1, -1, 100.0);
- }
- //
- }
- //--------------------------------------------------------------------------
- return 1;
- }
- //==============================================================================
- public OnFilterScriptExit()
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerConnect(playerid)
- {
- new file[MAX_PLAYERS];
- //==========================================================================
- Extrance[playerid][0] = 0;
- Extrance[playerid][1] = 0;
- Extrance[playerid][2] = 0;
- //==========================================================================
- Home[playerid] = 0;
- //==========================================================================
- format(file, sizeof(file), "Houses/Owners/%s.ini", IsPlayerName(playerid));
- if(!fexist(file))
- {
- dini_IntSet(file, "Count_House_You_Have", 0);
- HouseCount[playerid] = dini_Int(file, "Count_House_You_Have");
- } else {
- HouseCount[playerid] = dini_Int(file, "Count_House_You_Have");
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerDisconnect(playerid, reason)
- {
- //==========================================================================
- Extrance[playerid][0] = 0;
- Extrance[playerid][1] = 0;
- Extrance[playerid][2] = 0;
- //==========================================================================
- Home[playerid] = 0;
- //
- new file[MAX_PLAYERS];
- format(file, sizeof(file), "Houses/Owners/%s.ini", IsPlayerName(playerid));
- dini_IntSet(file, "Count_House_You_Have", HouseCount[playerid]);
- //==========================================================================
- return 1;
- }
- //==============================================================================
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- //==============================================================================
- stock IsPlayerName(playerid)
- {
- new name[MAX_PLAYERS];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- //------------------------------------------------------------------------------
- cmd(createhouse, playerid, params[])
- {
- //--------------------------------------------------------------------------
- new discount, level, Float:x, Float:y, Float:z, string[MAX_PLAYERS], i = GetFreeHouseModel(), file[MAX_PLAYERS];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not a rcon administrator");
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}Error: You're in a vehicle?");
- if(sscanf(params, "dd", discount, level)) return SendClientMessage(playerid, -1, "{FF0000}Error: /createhouse [price] [level]");
- if(discount < 100 || discount > 10000) return SendClientMessage(playerid, -1, "{FF0000}Error: Invalid house discount price [100 - 100000]");
- if(level < 0 || level > 10) return SendClientMessage(playerid, -1, "{FF0000}Error: Invalid house interior level [1 - 10]");
- GetPlayerPos(playerid, x, y, z);
- //
- Entrance[i][0] = x;
- Entrance[i][1] = y;
- Entrance[i][2] = z;
- Inside[i][0] = level;
- Inside[i][1] = i;
- Outside[i][0] = GetPlayerInterior(playerid);
- Outside[i][1] = GetPlayerVirtualWorld(playerid);
- House[i][Target] = 0;
- format(House[i][Owner], MAX_PLAYER_NAME, "%s", "Unknown");
- House[i][Price] = discount;
- //
- format(file, sizeof(file), "Houses/%d.ini", i);
- dini_Create(file);
- dini_FloatSet(file, "Enter_House_One", Entrance[i][0]);
- dini_FloatSet(file, "Enter_House_Two", Entrance[i][1]);
- dini_FloatSet(file, "Enter_House_Three", Entrance[i][2]);
- dini_IntSet(file, "Inside_House_One", Inside[i][0]);
- dini_IntSet(file, "Inside_House_Two", Inside[i][1]);
- dini_IntSet(file, "Outside_House_One", Outside[i][0]);
- dini_IntSet(file, "Outside_House_Two", Outside[i][0]);
- dini_IntSet(file, "Target_Of_House", House[i][Target]);
- dini_Set(file, "Owner_Of_House", House[i][Owner]);
- dini_IntSet(file, "Price_Of_House", House[i][Price]);
- //
- House[i][Pickup] = CreateDynamicPickup(1273, 1, Entrance[i][0], Entrance[i][1], Entrance[i][2], -1, -1, -1, 50.0);
- format(string, sizeof(string), "{FFFFFF}Owner: %s\nPrice: $%d\nLevel: %d\nHouse: %d", House[i][Owner], House[i][Price], Inside[i][0], i);
- House[i][Label] = CreateDynamic3DTextLabel(string, 0xFFFFFFAA, Entrance[i][0], Entrance[i][1], Entrance[i][2], 50.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 1, -1, -1, -1, 10.0);
- House[i][Mapicon] = CreateDynamicMapIcon(Entrance[i][0], Entrance[i][1], Entrance[i][2], 31, -1, -1, -1, -1, 100.0);
- format(string, sizeof(string), "{FFFFFF}|» You have been created this house [Model: %d - Level: %d - Price: $%d] «|", i, Inside[i][0], House[i][Price]);
- SendClientMessage(playerid, -1, string);
- //--------------------------------------------------------------------------
- return 1;
- }
- //==============================================================================
- stock GetFreeHouseModel()
- {
- //--------------------------------------------------------------------------
- new file[MAX_PLAYERS];
- loop(h, MAX_HOUSES, 0)
- {
- format(file, sizeof(file), "Houses/%d.ini", h);
- if(!fexist(file))
- {
- return h;
- }
- }
- //--------------------------------------------------------------------------
- return -1;
- }
- //==============================================================================
- cmd(removehouse, playerid, params[])
- {
- //--------------------------------------------------------------------------
- new string[MAX_PLAYERS], file[MAX_PLAYERS];
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}Error: You are not a rcon administrator");
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, Entrance[i][0], Entrance[i][1], Entrance[i][2]))
- {
- format(string, sizeof(string), "{FFFFFF}|» You have been removed this house [Model: %d] «|", i);
- SendClientMessage(playerid, -1, string);
- DestroyDynamicMapIcon(House[i][Mapicon]);
- DestroyDynamicPickup(House[i][Pickup]);
- DestroyDynamic3DTextLabel(House[i][Label]);
- //
- Entrance[i][0] = 0;
- Entrance[i][1] = 0;
- Entrance[i][2] = 0;
- Inside[i][0] = 0;
- Inside[i][1] = 0;
- Outside[i][0] = 0;
- Outside[i][1] = 0;
- House[i][Target] = 0;
- House[i][Owner] = 0;
- House[i][Price] = 0;
- format(file, sizeof(file), "Houses/%d.ini", i);
- dini_Remove(file);
- }
- }
- //--------------------------------------------------------------------------
- return 1;
- }
- //==============================================================================
- public OnPlayerUpdate(playerid)
- {
- //--------------------------------------------------------------------------
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, Entrance[i][0], Entrance[i][1], Entrance[i][2]))
- {
- if(House[i][Target] == 1)
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_YES~ to enter this house", 3000, 3);
- } else {
- GameTextForPlayer(playerid, "~w~press ~k~~SNEAK_ABOUT~ to buy this house", 3000, 3);
- }
- }
- }
- //--------------------------------------------------------------------------
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2282.9744, -1140.2855, 1050.8984))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2196.8511, -1204.3903, 1049.0234))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2233.6482, -1115.2621, 1050.8828))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2218.4036, -1076.2433, 1050.4844))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2496.0659, -1692.0844, 1014.7422))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2365.2371, -1135.5989, 1050.8826))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2317.7810, -1026.7635, 1050.2178))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2324.41, -1149.54, 1050.71))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 140.28, 1365.92, 1083.85))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 1260.6603, -785.4005, 1091.9063))
- {
- GameTextForPlayer(playerid, "~w~press ~k~~CONVERSATION_NO~ to exit this house", 3000, 3);
- }
- //--------------------------------------------------------------------------
- return 1;
- }
- //==============================================================================
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PRESSED(KEY_YES))
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- //------------------------------------------------------------------
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- Extrance[playerid][0] = x, Extrance[playerid][1] = y, Extrance[playerid][2] = z;
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- if(Home[playerid] == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, Entrance[i][0], Entrance[i][1], Entrance[i][2]))
- {
- if(House[i][Target] == 1)
- {
- // if(strcmp(IsPlayerName(playerid), House[i][Owner]) != 0)
- if(!strcmp(House[i][Owner], IsPlayerName(playerid), true))
- {
- if(Inside[i][0] == 1)
- {
- SetPlayerPos(playerid, 2283.0632, -1136.9760, 1050.8984);
- SetPlayerFacingAngle(playerid, 358.7963);
- SetPlayerInterior(playerid, 11);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 2)
- {
- SetPlayerPos(playerid, 2193.9001, -1202.4185, 1049.0234);
- SetPlayerFacingAngle(playerid, 91.9386);
- SetPlayerInterior(playerid, 6);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 3)
- {
- SetPlayerPos(playerid, 2233.6057, -1111.7039, 1050.8828);
- SetPlayerFacingAngle(playerid, 2.9124);
- SetPlayerInterior(playerid, 5);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 4)
- {
- SetPlayerPos(playerid, 2214.8909, -1076.0967, 1050.4844);
- SetPlayerFacingAngle(playerid, 88.8910);
- SetPlayerInterior(playerid, 1);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 5)
- {
- SetPlayerPos(playerid, 2495.8035, -1695.0997, 1014.7422);
- SetPlayerFacingAngle(playerid, 181.9661);
- SetPlayerInterior(playerid, 3);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 6)
- {
- SetPlayerPos(playerid, 2365.2883, -1132.5228, 1050.8750);
- SetPlayerFacingAngle(playerid, 358.0393);
- SetPlayerInterior(playerid, 8);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 7)
- {
- SetPlayerPos(playerid, 2320.0730, -1023.9533, 1050.2109);
- SetPlayerFacingAngle(playerid, 358.4915);
- SetPlayerInterior(playerid, 9);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 8)
- {
- SetPlayerPos(playerid, 2324.4490, -1145.2841, 1050.7101);
- SetPlayerFacingAngle(playerid, 357.5873);
- SetPlayerInterior(playerid, 12);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 9)
- {
- SetPlayerPos(playerid, 140.1788, 1369.1936, 1083.8641);
- SetPlayerFacingAngle(playerid, 359.2263);
- SetPlayerInterior(playerid, 5);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- //
- if(Inside[i][0] == 10)
- {
- SetPlayerPos(playerid, 1264.7765, -781.2485, 1091.9063);
- SetPlayerFacingAngle(playerid, 270.6992);
- SetPlayerInterior(playerid, 5);
- SetPlayerVirtualWorld(playerid, Inside[i][1]);
- Home[playerid] = 1;
- }
- }
- }
- }
- }
- }
- }
- }
- if(PRESSED(KEY_NO))
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- if(Home[playerid] == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2282.9744, -1140.2855, 1050.8984))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2196.8511, -1204.3903, 1049.0234))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2233.6482, -1115.2621, 1050.8828))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2218.4036, -1076.2433, 1050.4844))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2496.0659, -1692.0844, 1014.7422))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2365.2371, -1135.5989, 1050.8826))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2317.7810, -1026.7635, 1050.2178))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 2324.41, -1149.54, 1050.71))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 140.28, 1365.92, 1083.85))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- //
- if(IsPlayerInRangeOfPoint(playerid, 0.5, 1260.6603, -785.4005, 1091.9063))
- {
- Home[playerid] = 0;
- SetPlayerPos(playerid, Extrance[playerid][0], Extrance[playerid][1], Extrance[playerid][2]);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- }
- }
- }
- //==========================================================================
- if(PRESSED(KEY_WALK))
- {
- new string[MAX_PLAYERS], file[MAX_PLAYERS];
- for(new i = 0; i < MAX_HOUSES; i++) {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, Entrance[i][0], Entrance[i][1], Entrance[i][2]))
- {
- if(House[i][Target] == 0)
- {
- if(HouseCount[playerid] > 7 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{FF0000}Wait, you want to buy any house for this time?");
- if(GetPlayerMoney(playerid) < House[i][Price]) return SendClientMessage(playerid, -1, "{FF0000}Error: You don't have enough money to buy this house.");
- GivePlayerMoney(playerid, -House[i][Price]);
- format(House[i][Owner], MAX_PLAYER_NAME, "%s", IsPlayerName(playerid));
- House[i][Target] = 1;
- //
- format(file, sizeof(file), "Houses/%d.ini", i);
- dini_IntSet(file, "Target_Of_House", House[i][Target]);
- dini_Set(file, "Owner_Of_House", House[i][Owner]);
- format(string, sizeof(string), "{FFFFFF}|» You have been buyed this house [Model: %d - Level: %d - Price: $%d] «|", i, Inside[i][0], House[i][Price]);
- SendClientMessage(playerid, -1, string);
- //
- HouseCount[playerid] += 1;
- DestroyDynamicPickup(House[i][Pickup]);
- House[i][Pickup] = CreateDynamicPickup(19522, 1, Entrance[i][0], Entrance[i][1], Entrance[i][2], -1, -1, -1, 50.0);
- format(string, sizeof(string), "{FFFFFF}Owner: %s\nPrice: $%d\nLevel: %d\nHouse: %d", House[i][Owner], House[i][Price], Inside[i][0], i);
- UpdateDynamic3DTextLabelText(House[i][Label], -1, string);
- DestroyDynamicMapIcon(House[i][Mapicon]);
- House[i][Mapicon] = CreateDynamicMapIcon(Entrance[i][0], Entrance[i][1], Entrance[i][2], 32, -1, -1, -1, -1, 100.0);
- } else {
- }
- } else {
- } }
- }
- //==========================================================================
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment