11.10.2013, 21:30
You can just use this for GiveMoney
About ower
If you are using this
Then here
It Should be the same huh?
All code.
Код:
GivePlayerMoney(playerid, -HouseInfo[ID][hPrice]);
If you are using this
Код:
if(strmatch(HouseInfo[ID][hOwner], "None"))
Код:
strmid(HouseInfo[ID][sOwner], PlayerName(playerid), 24 , strlen(PlayerName(playerid)), 24);
Код:
strmid(HouseInfo[ID][hOwner], PlayerName(playerid), 24 , strlen(PlayerName(playerid)), 24);
Код:
CMD:buyhouse(playerid, params[]) { new string[100], owner[30], ID; if(sscanf(params, "d", ID)) return UsageMessage(pid, "/buyhouse [houseaddress]"); if(!IsPlayerInRangeOfPoint(pid, 5.5, HouseInfo[ID][hextX], HouseInfo[ID][hextY], HouseInfo[ID][hextZ])) return SCM(pid, COLRED, "Server: {F0F0F0}You are not in range of house!"); if(GetPlayerMoney(playerid) >= HouseInfo[ID][hPrice]) { if(strmatch(HouseInfo[ID][hOwner], "None")) { GivePlayerMoney(playerid, -HouseInfo[ID][hPrice]); //removed the space strmid(HouseInfo[ID][hOwner], PlayerName(playerid), 24 , strlen(PlayerName(playerid)), 24); //24 = MAX_PLAYER_NAME // removed the format and changed it with strlen and strmid Delete3DTextLabel(HouseInfo[ID][hLabel]); format(string, sizeof(string), "%House\nAddress: %d", ID); HouseInfo[ID][hLabel] = Create3DTextLabel(string, COLBLUE, HouseInfo[ID][hextX], HouseInfo[ID][hextY], HouseInfo[ID][hextZ], 20.0, 0, 1); } else return SCM(pid, COLRED, "Server: {f0f0f0}this house is owned."); } else { SCM(pid, COLRED, "Server: {f0f0f0}You don't have enough money."); } return 1