little help =D
#1

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 -.-
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;
}
Reply
#2

Код:
dcmd_buyhouse(playerid,params[])
{
    #pragma unused params
    new pName[MAX_PLAYER_NAME],string[128],file[256];
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 0.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;
}
Post your HINFO variable. (Or how you have definied.)
Reply
#3

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
Код:
dcmd_buyhouse(playerid,params[])
{
    #pragma unused params
    new pName[MAX_PLAYER_NAME],string[128],file[256];
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 0.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;
}
Post your HINFO variable. (Or how you have definied.)
whats does it matter?, why did you aswell put file[256]?
i never use arrays bigger then 128
Reply
#4

bump bump skittly bump ***
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)