05.01.2014, 06:46
Im trying to make buy/sell faction/house system.For now i have made the /buy function but when i restart the server other players can buy the house or faction.
That is what i have done for now.
(P.S. I still suck at scripting so.. i will need your help guys )
Код:
new cityhallpropertyoffice; cityhallpropertyoffice = CreatePickup(1239, 2, 362.8641, 155.2817, 1024.7963, -1); public OnPlayerPickUpPickup(playerid, pickupid) { if(pickupid == cityhallpropertyoffice) { ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Property Office", "Faction\nHouses", "Select","Close"); } if(pickupid == accjob) if(dialogid == 6) { if(response) { if(listitem == 0) { ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Bussines","Building faction","Buy","Close"); } if(listitem == 1) { ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Houses", "House 1\nHouse 2\nHouse 3", "Buy","Close"); } } } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == 7) { if(response) { if(listitem == 0) { new INI:File = INI_Open(UserPath(playerid)); new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); if(Chars[playerid][pBusiness] == 0) { INI_SetTag(File,"data"); INI_WriteInt(File,"Business",Chars[playerid][pBusiness] = 1); INI_Close(File); Bfaction[playerid][Owner] = 1; pInfo[playerid] [pBuilding] = 1; } else { if(pInfo[playerid][pBuilding] == 1) { SendClientMessage(playerid,COLOR_RED,"This faction is allready bought from someone else"); } } } } } if(dialogid == 8) { if(response) { if(listitem == 0) { SendClientMessage(playerid,COLOR_RED, "There is no house for sale"); } if(listitem == 1) { SendClientMessage(playerid,COLOR_RED, "There is no house for sale"); } if(listitem == 2) { SendClientMessage(playerid,COLOR_RED, "There is no house for sale"); } } } return 1; }
(P.S. I still suck at scripting so.. i will need your help guys )