if (newkeys & KEY_SECONDARY_ATTACK) { SCM(playerid, -1, "You pressed KEY_SECONDARY_ATTACK"); if(IsPlayerInRangeOfPoint(playerid, 4.0, 389.8058,173.8332,1008.3828))//Vijecnica Izlaz { SetPlayerPos(playerid, 1481.0699,-1772.3137,18.7958); SetPlayerInterior(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 1554.62,-1675.63,16.20))//PD Ulaz { SetPlayerPos(playerid, 246.79,63.21,1003.64); SetPlayerInterior(playerid, 6); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 246.79,63.21,1003.64))//PD Izlaz { SetPlayerPos(playerid, 1554.62,-1675.63,16.20); SetPlayerInterior(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 1464.9257,-1010.6413,26.8438))//Banka Ulaz { SetPlayerPos(playerid, 2305.7893,-16.1171,26.7496); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 2305.7893,-16.1171,26.7496))//Banka Izlaz { SetPlayerPos(playerid, 1464.9257,-1010.6413,26.8438); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 2495.3174,-1690.3535,14.7656) && PlayerInfo[playerid][Clan] == 7 || IsPlayerInRangeOfPoint(playerid, 1.0, 2495.3174,-1690.3535,14.7656) && PlayerInfo[playerid][Lider] == 7)//GSF Ulaz { SetPlayerPos(playerid, 2496.049804,-1695.238159,1014.742187); SetPlayerInterior(playerid, 3); SetPlayerVirtualWorld(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 2496.049804,-1695.238159,1014.742187) && PlayerInfo[playerid][Clan] == 7 || IsPlayerInRangeOfPoint(playerid, 1.0, 2496.049804,-1695.238159,1014.742187) && PlayerInfo[playerid][Lider] == 7)//GSF Izlaz { SetPlayerPos(playerid, 2495.3174,-1690.3535,14.7656); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 2439.5942,-1338.8033,24.1016) && PlayerInfo[playerid][Clan] == 8 || IsPlayerInRangeOfPoint(playerid, 1.0, 2439.5942,-1338.8033,24.1016) && PlayerInfo[playerid][Lider] == 8)//ESL Ulaz { SetPlayerPos(playerid, 318.564971,1118.209960,1083.882812); SetPlayerInterior(playerid, 5); SetPlayerVirtualWorld(playerid, 0); } if(IsPlayerInRangeOfPoint(playerid, 1.0, 318.564971,1118.209960,1083.882812) && PlayerInfo[playerid][Clan] == 8 || IsPlayerInRangeOfPoint(playerid, 1.0, 318.564971,1118.209960,1083.882812) && PlayerInfo[playerid][Lider] == 8)//ESL Izlaz { SetPlayerPos(playerid, 2439.5942,-1338.8033,24.1016); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); } }
if (newkeys & KEY_SECONDARY_ATTACK)
{
SCM(playerid, -1, "[DEBUG] You pressed KEY_SECONDARY_ATTACK");
if(IsPlayerInRangeOfPoint(playerid, 4.0, 389.8058,173.8332,1008.3828))//Vijecnica Izlaz
{
SetPlayerPos(playerid, 1481.0699,-1772.3137,18.7958);
SetPlayerInterior(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1554.62,-1675.63,16.20))//PD Ulaz
{
SetPlayerPos(playerid, 246.79,63.21,1003.64);
SetPlayerInterior(playerid, 6);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 246.79,63.21,1003.64))//PD Izlaz
{
SetPlayerPos(playerid, 1554.62,-1675.63,16.20);
SetPlayerInterior(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1464.9257,-1010.6413,26.8438))//Banka Ulaz
{
SetPlayerPos(playerid, 2305.7893,-16.1171,26.7496);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2305.7893,-16.1171,26.7496))//Banka Izlaz
{
SetPlayerPos(playerid, 1464.9257,-1010.6413,26.8438);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2495.3174,-1690.3535,14.7656) && PlayerInfo[playerid][Clan] == 7 || IsPlayerInRangeOfPoint(playerid, 1.0, 2495.3174,-1690.3535,14.7656) && PlayerInfo[playerid][Lider] == 7)//GSF Ulaz
{
SetPlayerPos(playerid, 2496.049804,-1695.238159,1014.742187);
SetPlayerInterior(playerid, 3);
SetPlayerVirtualWorld(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2496.049804,-1695.238159,1014.742187) && PlayerInfo[playerid][Clan] == 7 || IsPlayerInRangeOfPoint(playerid, 1.0, 2496.049804,-1695.238159,1014.742187) && PlayerInfo[playerid][Lider] == 7)//GSF Izlaz
{
SetPlayerPos(playerid, 2495.3174,-1690.3535,14.7656);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 2439.5942,-1338.8033,24.1016) && PlayerInfo[playerid][Clan] == 8 || IsPlayerInRangeOfPoint(playerid, 1.0, 2439.5942,-1338.8033,24.1016) && PlayerInfo[playerid][Lider] == 8)//ESL Ulaz
{
SetPlayerPos(playerid, 318.564971,1118.209960,1083.882812);
SetPlayerInterior(playerid, 5);
SetPlayerVirtualWorld(playerid, 0);
}
if(IsPlayerInRangeOfPoint(playerid, 1.0, 318.564971,1118.209960,1083.882812) && PlayerInfo[playerid][Clan] == 8 || IsPlayerInRangeOfPoint(playerid, 1.0, 318.564971,1118.209960,1083.882812) && PlayerInfo[playerid][Lider] == 8)//ESL Izlaz
{
SetPlayerPos(playerid, 2439.5942,-1338.8033,24.1016);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}
else
{
SCM(playerid, -1, "[DEBUG] You are not in a 1.0 range of any teleport points!");
}
}
jakejohnsonusa you code will never work because you use "if" in every IsPlayerInRangeOfPoint not "else if"
Anyway, add a debug ( https://sampwiki.blast.hk/wiki/Debugging ) to see if IsPlayerInRangeOfPoint return true and the problem is another, or the code dont detect you in any of IsPlayerInRangeOfPoint places. |
Actually, you're wrong. The code will work even if it has "if" or "else if". A player cannot be in more than 1 place at the same time, so one of them will be called. However, you're correct on the debugging. He can debug his code to make sure if he's actually in range of point or not.
|