23.01.2010, 21:18
As the title says,
explanation: command /enter does only work for houses and not for the businesses, /test does work with the same code. but just one loop. what is going on here?
explanation: command /enter does only work for houses and not for the businesses, /test does work with the same code. but just one loop. what is going on here?
pawn Код:
dcmd_enter(playerid,params[]) {
#pragma unused params
for(new h = 0; h <= MAX_HOUSES; h++){
if(PlayerToPoint(PTP_RADIUS, playerid, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])){
new Level = HouseInfo[h][hLevel];
if(HouseInfo[h][hLocked] == 1 && strcmp(HouseInfo[h][hName],PlayerName(playerid), false ) != 0) return SendClientMessage(playerid, COLOR_WHITE, ".:: [HOUSE]: This house has been locked by the owner.");
SetPlayerPos(playerid, HousesCoords[Level][0], HousesCoords[Level][1], HousesCoords[Level][2]);
SetPlayerInterior(playerid, HousesLevels[Level][0]); SetPlayerVirtualWorld(playerid, HouseInfo[h][hVirtualWorld]);
} }
for(new i = 0; i <= MAX_BUSINESSES; i++){
if (PlayerToPoint(1.0, playerid,Business[i][EnterX], Business[i][EnterY], Business[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Business[i][EnterWorld])
{
SetPlayerInterior(playerid,Business[i][ExitInterior]);
SetPlayerPos(playerid,Business[i][ExitX],Business[i][ExitY],Business[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Business[i][EnterAngle]);
} } }
return 1;
}
dcmd_test(playerid,params[]) {
for(new i = 0; i <= MAX_BUSINESSES; i++){
if (PlayerToPoint(1.0, playerid,Business[i][EnterX], Business[i][EnterY], Business[i][EnterZ]))
{
if(GetPlayerVirtualWorld(playerid) == Business[i][EnterWorld])
{
SetPlayerInterior(playerid,Business[i][ExitInterior]);
SetPlayerPos(playerid,Business[i][ExitX],Business[i][ExitY],Business[i][ExitZ]);
SetPlayerVirtualWorld(playerid,i);
SetPlayerFacingAngle(playerid,Business[i][EnterAngle]);
} } }
return true;
}