Just checking enter command
#1

Should this be like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 10) ==0)////////////////////////////////////////
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }//--------------------------------------------------------------------------------
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}
or like this:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/enter", cmdtext, true, 10) ==0)////////////////////////////////////////
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }//--------------------------------------------------------------------------------
    else if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank0001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}
Reply
#2

else if is better.
Reply
#3

ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/
Reply
#4

Quote:
Originally Posted by Rafa
Посмотреть сообщение
ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/
how do you know if its 1st house if there is same interior??
maybe you put on both houses same teleport coordinates??
Reply
#5

Quote:
Originally Posted by Rafa
Посмотреть сообщение
ohh guys and i want to ask something like this i have make like first exsample of HrvojeCro
and when ill put the same interiorin 2 houses teleport me to the first one...
Please someone tell me what is the problem or i need to use with
pawn Код:
else if
I hope u understand me...
Thanks.

sorry for posting in same topics :/
When you use same interior for two or more different places, then always use different virtualworlds as well. Then, when you teleport out of the interior, check which virtualworld player has. Then use it to teleport player back to the correct entrance.
Reply
#6

Quote:
Originally Posted by TheXIII
Посмотреть сообщение
When you use same interior for two different places, then always use different virtualworlds as well. Then, when you teleport out of the interior, check which virtualworld player has. Then use it to teleport player back to the correct entrance.
thats why i use my own interiors(yes it takes time to make 431671631 interiors but it worths) and there are no same interiors
Reply
#7

hmmm how u mean defferent virtualworlds :/

where i need to put that wirtualwords ? :S
Reply
#8

Quote:
Originally Posted by Rafa
Посмотреть сообщение
hmmm how u mean defferent virtualworlds :/

where i need to put that wirtualwords ? :S
SetPlayerVirtualWorld(..) and GetPlayerVirtualWorld(..) are SA-MPs native functions.
Reply
#9

soo the way is on every same interior to make SetPlayerVirtualWorld() right ?? :/
pawn Код:
if(strcmp("/enter", cmdtext, true, 10) ==0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2207.5254,-1100.4119,31.5547))//--House00000---
    {
        SetPlayerPos(playerid, 2209.3159,-1106.1302,14.9276);
        SetPlayerFacingAngle(playerid, 68.2839);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 1);
    }//--------------------------------------------------------------------------------
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 1412.0670,-1699.9690,13.5395))//--Bank001---
    {
        SetPlayerPos(playerid, 1415.951171,-988.971191,1639.980224);
        SetCameraBehindPlayer(playerid);
        SetPlayerInterior(playerid, 10);
        SetPlayerVirtualWorld(playerid, 2);
    }
    return 1;
    }//--------------------------------------------------------------------------------
    return 0;
}
like this ? :/
Reply
#10

Umm.. kindof.

When player enters interior, set their VW unique to that entrance. So players won't see eachother, although they are in different "buildings". Also, on exit use GetPlayerVirtualWorld to teleport player back to the correct building entrance.

Also, there was/is a bug where chat collides when players are in same interior, but different VW's. You might also want to look into that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)