help =D
#1

pawn Код:
dcmd_buyhouse(playerid,params[])
{
    #pragma unused params
    new pName[MAX_PLAYER_NAME],string[128],file[128],string2[64];
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        if(!IsPlayerInRangeOfPoint(playerid, 3, HInfo[i][HX], HInfo[i][HY], HInfo[i][HZ])) continue;
        if(HInfo[i][owned] != 0) return SendClientMessage(playerid,red,"Error: This house is owned");
        if(GetPlayerMoney(playerid) < HInfo[i][price]) return SendClientMessage(playerid,red,"Error: You dont have enough money");
        format(file,sizeof(file),"HouseSystem/Houses/%d.ini",i);
        format(string2,sizeof(string2),"%s",pName);
        GetPlayerName(playerid,pName,sizeof(pName));
        HInfo[i][owned] = 1;
        HInfo[i][ownername] = string2;
        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);
        GivePlayerMoney(playerid, - HInfo[i][price]);
        return 1;
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
}
pawn Код:
HInfo[i][ownername] = string2;
Quote:

C:\Users\Carlos\Desktop\New folder\filterscripts\housesystem.pwn(94) : error 006: must be assigned to an array
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.

Reply
#2

not so sure im gonna have a look ill post on here if i can help
Reply
#3

Change
pawn Код:
new string2[64];
FOR
pawn Код:
new string2;
Reply
#4

Just replace the error line with this (you'll kick yourself :P):
pawn Код:
format(HInfo[i][ownername], sizeof(HInfo[i][ownername]), "%s", string2);
EDIT: Although I don't see a need for string2, you could just as easily remove string2 and do:
pawn Код:
format(HInfo[i][ownername], sizeof(HInfo[i][ownername]), "%s", pName);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)