14.07.2010, 23:20
(Bad English i know =D)!
Hi all,
i have 2 problems,
the loop and isplayerinrangeofpoint works not right...
This is my command:
i have three houses, and /kaufen worked only one house, the other two is always the else of IsPlayerInRangeOfPoint !
this is my house.cfg
what is wrong?
i hope anywhere can help me, I do not know what to do
Hi all,
i have 2 problems,
the loop and isplayerinrangeofpoint works not right...
This is my command:
PHP код:
if(strcmp(cmd,"/kaufen",true)==0)
{
for(new h = 0; h < sizeof(HausInfo); h++)
{
if(!IsPlayerInRangeOfPoint(playerid, 3.0, HausInfo[h][eX], HausInfo[h][eY], HausInfo[h][eZ]))return SendClientMessage(playerid,FARBE_WEIЯ,"Du stehst an keinem Haus!");
{
if(SpielerInfo[playerid][pHaus] == 0)
{
if(GetPlayerMoney(playerid) < HausInfo[h][Preis])return 1;
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
GivePlayerMoney(playerid, - HausInfo[h][Preis]);
strmid(HausInfo[h][Besitzer], Name, 0, strlen(Name), 24);
HausInfo[h][Vergeben] = 1;
SpielerInfo[playerid][pHaus] = 1;
SpielerInfo[playerid][pId] = h+1;
WennSpielerUpdatet(playerid);
Kauf(playerid);
SendClientMessage(playerid,FARBE_WEIЯ,"Du hast dir ein Haus gekauft, die befehle kannst du unter /hh sehen!");
return 1;
}
else
{
SendClientMessage(playerid,FARBE_WEIЯ,"Du hast bereits ein Haus, dieses musst du verkaufen!");
return 1;
}
}
}
return 1;
}
this is my house.cfg
PHP код:
eX0=1642.3235,
eY0=-2204.3228,
eZ0=13.5469,
aX0=0.0000
aY0=0.0000
aZ0=0.0000
Preis0=1000
Besitzer0=Staat
Vergeben0=0
Id0=1
//-----------------
eX1=1685.7727,
eY1=-2204.3157,
eZ1=13.5469,
aX1=0.0000
aY1=0.0000
aZ1=0.0000
Preis1=2000
Besitzer1=Staat
Vergeben1=0
Id1=2
//-----------------
eX2=1730.1548,
eY2=-2204.2449,
eZ2=13.5469,
aX2=0.0000
aY2=0.0000
aZ2=0.0000
Preis2=3000
Besitzer2=Staat
Vergeben2=0
Id2=3
i hope anywhere can help me, I do not know what to do