Благодарю, только вот зачем так сделал?
как же теперь другой код использовать?Код:if(GetPVarInt(playerid, "Miner") == 1 && PRESSED(KEY_WALK) && GetPVarInt(playerid, "Mining") == 0)
и такКод:if(GetPVarInt(playerid, "Miner") == 1 && PRESSED(KEY_WALK) && GetPVarInt(playerid, "Mining") == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0,555.9859,912.4984,851.08721) || IsPlayerInRangeOfPoint(playerid, 3.0,558.9138,900.0824,851.2289) || IsPlayerInRangeOfPoint(playerid, 3.0,598.3822,811.5417,851.8732)) { TextDrawShowForPlayer(playerid,MineralCount); SetProgressBarValue(MineralBar[playerid], MiningProgress[playerid]); ShowProgressBarForPlayer(playerid, MineralBar[playerid]); new r = random(sizeof(MineralTextDraw)); TextDrawShowForPlayer(playerid,MineralTextDraw[r]); SelectTextDraw(playerid, 0xFF4040AA); SetPVarInt(playerid,"Mining", 1); } for(new i = 1; i <= TOTALHOTEL; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z])) { if(PlayerInfo[playerid][pHotelKey] != i || HotelInfo[i][htLock] != 0) continue; SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htExit_X],HotelInfo[i][htExit_Y],HotelInfo[i][htExit_Z]); } if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htExit_X], HotelInfo[i][htExit_Y], HotelInfo[i][htExit_Z])) { SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z]); } } }
не работает!Код:if(PRESSED(KEY_WALK)) { if(GetPVarInt(playerid, "Miner") == 1 && PRESSED(KEY_WALK) && GetPVarInt(playerid, "Mining") == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0,555.9859,912.4984,851.08721) || IsPlayerInRangeOfPoint(playerid, 3.0,558.9138,900.0824,851.2289) || IsPlayerInRangeOfPoint(playerid, 3.0,598.3822,811.5417,851.8732)) { TextDrawShowForPlayer(playerid,MineralCount); SetProgressBarValue(MineralBar[playerid], MiningProgress[playerid]); ShowProgressBarForPlayer(playerid, MineralBar[playerid]); new r = random(sizeof(MineralTextDraw)); TextDrawShowForPlayer(playerid,MineralTextDraw[r]); SelectTextDraw(playerid, 0xFF4040AA); SetPVarInt(playerid,"Mining", 1); } } for(new i = 1; i <= TOTALHOTEL; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z])) { if(PlayerInfo[playerid][pHotelKey] != i || HotelInfo[i][htLock] != 0) continue; SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htExit_X],HotelInfo[i][htExit_Y],HotelInfo[i][htExit_Z]); } if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htExit_X], HotelInfo[i][htExit_Y], HotelInfo[i][htExit_Z])) { SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z]); } } }
мля...
Пробовал так:
и так:Код:if(GetPVarInt(playerid, "Miner") == 1 && PRESSED(KEY_WALK) && GetPVarInt(playerid, "Mining") == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0,555.9859,912.4984,851.08721) || IsPlayerInRangeOfPoint(playerid, 3.0,558.9138,900.0824,851.2289) || IsPlayerInRangeOfPoint(playerid, 3.0,598.3822,811.5417,851.8732)) { TextDrawShowForPlayer(playerid,MineralCount); SetProgressBarValue(MineralBar[playerid], MiningProgress[playerid]); ShowProgressBarForPlayer(playerid, MineralBar[playerid]); new r = random(sizeof(MineralTextDraw)); TextDrawShowForPlayer(playerid,MineralTextDraw[r]); SelectTextDraw(playerid, 0xFF4040AA); SetPVarInt(playerid,"Mining", 1); } for(new i = 1; i <= TOTALHOTEL; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z])) { if(PlayerInfo[playerid][pHotelKey] != i || HotelInfo[i][htLock] != 0) continue; SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htExit_X],HotelInfo[i][htExit_Y],HotelInfo[i][htExit_Z]); } if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htExit_X], HotelInfo[i][htExit_Y], HotelInfo[i][htExit_Z])) { SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z]); } } }
Код выхода и входа в данном случаи не работаютКод:if(PRESSED(KEY_WALK)) { if(GetPVarInt(playerid, "Miner") == 1 && GetPVarInt(playerid, "Mining") == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0,555.9859,912.4984,851.08721) || IsPlayerInRangeOfPoint(playerid, 3.0,558.9138,900.0824,851.2289) || IsPlayerInRangeOfPoint(playerid, 3.0,598.3822,811.5417,851.8732)) { TextDrawShowForPlayer(playerid,MineralCount); SetProgressBarValue(MineralBar[playerid], MiningProgress[playerid]); ShowProgressBarForPlayer(playerid, MineralBar[playerid]); new r = random(sizeof(MineralTextDraw)); TextDrawShowForPlayer(playerid,MineralTextDraw[r]); SelectTextDraw(playerid, 0xFF4040AA); SetPVarInt(playerid,"Mining", 1); } } for(new i = 1; i <= TOTALHOTEL; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z])) { if(PlayerInfo[playerid][pHotelKey] != i || HotelInfo[i][htLock] != 0) continue; SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htExit_X],HotelInfo[i][htExit_Y],HotelInfo[i][htExit_Z]); } if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htExit_X], HotelInfo[i][htExit_Y], HotelInfo[i][htExit_Z])) { SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z]); } } }
Не проще ли так?
Код:if(PRESSED(KEY_WALK)) { for(new i = 1; i <= TOTALHOTEL; i++) { if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z])) { if(PlayerInfo[playerid][pHotelKey] != i || HotelInfo[i][htLock] != 0) continue; SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htExit_X],HotelInfo[i][htExit_Y],HotelInfo[i][htExit_Z]); return 1; } if(IsPlayerInRangeOfPoint(playerid, 1.0, HotelInfo[i][htExit_X], HotelInfo[i][htExit_Y], HotelInfo[i][htExit_Z])) { SetPlayerInterior(playerid,HotelInfo[i][htInt]); SetPlayerVirtualWorld(playerid, HotelInfo[i][htWorld]); SetPlayerPos(playerid,HotelInfo[i][htEnter_X], HotelInfo[i][htEnter_Y], HotelInfo[i][htEnter_Z]); return 1; } } if(GetPVarInt(playerid, "Miner") == 1 && GetPVarInt(playerid, "Mining") == 0) { if(IsPlayerInRangeOfPoint(playerid, 3.0,555.9859,912.4984,851.08721) || IsPlayerInRangeOfPoint(playerid, 3.0,558.9138,900.0824,851.2289) || IsPlayerInRangeOfPoint(playerid, 3.0,598.3822,811.5417,851.8732)) { TextDrawShowForPlayer(playerid,MineralCount); SetProgressBarValue(MineralBar[playerid], MiningProgress[playerid]); ShowProgressBarForPlayer(playerid, MineralBar[playerid]); new r = random(sizeof(MineralTextDraw)); TextDrawShowForPlayer(playerid,MineralTextDraw[r]); SelectTextDraw(playerid, 0xFF4040AA); SetPVarInt(playerid,"Mining", 1); } } }
Эту тему просматривают: 3 (пользователей: 0 , гостей: 3)