30.05.2014, 17:55
Oh... Silly me. Just what i noticed that you didn't put else. So bassically you are telleporting inside the hospital and back outside. Try this:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SECONDARY_ATTACK)
{
for(new i = 0; i <= MAX_BUSINESSES; i++) // now here's a loop through all businesses
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, vInfo[i][exterior][0],vInfo[i][exterior][1],vInfo[i][exterior][2])) // and if player is in range of business entrance
{
if(vInfo[i][bought] == 0) SPMB(playerid, "Noredami pirkti versla rasykite~n~/pirktiversla [ID]");
SetPlayerPos(playerid, vInfo[i][interior][0],vInfo[i][interior][1],vInfo[i][interior][2]);
SetPlayerInterior(playerid, vInfo[i][inter]);
TogglePlayerControllable(playerid, false);
SetTimerEx("FreezeTimer", 2000, false, "i", playerid);
SetPlayerVirtualWorld(playerid, vInfo[i][ID]);
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, vInfo[i][interior][0],vInfo[i][interior][1],vInfo[i][interior][2])) // else if players is range of business exit
{
SetPlayerPos(playerid, vInfo[i][exterior][0],vInfo[i][exterior][1],vInfo[i][exterior][2]);
SetPlayerInterior(playerid, 0);
TogglePlayerControllable(playerid, false);
SetTimerEx("FreezeTimer", 2000, false, "i", playerid);
SetPlayerVirtualWorld(playerid, 0);
}
} // !!!!! and when I want to enter the hospital or exit the hospital system doesn't react to this code below and when i press enter nothing happens.
if(IsPlayerInRangeOfPoint(playerid, 3, 1582.5271,1761.8899,10.8203))
{
SetPlayerInterior(playerid, 3);
SetPlayerPos(playerid,-204.5060,-1736.0486,675.7687);
TogglePlayerControllable(playerid, false);
SetTimerEx("FreezeTimer", 2000, false, "i", playerid);
}
else if(IsPlayerInRangeOfPoint(playerid, 3, -204.4959,-1735.3291,675.7687))
{
if(pInfo[playerid][gydos]) return SPMB(playerid, "~r~Kaip tu iseisi?~n~Tu juk gydaisi!");
SetPlayerInterior(playerid, 0);
SetPlayerPos(playerid, 1582.5271,1761.8899,10.8203);
TogglePlayerControllable(playerid, false);
SetTimerEx("FreezeTimer", 2000, false, "i", playerid);
}
}
return 1;
}