Small problem with the format() function
#1

pawn Код:
format(HouseInformation[houseid][owner],sizeof(HouseInformation[houseid][owner]),"%s",dini_Get(filename,"owner"));//line-295
With the above code i get the following error
Код:
D:\Program Files\Server\filterscripts\AceHouses.pwn(93) : warning 217: loose indentation
D:\Program Files\Server\filterscripts\AceHouses.pwn(295) : error 001: expected token: "]", but found "-identifier-"
D:\Program Files\Server\filterscripts\AceHouses.pwn(295) : warning 215: expression has no effect
D:\Program Files\Server\filterscripts\AceHouses.pwn(295) : error 001: expected token: ";", but found "]"
D:\Program Files\Server\filterscripts\AceHouses.pwn(295) : error 029: invalid expression, assumed zero
D:\Program Files\Server\filterscripts\AceHouses.pwn(295) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
any idea how i can fix this?
Reply
#2

Why you don't get the name with another way

pawn Код:
// An Example:
    new string[ 24 ]
    format(string,sizeof(string),"%s",dini_Get(filename,"owner"));

// Make sure on the enum "owner" is like this:
enum hInfo
{
    owner[ MAX_PLAYER_NAME ],
    // Rest
}
// And..( not sure )
HouseInformation[houseid][owner] = string;
Edit: Or the way user below said. Both works!
Reply
#3

try like this
pawn Код:
format(HouseInformation[houseid][owner], MAX_PLAYER_NAME, "%s", dini_Get(filename,"owner"));
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)