Loop or IsPlayerInRange problem
#1

Hi all,
excuse me for bad english!.

So,
my problem is this command:

PHP код:
if(strcmp(cmd,"/kaufen",true)==0)
    {
        if(
INI_Open("Haus.cfg"))
        {
             for(new 
0sizeof(HausInfo); h++)
             {
                if(
IsPlayerInRangeOfPoint(playerid3.0HausInfo[h][eX], HausInfo[h][eY], HausInfo[h][eZ]))
                {
                    new 
kString[195];
                    
format(kString64"eX%d"h);
                    
HausInfo[h][eX] = INI_ReadFloat(kString);
                    
format(kString64"eY%d"h);
                    
HausInfo[h][eY] = INI_ReadFloat(kString);
                    
format(kString64"eZ%d"h);
                    
HausInfo[h][eZ] = INI_ReadFloat(kString);
                    if(
SpielerInfo[playerid][pHaus] == 0)
                    {
                          if(
GetPlayerMoney(playerid) < HausInfo[h][Preis])return 1;
                           new 
Name[MAX_PLAYER_NAME];
                        
GetPlayerName(playeridNameMAX_PLAYER_NAME);
                        
GivePlayerMoney(playerid, - HausInfo[h][Preis]);
                        
SendClientMessage(playerid,FARBE_WEIЯ,"Du hast dir ein Haus gekauft, die befehle kannst du unter /hh sehen!");
                        
HausInfo[h][Vergeben] = 1;
                        
SpielerInfo[playerid][pHaus] = 1;
                        
SpielerInfo[playerid][pId] = h+1;
                        
strmid(HausInfo[h][Besitzer], Name0strlen(Name), 24);
                        
WennSpielerUpdatet(playerid);
                        
Kauf(playerid);
                        return 
1;
                    }
                    else
                    {
                           
SendClientMessage(playerid,FARBE_WEIЯ,"Du hast bereits ein Haus, dieses musst du verkaufen!");
                        return 
1;
                    }
                }
                else
                {
                    
SendClientMessage(playerid,FARBE_WEIЯ,"Du stehst an keinem Haus!");
                    return 
1;
                }
            }
        }
        
INI_Close();
        return 
1;
    } 
Always when i write /kaufen, then comming the else message
PHP код:
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du stehst an keinem Haus!");
return 
1;

but i stand in front of a house
I dont know what is wrong, but i hope anywhere can help me.
thx
Reply
#2

I think you need to add SetPlayerPos
Reply
#3

Why SetPlayerPos that has nothing to do with it?
Reply
#4

You are reading the values into the arrays after checking them, this should be the other way around or it will always be 0.0 (middle of map, that farm):

pawn Код:
x = my_ini_x;
y = my_ini_y;
//.........and so on then
if (IsPlayerInRangeOfPoint(playerid, 3.0, x, y................
Reply
#5

I'm so tried, has not worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)