28.11.2010, 10:16
Hi all,
Im having an unusual problem with dini - ive never had it before...
I am creating my own house system (possible release here if its good enough ) - and i am trying to do dini_Get(file, "owner") and compare it using strcmp to see if its owned or not... - But even when the house is owned (A name is in 'Owner')
Here is the corresponding code:
Here is the proof of it not doing anything...
Thanks in advance for your help
Ash!
Im having an unusual problem with dini - ive never had it before...
I am creating my own house system (possible release here if its good enough ) - and i am trying to do dini_Get(file, "owner") and compare it using strcmp to see if its owned or not... - But even when the house is owned (A name is in 'Owner')
Here is the corresponding code:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
new file[64], pName[MAX_PLAYER_NAME], string[128];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
for(new i; i < LastID; i++)
{
if(pickupid == Pickups[i])
{
format(file, sizeof(file), "houses/%i.house", i);
if(strcmp(dini_Get(file, "Owner"), "") == 0)
{
SendClientMessage(playerid, COLOUR, "This house is for sale");
if(dini_Int(file, "Type") == 0)
{
format(string, sizeof(string), "It costs: %i and is a very small house", dini_Int(file, "Cost"));
}
else if(dini_Int(file, "Type") == 1)
{
format(string, sizeof(string), "It costs: %i and is a small house", dini_Int(file, "Cost"));
}
else if(dini_Int(file, "Type") == 2)
{
format(string, sizeof(string), "It costs: %i and is a medium house", dini_Int(file, "Cost"));
}
else if(dini_Int(file, "Type") == 3)
{
format(string, sizeof(string), "It costs: %i and is a big house", dini_Int(file, "Cost"));
}
else if(dini_Int(file, "Type") == 4)
{
format(string, sizeof(string), "It costs: %i and is a very big house", dini_Int(file, "Cost"));
}
else if(dini_Int(file, "Type") == 5)
{
format(string, sizeof(string), "It costs: %i and is a massive house", dini_Int(file, "Cost"));
}
}
else if(strcmp(dini_Get(file, "Owner"), pName) == 0)
{
format(string, sizeof(string), "You own this house, it cost %i", pName, dini_Int(file, "Cost"));
}
else
{
format(string, sizeof(string), "%s owns this house, it cost them %i", dini_Get(file, "Owner"), dini_Int(file, "Cost"));
}
SendClientMessage(playerid, COLOUR, string);
printf("DINI: %s, pName: %s", dini_Get(file, "Owner"), pName); //As you can see here - i tried printing - i have shown what came out below
}
}
}
Код:
[11:09:33] DINI: , pName: Ash
Ash!