20.02.2014, 18:39
Hey. I'm trying to make my player spawn at his house but it's not really working. I have debuged it and the problem lays in this line.
I'm trying to look through all the houses and find a owned house and then compare the name of the owner of the house and the player's name.
pawn Код:
if(HouseInfo[idz][hOwned] == 1 && strcmp(HouseInfo[idz][hOwner], playername) == 0)
pawn Код:
if(PlayerInfo[playerid][pPlayerOwnsHouse] == 1)
{
new playername[24];
new string[64];
GetPlayerName(playerid, playername, sizeof(playername));
for(new idz = 1; idz < sizeof(HouseInfo); idz++)
{
if(HouseInfo[idz][hOwned] == 1 && strcmp(HouseInfo[idz][hOwner], playername) == 0)
{
SetPlayerPos(playerid, HouseInfo[idz][hEntranceX], HouseInfo[idz][hEntranceY], HouseInfo[idz][hEntranceZ]);
SendClientMessage(playerid,COLOR_WHITE, string);
format(string,sizeof(string), "Welcome back to your home, %s.", GetName(playerid));
}
}
}