09.03.2013, 12:24
As the title says, will "strval" convert a player's name to his ID?
new a=strval("12345");
if (strcmp("/buyhouse", cmdtext, true, 10) == 0)
{
GetHouseID(playerid);
format(file, sizeof(file), "House_%d.ini", HouseID);
forSale = dini_Get(file, "ForSale");
houseOwned = dini_Get(file, "Owned");
hValue = dini_Get(file, "Price");
if(strval(forSale) == 1)
{
if(strval(houseOwned) == 1)
{
OwnerName = dini_Get(file, "Owner");
GetPlayerName(playerid, name, sizeof(name));
if(strcmp(name, OwnerName) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: You may not buy your own houses");
if(GetPlayerMoney(playerid) >= strval(hValue))
{
GivePlayerMoney(playerid, GetPlayerMoney(playerid)-strval(hValue));
GivePlayerMoney("OwnerName", strval(hValue)/100*75);
dini_Set(file, "Owner", name);
dini_IntSet(file, "Price", INVALID_HOUSE_PRICE);
dini_IntSet(file, "ForSale", 0);
dini_IntSet(file, "Pickupid", 1273);
dini_IntSet(file, "Owned", 1);
}
}
}
return 1;
}
foreach ( new i: Player)
{
if(strcmp(playername, GetPlayerName(..i), true) != -1)
return i;
}