05.07.2016, 15:03
I Want To make that a person will only be able to buy house if he had more then 5000 Scores Please Help Me Here is My BuyHouse command
Код:
YCMD:buyhouse(playerid, params[], help) { #pragma unused help #pragma unused params new string[210]; new i = GetClosetHouseID(playerid); if(Player[playerid][Houseid] != 999) return SCM(playerid,COLOR_RED,"EROR: "COL_WHITE"You already have house"); if(!IsPlayerInRangeOfPoint(playerid,5.0,House[i][EnterX],House[i][EnterY],House[i][EnterZ])) return SCM(playerid,COLOR_RED,"You are not close to your house."); if(GetPlayerMoney(playerid) < House[i][Price]) return SCM(playerid, COLOR_RED, "You don't have that kind of money."); format(House[i][Owner], 32, "%s", GetName(playerid)); if(House[i][hCar] > 0) format(HouseOwner[House[i][hCar]],64,"%s",GetName(playerid)); House[i][On_Sell] = 0; Player[playerid][Houseid] = i; DestroyDynamicPickup(House[i][PickupU]); House[i][PickupU] = CreateDynamicPickup(1272, 23, House[i][EnterX],House[i][EnterY],House[i][EnterZ],-1,-1,-1,100.0); GivePlayerMoney(playerid, -House[i][Price]); DestroyDynamicMapIcon(House[i][Icon]); House[i][Icon] = CreateDynamicMapIcon(House[i][EnterX],House[i][EnterY],House[i][EnterZ], 32, 0, -1, -1, -1, 100.0); CheckHouse(i); format(string,sizeof(string),"{E0BC1B}Owner: "COL_WHITE"%s\n{E0BC1B}House name: "COL_WHITE"%s\n{E0BC1B}Price: "COL_WHITE"%d\n{E0BC1B}Level: "COL_WHITE"%d\n{E0BC1B}Rent price: "COL_WHITE"%d\n{E0BC1B}Address: "COL_WHITE"%s\n (/renthouse)",House[i][Owner],House[i][HouseName],House[i][Price],House[i][Level],House[i][RentPrice],House[i][Address]); UpdateDynamic3DTextLabelText(House[i][DLabel],-1,string); UpdatePlayerInformation(playerid); return 1; }