24.06.2012, 10:02
Not sure, but perhaps every string has to be the same size. First of all name should be 25 cells because a name can be 24 characters but there's also the null character. Try this:
I would personally set the name to ~ or something if nobody uses the house (you can't have 1-character names).
Also, put spaces after commas it looks a hell of a lot clearer to read, trust me. Just compare my code and yours.
pawn Код:
stock GetPropertyOwnerName(property[])
{
new file[256];
new name[25] = "Nobody";
format(file, sizeof(file), "gamemode/config/properties/%s.txt", property);
if(strcmp(dini_Get(file, "Property_Owner"), "~") != 0)
{
format(name, sizeof(name), "%s", dini_Get(file, "Property_Owner"));
}
return name;
}
Also, put spaces after commas it looks a hell of a lot clearer to read, trust me. Just compare my code and yours.