Ich habe ein Problem mit "OnPlayerKeyStateChange"...
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
for(new i; i<MAX_HOUSES; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
{
new Pname[24]; GetPlayerName(playerid, Pname, 24);
if(strcmp(Pname, HouseInfo[i][HouseOwner])) return SendClientMessage(playerid, COLOR_RED, "Du besitzt dieses Haus nicht!");
SetPlayerPos(playerid, HouseInfo[i][TeleX], HouseInfo[i][TeleY], HouseInfo[i][TeleZ]);
SetPlayerInterior(playerid, HouseInfo[i][Interior]);
InHouse[playerid] = i;
SetPlayerVirtualWorld(playerid, HouseInfo[i][Virtual]);
SendClientMessage(playerid, COLOR_GREEN, "Du hast dein Haus betreten!");
return 1;
}
}
if(InHouse[playerid] == -1) return 0;
SetPlayerPos(playerid, HouseInfo[InHouse[playerid]][PickupX], HouseInfo[InHouse[playerid]][PickupY], HouseInfo[InHouse[playerid]][PickupZ]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "Du hast dein Haus verlassen!");
InHouse[playerid] = -1;
for(new r; r<MAX_BIZ; r++)
{
if(IsPlayerInRangeOfPoint(playerid, 3, BizInfo[r][PickX], BizInfo[r][PickY], BizInfo[r][PickZ]))
{
new Pname[24]; GetPlayerName(playerid, Pname, 24);
SetPlayerPos(playerid, BizInfo[r][TelX], BizInfo[r][TelY], BizInfo[r][TelZ]);
SetPlayerInterior(playerid, BizInfo[r][Inter]);
InBiz[playerid] = r;
SetPlayerVirtualWorld(playerid, BizInfo[r][VW]);
SendClientMessage(playerid, COLOR_GREEN, "Du hast das Business betreten!");
return 1;
}
}
if(InBiz[playerid] == -1) return 0;
SetPlayerPos(playerid, BizInfo[InBiz[playerid]][PickX], BizInfo[InBiz[playerid]][PickY], BizInfo[InBiz[playerid]][PickZ]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN, "Du hast das Business verlassen!");
InBiz[playerid] = -1;
}
return 1;
}
Mein Problem ist jetzt, ich kann nur die Häuser betreten, man schaue sich die MAX_HOUSE schleife an, die Biz´s kann
ich aber aus einem Grund nicht betreten, warum auch immer man schaue auf die MAX_BIZ schleife... Warum ? Wo gibt es hier eine Komplikation ?