15.12.2010, 21:13
when i do /buyhouse it create ultimate lag to me like it freezes for a bit
then it says im not near a place to buy a house, but i dont understand
why it does such thing -.-
then it says im not near a place to buy a house, but i dont understand
why it does such thing -.-
pawn Код:
dcmd_buyhouse(playerid,params[])
{
#pragma unused params
new pName[MAX_PLAYER_NAME],string[128],file[128];
for(new i = 0; i < MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, HInfo[i][HX], HInfo[i][HY], HInfo[i][HZ]))
{
if(HInfo[i][owned] == 0)
{
if(GetPlayerMoney(playerid) > HInfo[i][price])
{
format(file,sizeof(file),"HouseSystem/Houses/%d.ini",i);
GetPlayerName(playerid,pName,sizeof(pName));
dini_Set(file, "Ownername", pName);
dini_IntSet(file, "Owned", 1);
format(string,sizeof(string),"||- Info: %s has bought a house for %d -||",pName,HInfo[i][price]);
SendClientMessageToAll(0xF50ACCFF,string);
} SendClientMessage(playerid,red,"Error: You dont have enough money");
} SendClientMessage(playerid,red,"Error: This house is owned");
} SendClientMessage(playerid,red,"Error: You arn't near a place to buy a house");
}
return 1;
}