16.03.2013, 12:08
First of all thank you for reading this.
Alright, so I got the following code:
which is used to convert a house owner's name into his ID if he's online. If not the money will just go to his 'bank account' but that's in a different code.
Anyway, the problem is that I can not convert the name into the player's ID.. it just does nothing.
Alright, so I got the following code:
pawn Код:
stock ConvertOwnerName(playerid)
{
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, pname, sizeof(pname));
GetHouseID(playerid);
format(file, sizeof(file), "Houses/House_%d.ini", HouseID);
format(OwnerName, sizeof(OwnerName), "%s", dini_Get(file, "Owner"));
if(strcmp(pname, OwnerName) == 0) return OwnerID = i;
}
}
return 1;
}
Anyway, the problem is that I can not convert the name into the player's ID.. it just does nothing.