loop problem
#1

So I've made a command /setspawn, but when you choose house or business it'll get you to 0.0 0.0 0.0, basically, it'll loop thro all houses and set the spawn to the coordinates of last looped house.

I however want to set the spawn to the player's house, the one which he owns.
I tried without the "new id = i;" and tried with break but then it only works to player with ID 0

pawn Код:
for(new i = 0; i < MAX_HOUSES; i++)
                        {
                            if(strcmp(HouseInfo[i][Owner], PlayerName(playerid)) == 0)
                            {
                                new id = i;
                                SetSpawnInfo(playerid, PlayerInfo[playerid][Team], PlayerInfo[playerid][Class], HouseInfo[id][EnterX], HouseInfo[id][EnterY], HouseInfo[id][EnterZ], 0, 0, 0, 0, 0, 0, 0);
                                printf("%f, %f, %f", HouseInfo[id][EnterX], HouseInfo[id][EnterY], HouseInfo[id][EnterZ]);
                            }
                        }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)